Re: [PATCH] Add new @ shortcut for HEAD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 30, 2013 at 2:09 PM, Michael Haggerty <mhagger@xxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]