From: Duy Nguyen Date: Tue, 30 Apr 2013 10:12:08 GMT Subject: Re: [PATCH] Add new @ shortcut for HEAD Message-ID: In-Reply-To: <517F6E40.1040606@alum.mit.edu> On Tue, Apr 30, 2013 at 2:09 PM, Michael Haggerty wrote: > According to git-check-ref-format(1), an "@" character is currently > legal in a reference name as long as it is not followed by "{". As an > example, git-svn uses "@" in reference names (e.g., > "refs/remotes/svn/tags/foo@56945"), I believe when a Subversion branch > or tag is deleted then re-created. Thanks! I was looking for this document but couldn't remember its name. > Amusingly, it is already possible to define a reference or symbolic > reference named "@". So all that you need to do is type > > git symbolic-ref -m "Create @ alias for HEAD" @ HEAD > > to get the shortcut that you want :-) Not so amusingly (and off topic), why reading the code this patch touches, I think if we have a ref whose last component is exactly 40 chars and contains only [0-9a-fA-F], then we simply consider it sha-1 and return without reading the ref. -- Duy