Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] Add new @ shortcut for HEAD

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:05

Junio C Hamano [off-list ref] writes:
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help