From: Thomas Rast Date: Tue, 30 Apr 2013 13:01:22 GMT Subject: Re: [PATCH] refs.c: interpret @ as HEAD Message-ID: <87zjwguq8t.fsf@linux-k42r.v.cablecom.net> In-Reply-To: <1367324685-22788-1-git-send-email-artagnon@gmail.com> Ramkumar Ramachandra writes: > The rev spec forms @{}, .., ... fill in HEAD as the missing argument > automatically. Unfortunately, HEAD~ is a very common idiom and > there is no way to make HEAD implicit here (due the shell expansion of > ~). > > 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 @ HEAD But 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