Re: [PATCH] Add new @ shortcut for HEAD
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Apr 30, 2013, 06:07 UTC
- Message-ID
- <CACsJy8Af5Z6DzsAchu2MpMeanTEJiF-DwhdPMGE9n6QKf2K6Eg@mail.gmail.com>
- In-Reply-To
- <1367264106-2351-1-git-send-email-felipe.contreras@gmail.com>
On Tue, Apr 30, 2013 at 2:35 AM, Felipe Contreras <felipe.contreras@gmail.com> wrote:
Show 8 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.This patch also allows funny things like @{-1}@ (wanted to try the cute syntax @{u}@ but too lazy to setup upstream)
$ ./git rev-parse @{-1} 7e6a0cc47da79dd22c0338aee8750fda92ced5d9 $ ./git rev-parse @{-1}@ 7e6a0cc47da79dd22c0338aee8750fda92ced5d9 $ ./git rev-parse @{-1}@{0} @{-1}@{0} fatal: ambiguous argument '@{-1}@{0}': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' -- Duy