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

Re: Support of '^' as alias for 'HEAD^'

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 14, 2012, 20:34 UTC
Message-ID
<7vr4se5bg4.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vzk725c86.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 18 quoted lines
> Stefan Näwe <stefan.naewe@gmail.com> writes:
>
>> Zeeshan Ali (Khattak <zeeshanak <at> gnome.org> writes:
>>> 
>>> Many times I want to refer to 'HEAD^', 'HEAD^^' and sometimes even
>>> further up the tree. It would be really nice if I didn't have to type
>>> 'HEAD^' but could only type '^'. Bash completion make things easier
>>> but it automatically inserts a space immediately after HEAD so you
>>> have to hit backspace. I think this change would be good in general
>>> anyway.
>>
>> Or even '~1', '~3'.
>
> "^" has a problem when used with other things (does "log ^^2
> origin" mean "log HEAD^2..origin"?  Or "log HEAD^^2 origin"), so I
> do not think it would never fly as an abbreviated syntax.
>
> While I see your "~<N>" much distasteful compared to "^", you still
s/dist/less dist/; sorry ;-)
> need to be a bit more careful when analysing the benefit of such an
> abbreviation.  To shells used by many people, these mean tilde
> expansion ~<N> to refer to elements on the dirstack and you need to
> quote, perhaps like \~3.
Previous: Junio C HamanoNext: Zeeshan Ali (Khattak)
Message 4 of 10 in “Support of '^' as alias for 'HEAD^'”
  1. Zeeshan Ali (Khattak)Jul 14, 2012
  2. Stefan NäweJul 14, 2012
  3. Junio C HamanoJul 14, 2012
  4. Junio C HamanoJul 14, 2012
  5. Zeeshan Ali (Khattak)Jul 14, 2012
  6. Junio C HamanoJul 14, 2012
  7. Zeeshan Ali (Khattak)Jul 14, 2012
  8. Jeff KingJul 15, 2012
  9. Holger HellmuthJul 15, 2012
  10. Zeeshan Ali (Khattak)Jul 15, 2012

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.