Re: [PATCH] Introduce <branch>@{tracked} as shortcut to the tracked branch
- From
Johan Herland <johan@herland.net>
- Date
- Sep 10, 2009, 12:29 UTC
- Message-ID
- <200909101429.30190.johan@herland.net>
- In-Reply-To
- <4AA8DC23.6050500@drmicha.warpmail.net>
On Thursday 10 September 2009, Michael J Gruber wrote:
Show 20 quoted lines
> Johan Herland venit, vidit, dixit 10.09.2009 12:18:
> > On Thursday 10 September 2009, Michael J Gruber wrote:
> >> Johannes Schindelin venit, vidit, dixit 10.09.2009 11:36:
> >>> Often, it is quite interesting to inspect the branch tracked by a
> >>> given branch. This patch introduces a nice notation to get at
> >>> the tracked branch: '<branch>@{tracked}' can be used to access
> >>> that tracked branch.
> >>>
> >>> A special shortcut '@{tracked}' refers to the branch tracked by
> >>> the current branch.
> >>
> >> Sorry, I didn't know the name of the long form was up for
> >> discussion. But it should certainly coincide with the key which
> >> for-each-ref uses, shouldn't it? I don't care whether tracked or
> >> upstream, but for-each-ref's "upstream" has set the precedent.
> >
> > ...and 'git branch --track' set an even earlier precedent...
>
> an unfortunate one, yes. It brings us back to an old discussion. The
> consensus was what's in the glossary:[snip]
Show 9 quoted lines
> Maybe this is a good time to either > > - change the definition of "tracking branch" (to one having an > upstream which is in refs/remotes/; and call "remote upbranch" what's > in refs/remotes/) or > - rename the option and output of git checkout -b/git branch --track. > > Accordingly, either tracked or something else (such as upstream) > would be appropriate for the for-each-ref key and the ref specifier.
Sure, as someone else already stated, I don't care too much what it's named, as long as the naming is consistent across all of git. We do have an unforunate name clash between remote-tracking branches (i.e. branches under refs/remotes/) and 'tracking' branches (i.e. 'git branch --track') [1], and I believe 1.7.0 would be a nice opportunity to clean this up.
I think I vote for the second option, renaming 'git branch --track' to 'git branch --upstream', and s/@{tracked}/@{upstream}/.
Have fun! :)
...Johan
[1]: And also tracked and untracked files, although I believe that is unambiguous in most cases.
-- Johan Herland, <johan@herland.net> www.herland.net