git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] rev-parse: Allow @{U} as a synonym for @{u}

From
Conrad Irwin <conrad.irwin@gmail.com>
Date
Aug 19, 2011, 18:54 UTC
Message-ID
<CAOTq_pvFLs+7QZ2CZT6TVw=m+UioKjtSkuPiBfAnCv=Mb1Q0PQ@mail.gmail.com>
In-Reply-To
<4E4CDBF5.4040709@drmicha.warpmail.net>
On Wed, Aug 17, 2011 at 3:53 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Currently, we use @{...} for:
>
>  - Negative integers are "-N branch-switching ago" (only without any ref
>   on the left);
>  - Non-negative integers "The tip of the named ref before it was changed N
>   times";
>  - An approxidate that is case insensitive; or
>  - "u" and "upstream".
[snip]
Show 5 quoted lines
> The only remotely semi-plausible enhancement I could think of is perhaps
> to allow @{/regexp} to find a reflog entry that matches the given pattern,
> and in such a use case we would certainly want to take the pattern in a
> case sensitive way. This change closes the door to that, and that is the
> only downside I can think of right now.

I'm reasonably convinced by this argument as a refutation of the consistency argument I proposed above. Given that the date format will always be insensitive, and any enhancements added would probably want to be case-sensitive (I can think of a few other things I'd "like", but which are pretty silly: @{merge-base <commits>*}, @{octopus-base <commits>*}); this syntax is always going to be inconsistent. Additionally, as pointed out elsewhere in the thread, the most-similar existing syntax (^{tree}) is already case-sensitive.

Given all of the above, I think that allowing @{upstream} to be case-insensitive is certainly wrong, as it's slightly confusing and not very useful.

Given that @{upstream} should be case-sensitive, it would be bizarre to allow @{U} as a synonym, so I think I'm convinced that this is not worth it, despite the convenience it brings.

On Thu, Aug 18, 2011 at 2:31 AM, Michael J Gruber <git@drmicha.warpmail.net> wrote:

>>> As a simpler case, a user could tailor to her keyboard layout with
>>>
>>> git config revalias.↓ u
>>
Hmm, this opens up interesting ideas:

git config revalias.base = '! git merge-base -a "$@"' git show HEAD@{base master}

but that seems like it's a bit over-the-top for some reason :).
Conrad
Previous: Michael J Gruber
Message 8 of 8 in “can we have @{U} as an alias for @{u}”
  1. Sitaram ChamartyAug 13, 2011
  2. rev-parse: Allow @{U} as a synonym for @{u}Conrad Irwin, Aug 14, 2011
  3. Junio C HamanoAug 17, 2011
  4. Nguyen Thai Ngoc DuyAug 18, 2011
  5. Michael J GruberAug 18, 2011
  6. Nguyen Thai Ngoc DuyAug 18, 2011
  7. Michael J GruberAug 18, 2011
  8. Conrad IrwinAug 19, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.