Re: [PATCH] refspec: make @ a valid refspec
From: Felipe Contreras <hidden>
Date: 2020-11-24 22:02:19
On Tue, Nov 24, 2020 at 2:01 PM Junio C Hamano [off-list ref] wrote:
Jeff King [off-list ref] writes:quoted
I wondered if there was a good place to mention this in the refspec documentation, but it may just be an obvious fallout of the "@ is a shortcut for HEAD" definition in gitrevisions(7). The only change is that we're resolving the shortcut sooner so that more code can take advantage of it.I too find that "@ is a shortcut for HEAD" looks ugly both at the UI level and at the implementation level [*1*], but as long as we have it, it is good to try to be consistent and allow "@" everywhere where one would write "HEAD" in places where it is syntacitically infeasible---at least we would be consistently ugly that way ;-).
Beauty is in the eye of the beholder. I find HEAD to be an eyesore.
The title of the change may want to be clarified to help readers of "git shortlog". It's not like it is only changing "@" and no other variants valid refspec, but it forces readers to make sure that the author did not forget to deal with ":@", "src:@", "@:dst", etc. "make @ a synonym to HEAD in refspec" or something along the line, perhaps.
Right. I didn't notice it changed the semantics of those. Given that, your suggested title makes more sense. Cheers. -- Felipe Contreras