Re: [PATCH v1 2/2] worktree: make add dwim

2017-11-18 Thread Thomas Gummerer
On 11/15, Thomas Gummerer wrote: > On 11/14, Eric Sunshine wrote: > > On Tue, Nov 14, 2017 at 3:14 PM, Eric Sunshine > > wrote: > > > For my own edification... > > > [...] > > > git worktree add ../topic > > > > > > * Correctly errors out, refusing to create a new branch named "topic", > > > if "

Re: [PATCH v1 2/2] worktree: make add dwim

2017-11-15 Thread Eric Sunshine
On Wed, Nov 15, 2017 at 3:50 AM, Thomas Gummerer wrote: > On 11/14, Eric Sunshine wrote: >> git worktree add ../topic >> [...] >> The desired new DWIMing would change the second bullet point to: >> >> * If no local branch named "topic" exists, DWIM it from "origin/topic" >> if possible, else creat

Re: [PATCH v1 2/2] worktree: make add dwim

2017-11-15 Thread Thomas Gummerer
On 11/14, Eric Sunshine wrote: > On Tue, Nov 14, 2017 at 3:14 PM, Eric Sunshine > wrote: > > For my own edification... > > [...] > > git worktree add ../topic > > > > * Correctly errors out, refusing to create a new branch named "topic", > > if "topic" is already a branch. > > By the way, there'

Re: [PATCH v1 2/2] worktree: make add dwim

2017-11-15 Thread Thomas Gummerer
On 11/14, Eric Sunshine wrote: > On Tue, Nov 14, 2017 at 3:45 AM, Thomas Gummerer wrote: > > On 11/13, Junio C Hamano wrote: > >> If so, as long as the new DWIM kicks in ONLY when "topic" does not > >> exist, I suspect that there is no backward compatibility worries. > >> The command line > >> > >

Re: [PATCH v1 2/2] worktree: make add dwim

2017-11-14 Thread Eric Sunshine
On Tue, Nov 14, 2017 at 3:14 PM, Eric Sunshine wrote: > For my own edification... > [...] > git worktree add ../topic > > * Correctly errors out, refusing to create a new branch named "topic", > if "topic" is already a branch. By the way, there's an additional DWIM that could be done here instead

Re: [PATCH v1 2/2] worktree: make add dwim

2017-11-14 Thread Eric Sunshine
On Tue, Nov 14, 2017 at 3:45 AM, Thomas Gummerer wrote: > On 11/13, Junio C Hamano wrote: >> If so, as long as the new DWIM kicks in ONLY when "topic" does not >> exist, I suspect that there is no backward compatibility worries. >> The command line >> >> $ git worktree add ../a-new-worktree to

Re: [PATCH v1 2/2] worktree: make add dwim

2017-11-14 Thread Thomas Gummerer
On 11/13, Junio C Hamano wrote: > Thomas Gummerer writes: > > > I'm a bit torn about hiding his behind an additional flag in git > > worktree add or not. I would like to have the feature without the > > additional flag, but it might break some peoples expectations, so > > dunno. > > Yeah, I agr

Re: [PATCH v1 2/2] worktree: make add dwim

2017-11-12 Thread Junio C Hamano
Thomas Gummerer writes: > I'm a bit torn about hiding his behind an additional flag in git > worktree add or not. I would like to have the feature without the > additional flag, but it might break some peoples expectations, so > dunno. Yeah, I agree with the sentiment. But what expectation wou

[PATCH v1 2/2] worktree: make add dwim

2017-11-12 Thread Thomas Gummerer
Currently git worktree add creates a new branch, that matches the HEAD of whichever worktree we were on when calling "git worktree add". Add a --guess flag to git worktree add, that makes it behave like the dwim machinery in 'git checkout ', i.e. check if the new branch name uniquely matches the b