Re: [PATCH] worktree: teach "add" to check out existing branches

2018-01-22 Thread Thomas Gummerer
On 01/22, Duy Nguyen wrote: > On Sun, Jan 21, 2018 at 7:02 PM, Thomas Gummerer wrote: > > [...] > > + > > If `` is omitted and neither `-b` nor `-B` nor `--detach` used, > > -then, as a convenience, a new branch based at HEAD is created > > automatically, > > -as if `-b

Re: [PATCH] worktree: teach "add" to check out existing branches

2018-01-22 Thread Duy Nguyen
On Sun, Jan 21, 2018 at 7:02 PM, Thomas Gummerer wrote: > Currently 'git worktree add ' creates a new branch named after the > basename of the path by default. If a branch with that name already > exists, the command refuses to do anything, unless the '--force' option > is

Re: [PATCH] worktree: teach "add" to check out existing branches

2018-01-21 Thread Robert P. J. Day
On Sun, 21 Jan 2018, Thomas Gummerer wrote: > Currently 'git worktree add ' creates a new branch named after the > basename of the path by default. If a branch with that name already > exists, the command refuses to do anything, unless the '--force' option > is given. > > However we can do a

[PATCH] worktree: teach "add" to check out existing branches

2018-01-21 Thread Thomas Gummerer
Currently 'git worktree add ' creates a new branch named after the basename of the path by default. If a branch with that name already exists, the command refuses to do anything, unless the '--force' option is given. However we can do a little better than that, and check the branch out if it is