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

Re: name-ref on annotated-tags is null terminated, but lightweight tags arent

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 5, 2020, 17:59 UTC
Message-ID
<xmqq3679o0lr.fsf@gitster.c.googlers.com>
In-Reply-To
<20200605171607.rducvc4xretxacn5@forgemax.local>
Max Resnick <max.resnick@forgerock.com> writes:
Show 14 quoted lines
> Thanks Junio for the quick response.
>
>> Presumably the long hexadecimal are supposed to be on the same line 
>> as the "name-rev" command itself?                                   
>
> Yes, sorry I didn't see that the formatting was broken before I sent.
>
>> The suffix "^0" (which has nothing to do 
>> with null-termination) means "I do not mean the tag object itself, 
>> but the object that is pointed by it".                             
>
> Ok, thanks. I need to unpack that a bit more. I tried to dig around in
> the man to see if there was indication if that's what was expected but
> didn't find anything at less for name-rev.
"git help revisions" has this, which may help.
       <rev>^[<n>], e.g. HEAD^, v1.5.1^0
                  A suffix ^ to a revision parameter means the first
                  parent of that commit object.  ^<n> means the
                  <n>th parent (i.e.  <rev>^ is equivalent to
                  <rev>^1).  As a special rule, <rev>^0 means the
                  commit itself and is used when <rev> is the object
                  name of a tag object that refers to a commit
                  object.

The help text in "git help name-rev" only says "names suitable for human digestion", which may want to be clarified.

Thanks.
Previous: Max Resnick
Message 4 of 4 in “name-ref on annotated-tags is null terminated, but lightweight tags arent”
  1. Max ResnickJun 5, 2020
  2. Junio C HamanoJun 5, 2020
  3. Max ResnickJun 5, 2020
  4. Junio C HamanoJun 5, 2020

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.