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

Re: ~ and ^

From
Junio C Hamano <junkio@cox.net>
Date
May 13, 2007, 19:07 UTC
Message-ID
<7v8xbssfti.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070513144442.b3cba792.seanlkml@sympatico.ca>
Sean <seanlkml@sympatico.ca> writes:
Show 5 quoted lines
> Would it be possible/reasonable to treat a bare ~3 (or ^) on the git command
> line as equivalent to "<current branch>~3" ?    At least @{3} already works
> this way and it would be nice to do the same for the even more common tilde
> and hat operations.  If so, it would be a small convenience to just type:
> "git show ~3"
Interesting.

At least, "ls ~0" does not seem to get confused by bash to be the home directory of the root user, so I do not offhand think of a reason not to have ~$n as a synonym to HEAD~$n. Would that be useful? I dunno.

P.S.
Welcome back to the list ;-)
Previous: SeanNext: Karl Hasselström
Message 2 of 6 in “~ and ^”
  1. SeanMay 13, 2007
  2. Junio C HamanoMay 13, 2007
  3. Karl HasselströmMay 13, 2007
  4. SeanMay 13, 2007
  5. SeanMay 13, 2007
  6. Robin RosenbergMay 13, 2007

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.