Re: [PATCH] worktree: allow "-" short-hand for @{-1} in add command

2016-05-27 Thread Junio C Hamano
Jordan DE GEA writes: >>> +test_expect_success '"add" using shorthand - fails when no previous >>> branch' ' >>> + test_must_fail git worktree add existing - >>> +' >> >> Just an observation, but the error message we would see here might >> be interesting. > >

Re: [PATCH] worktree: allow "-" short-hand for @{-1} in add command

2016-05-27 Thread Junio C Hamano
Matthieu Moy writes: > Junio C Hamano writes: > >> Jordan DE GEA writes: >> >>> + branch=$(cd short-hand && git rev-parse --symbolic-full-name HEAD) && >>> + test "$branch" = refs/heads/newbranch && >>> + cd

Re: [PATCH] worktree: allow "-" short-hand for @{-1} in add command

2016-05-27 Thread Jordan DE GEA
>> +test_expect_success '"add" using shorthand - fails when no previous branch' >> ' >> +test_must_fail git worktree add existing - >> +' > > Just an observation, but the error message we would see here might > be interesting. Of course, that’s useful to be sure of the error, I will do in

Re: [PATCH] worktree: allow "-" short-hand for @{-1} in add command

2016-05-27 Thread Matthieu Moy
Junio C Hamano writes: > Jordan DE GEA writes: > >> +branch=$(cd short-hand && git rev-parse --symbolic-full-name HEAD) && >> +test "$branch" = refs/heads/newbranch && >> +cd .. > > If any of the command between "cd short-hand" and

Re: [PATCH] worktree: allow "-" short-hand for @{-1} in add command

2016-05-26 Thread Junio C Hamano
Jordan DE GEA writes: > From: Jordan DE GEA > > Since `git worktree add` uses `git checkout` when `[]` is used, > and `git checkout -` is already supported, it makes sense to allow the > same shortcut in `git worktree add`.

[PATCH] worktree: allow "-" short-hand for @{-1} in add command

2016-05-26 Thread Jordan DE GEA
From: Jordan DE GEA Since `git worktree add` uses `git checkout` when `[]` is used, and `git checkout -` is already supported, it makes sense to allow the same shortcut in `git worktree add`. Signed-off-by: Matthieu Moy