Re: [PATCH v3] checkout & worktree: introduce checkout.implicitRemote

2018-05-31 Thread Ævar Arnfjörð Bjarmason
On Thu, May 24 2018, Ævar Arnfjörð Bjarmason wrote: > struct tracking_name_data { > /* const */ char *src_ref; > char *dst_ref; > struct object_id *dst_oid; > int unique; > + const char *implicit_remote; > + char *implicit_dst_ref; > }; There's a bug here that

Re: [PATCH v3] checkout & worktree: introduce checkout.implicitRemote

2018-05-26 Thread Duy Nguyen
On Fri, May 25, 2018 at 8:38 PM, Ævar Arnfjörð Bjarmason wrote: > > On Fri, May 25 2018, Duy Nguyen wrote: > >> On Fri, May 25, 2018 at 10:12 AM, Junio C Hamano wrote: +Currently this is used by linkgit:git-checkout[1] when 'git checkout +' will

Re: [PATCH v3] checkout & worktree: introduce checkout.implicitRemote

2018-05-25 Thread Ævar Arnfjörð Bjarmason
On Fri, May 25 2018, Duy Nguyen wrote: > On Fri, May 25, 2018 at 10:12 AM, Junio C Hamano wrote: >>> +Currently this is used by linkgit:git-checkout[1] when 'git checkout >>> +' will checkout the '' branch on another remote, >>> +and by linkgit:git-worktree[1] when 'git

Re: [PATCH v3] checkout & worktree: introduce checkout.implicitRemote

2018-05-25 Thread Duy Nguyen
On Fri, May 25, 2018 at 10:12 AM, Junio C Hamano wrote: >> +Currently this is used by linkgit:git-checkout[1] when 'git checkout >> +' will checkout the '' branch on another remote, >> +and by linkgit:git-worktree[1] when 'git worktree add' refers to a >> +remote branch. This

Re: [PATCH v3] checkout & worktree: introduce checkout.implicitRemote

2018-05-25 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > +checkout.implicitRemote:: > + When you run 'git checkout ' and only have one > + remote, it may implicitly fall back on checking out and > + tracking e.g. 'origin/'. Yup, that is quite implicit. It works without configuring

[PATCH v3] checkout & worktree: introduce checkout.implicitRemote

2018-05-24 Thread Ævar Arnfjörð Bjarmason
Introduce a checkout.implicitRemote setting which can be used to designate a remote to prefer (via checkout.implicitRemote=origin) when running e.g. "git checkout master" to mean origin/master, even though there's other remotes that have the "master" branch. I want this because it's very handy to