Subject: Re: [PATCH] Document and test the new % shotcut for the tracked branch

From: Michael J Gruber <[email-masked]>
Date: Fri, 20 Mar 2009 11:38:56 +0100

Johannes Schindelin venit, vidit, dixit 20.03.2009 11:31:
> Hi,
> 
> On Fri, 20 Mar 2009, Michael J Gruber wrote:
> 
>> Signed-off-by: Michael J Gruber <[email-masked]>
>> ---
> 
> That is brutal.  First shot, then cut.

I'm sorry! But you're a tough guy, you'll recover...

> 
>> Johannes Schindelin venit, vidit, dixit 20.03.2009 10:29:
>>>
>>> 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: 'BEL<branch>' can be used to access that tracked 
>>> branch.
>>>
>>> A special shortcut 'BEL' refers to the branch tracked by the current 
>>> branch.
>>>
>>> Suggested by Pasky and Shawn.
>>>
>>> This patch extends the function introduced to handle the nth-last 
>>> branch (via the {-<n>} notation); therefore that function name was 
>>> renamed to something more general.
>>>
>>> Signed-off-by: Johannes Schindelin <[email-masked]>
>>
>> I guess you beat me to it then, which is fine.
> 
> I had it ready yesterday!  But the real problem is not addressed by your 
> patch, either: '%<branch>' is a legal branch name.

No, of course, I just added doc+test to your patch v2, since you seemed
to encourage people to do so.

I would have sent it out yesterday if my tests hadn't shown a problem.
(Or did you misunderstand my doc notation? <branch> = ${branch} =
"branch" placeholder for a generic branch name)

> I briefly considered <branch>^{tracked}, but
> 
> - the ^{} codepath does not try to substitute branch _names_, so we'd have 
>   to duplicate that ^{} detection, and,
> 
> - it is really cumbersome to write.
> 
>> But haven't you seen my note about the failing test either? The code 
>> below tests with branches which track local branches. merge and remote 
>> is set for the branch in question ("tracking"), it's just that remote is 
>> ".". It seems that the remote.c code does not set up merge info for 
>> these branches.
> 
> I have seen it, it's just not my itch, and I am busy enough as it is.

If I'm not totally off-track (which I may well be) then that problem
should show up with other uses of the merge/track setting as well. I
guess it's just that everyone tracks remote branches, not local ones.

I'll see if I have time...

>> <Goes to figure out how to enter BEL...>
> 
> Ctrl-v Ctrl-g
> 
> Ciao,
> Dscho

Bing bing bing...

Michael