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

Re: [PATCH] git-rev-parse.txt: clarify meaning of rev~ and rev~0.

From
SOSergei Organov <osv@javad.com>
Date
Mar 14, 2008, 19:11 UTC
Message-ID
<87prtxm875.fsf@osv.gnss.ru>
In-Reply-To
<alpine.LFD.1.00.0803141141240.3557@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 15 quoted lines
> On Fri, 14 Mar 2008, Sergei Organov wrote:
>>
>> +                      ...  'rev{tilde}' is equivalent to 'rev{tilde}0'
>> +  which in turn is equivalent to 'rev'.
>
> I'd actually prefer to just fix that. 
>
> I think it would make more sense to have the same guarantees that rev^ 
> has, namely to always return a commit. I would also suggest that not 
> giving a number would have the same effect of defaulting to 1, not 0.
>
> Right now it's a bit illogical, but at least it's an _undocumented_ 
> illogical behaviour. If we document it, we should fix it and document the 
> logical behaviour instead, no?
>

I entirely agree. I just took (maybe erroneously) Junio's answer to my original question as "this behavior is by design", assuming some rationale behind it, so submitted the above patch to documentation.

-- Sergei.
Previous: Linus TorvaldsNext: Junio C Hamano
Message 3 of 4 in “git-rev-parse.txt: clarify meaning of rev~ and rev~0.”
  1. git-rev-parse.txt: clarify meaning of rev~ and rev~0.Sergei Organov, Mar 14, 2008
  2. Linus TorvaldsMar 14, 2008
  3. Sergei OrganovMar 14, 2008
  4. Junio C HamanoMar 14, 2008

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.