Re: [PATCH] Add new @ shortcut for HEAD
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 30, 2013, 19:59 UTC
- Message-ID
- <7v8v3zdc2m.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <7vhaindcuk.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
> The rule would be "You should be able to say '@' where-ever you > currently say HEAD" (aka '@' is a short-hand for 'HEAD'). > > That means "git checout @" should work the same way as "git checkout > HEAD", "git log @~4" would work the same way as "git log HEAD~4", > "git update-ref @ $(git rev-parse master)" should update the HEAD > without creating $GIT_DIR/@, etc. > > You can't go any simpler than that rule, and there is no room for > confusion if that rule is properly implemented. > > Hmm?
I personally would not mind an easier-to-implement rule that says "You can say '@' to mean HEAD^0, i.e. the object name of the commit at the tip of your current branch". That would make sure that nobody would expect "git update-ref @ $(git rev-parse master~4)" to work.