Re: [PATCH] refs.c: interpret @ as HEAD
- From
Thomas Rast <trast@inf.ethz.ch>
- Date
- Apr 30, 2013, 13:01 UTC
- Message-ID
- <87zjwguq8t.fsf@linux-k42r.v.cablecom.net>
- In-Reply-To
- <1367324685-22788-1-git-send-email-artagnon@gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 15 quoted lines
> The rev spec forms @{}, .., ... fill in HEAD as the missing argument
> automatically. Unfortunately, HEAD~<n> is a very common idiom and
> there is no way to make HEAD implicit here (due the shell expansion of
> ~<n>).
>
> However, there is an alternative solution to the issue: overload the
> character @ to mean HEAD. Do this at the lowest possible layer of
> abstraction: in dwim_ref(), substitute @ with HEAD just before calling
> resolve_ref_unsafe(). The program will only reach this point after
> the other specs like ~, ^ and @{} have been resolved; therefore, it is
> safe to do it here.
>
> This patch has the exact same effect as:
>
> $ git symbolic-ref @ HEADBut then why don't you just 'git symbolic-ref H HEAD' for a sort of "local alias"?
What annoys me more is that there's no way to say
git symbolic-ref U @{u}so that I can avoid that -- it's really clumsy to type on a Swiss German keyboard. We'd need some sort of ref-alias feature for that to work.
--
Thomas Rast
trast@{inf,student}.ethz.ch