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

From: Petr Baudis <[email-masked]>
Date: Sun, 22 Mar 2009 18:40:16 +0100

On Fri, Mar 20, 2009 at 12:48:50PM +0100, Johannes Schindelin wrote:
> Hi,
> 
> On Fri, 20 Mar 2009, Petr Baudis wrote:
> 
> > On Fri, Mar 20, 2009 at 11:31:31AM +0100, Johannes Schindelin wrote:
> > > I had it ready yesterday!  But the real problem is not addressed by 
> > > your patch, either: '%<branch>' is a legal 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.
> > 
> > We already have @{N} to do one branch-based substitution, so what about 
> > following this convention? Can't we have @{t}?
> 
> Have you ever tried a German keyboard layout?  You would not say that @{} 
> is easy to write if you did.

Interesting, do you really use the regular German keyboard layout while
working in shell or programming? Most Czech people I know [*] use either
the USA layout or Czech programming layout.

> Besides, @{<string>} is already taken for the date-based reflog.

Yes, but some strings can never be dates. ;-)

Has our ref-shed painting fest reached any conclusion yet? I'm not fond
of spending more one-off sequences (~, //, ../, ...) on this, or
anything containing a colon (too confusing, IMHO). It would be nice to
get some generic escaping syntax.

The cleanest way I can think of is declaring ~ a special character and
having <ref>~<letter> as a generic way for ref-based expansions;
master~t would then expand to tracked branch of master.

The only(?) downside is that to mangle HEAD ref, you should write \~t
(but you won't notice your mistake until user 't' appears), but that's
a tough call...

(Should HEAD~t -> $HEAD~t -> master~t -> origin/master or rather
HEAD~t -> origin/HEAD? The former is more intuitive, I guess.)

[*] Since most Czech people I know are UNIX users, it seems...

-- 
				Petr "Pasky" Baudis
The average, healthy, well-adjusted adult gets up at seven-thirty
in the morning feeling just terrible. -- Jean Kerr