Re: [PATCH] object-name: accept @{p} as short for @{push}
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 30, 2026, 22:07 UTC
- Message-ID
- <xmqqbj9e8kb3.fsf@gitster.g>
- In-Reply-To
- <CALnO6CBR0XJUJR=2e5kUM8Fk9aV5uz+QxajRpnFFVTEkFfJQ3Q@mail.gmail.com>
"D. Ben Knoble" <ben.knoble@gmail.com> writes:
Show 17 quoted lines
> On Wed, Sep 30, 2026 at 4:06 PM Harald Nordgren via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>>
>> From: Harald Nordgren <haraldnordgren@gmail.com>
>>
>> Typing "git log @{p}.." fails with "unknown revision", even though
>> "@{u}" works as the short form of "@{upstream}". Users who reach for
>> the one letter spelling of the push destination by analogy get an
>> error.
>>
>> Accept "@{p}" wherever "@{push}" is accepted, in any case, just like
>> "@{u}".
>
> I've oft wanted this. Though, I don't have a `p = push` (or `p =
> pull`) alias set, because it could be short for either!
>
> There's no "@{pull}", though, so that reasoning doesn't apply here.Interesting thing to point out. Letting @{push} squat on @{p} would prevent us from adding @{pull} and anything that begins with 'p' in the future (like 'previous', perhaps?).
> I have to wonder if there's an older discussion around these notations > that explains why one got shorthand and the other didn't?
But we have lived with only two at_marks in the object name syntax, for upstream and for push, and nothing else for quite some time. So perhaps it is OK to assume that we do not have to worry about any new ones in the future?
Digging the history, @{upstream} came in 2010 and @{push} came in 2015.
@{u} existed since the inception of @{upstream}, as we can see in https://lore.kernel.org/git/20150331173740.GE18912@peff.net/ which is the first iteration of the patch set that added @{push}. It is unclear what was said during the review of v2 [*] but in the review of v3 https://lore.kernel.org/git/20150521045233.GA26507@peff.net/, nobody questioned the asymmetry between @{upstream} having a short-and-sweet @{u} while @{push} lacked the corresponding @{p}.
I do not know if that was because "push" was so short and easy to type anyway?
[Footnote]
* https://public-inbox.org/git/?q=gmane:268185 would have given us a good way to find what thread Peff was referring to in the cover letter of v3 iteration:
https://lore.kernel.org/git/20150521044429.GA5857@peff.net/
Unfortunately, we are getting 502 back X-<.