From: Santi Béjar Date: Thu, 18 Jun 2009 13:55:53 GMT Subject: Re: [RFC/PATCH 1/2] remote tracking: return the tracking branch for the given branches Message-ID: In-Reply-To: 2009/6/18 Jakub Narebski : > Santi Béjar writes: >> 2009/6/18 Johannes Schindelin : >>> On Thu, 18 Jun 2009, Santi Béjar wrote: >>> >>>> diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt >>>> index 9e2b4ea..e444899 100644 >>>> --- a/Documentation/git-remote.txt >>>> +++ b/Documentation/git-remote.txt >>>> @@ -17,6 +17,7 @@ SYNOPSIS >>>> 'git remote show' [-n] >>>> 'git remote prune' [-n | --dry-run] >>>> 'git remote update' [-p | --prune] [group | remote]... >>>> +'git remote tracking' ... >>>> >>>> DESCRIPTION >>>> ----------- >>>> @@ -128,6 +129,12 @@ be updated. (See linkgit:git-config[1]). >>>> + >>>> With `--prune` option, prune all the remotes that are updated. >>>> >>>> +'tracking':: >>>> + >>>> +Returns the tracking branch for the given remote () and branch >>>> +(). Note that must exactly match the left hand side of >>>> +the refspec of the given remote. >>>> + >>> >>> From that description, it is not clear to me if the branch is the _remote_ >>> branch, the branch _on_ the remote, or the local branch. >> >> OK. s/and branch/and remote branch/ >> >>> If it is the remote branch (or the branch on the remote), I wonder how you >>> deal with ambiguities, as I can easily create hundreds of branches >>> tracking the same remote branch. >> >> AFAICS from remote_find_tracking (and some tests), it picks the first match. >> >> So, additional text could be: In case of multiple matches, it picks >> the first one. > > Why not have both: It makes sense. > > git remote tracking > > would show all local branches that track , and have > as default remote, Maybe my description is unclear, but it's not about local branches which track on , it is about the local branch representation of the remote branch, i.e. not 'master' but origin/master (git remote tracking origin master in a default clone). > while > > git remote tracking > > would show and if is following > remote-tracking branch. Good idea. Santi > -- > Jakub Narebski > Poland > ShadeHawk on #git >