Re: [PATCH] Add new @ shortcut for HEAD
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 29, 2013, 20:01 UTC
- Message-ID
- <7va9ohhzsi.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1367264106-2351-1-git-send-email-felipe.contreras@gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 15 quoted lines
> So HEAD@{0}~0^0 is too much to type, but we can remove '^0', and we can
> remove '~0', and we can remove 'HEAD', but we can't remove '{0}'?
>
> This patch allows 'HEAD@' to be the same as 'HEAD@{0}', and similarly with
> 'master@'.
>
> So we can type '@' instead of 'HEAD@', or rather 'HEAD'. So now we can
> use 'git show @~1', and all that goody goodness.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>
> People have complained about the lack of a HEAD shortcut before, and some
> proposals have been made, but I think this one is a clean trick in accordance
> with our current syntax.Technically the notation would be only valid if you have a reflog on it, but if we must have such a notation, I think this may end up to be the least bad one. I haven't thought things through, though, so won't stand behind it myself (i.e. when there are corner-case holes found later, I won't defend the notation myself), at least not yet.