All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Max Resnick <max.resnick@forgerock.com>
Cc: git@vger.kernel.org
Subject: Re: name-ref on annotated-tags is null terminated, but lightweight tags arent
Date: Fri, 05 Jun 2020 10:04:38 -0700	[thread overview]
Message-ID: <xmqqa71ho34p.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20200605165109.jr6mjl6xz7upofdy@forgemax.local> (Max Resnick's message of "Fri, 5 Jun 2020 09:51:09 -0700")

Max Resnick <max.resnick@forgerock.com> writes:

> What did you do before the bug happened? (Steps to reproduce your issue)
> I was using name-rev to resolve a commits tag name. Annotated tags seem
> to have a null termination and lightweight tags dont.

> ❯ git name-rev --tag --name-only
> 38bdebc9107cab4ab3718d0581632702e74d9209
> annotated-tag^0
>
> /tmp/null-termination-issue on  master
> ❯ git name-rev --tag --name-only
> a340894d3ee655ae6c336a85b42d2215d52609e3
> lightweight-tag

Presumably the long hexadecimal are supposed to be on the same line
as the "name-rev" command itself?

There is nothing broken in the above output.  The anotated tag
(annotated-tag in your example) is an object that merely points at
another object (in which case, the object whose name is 38bdebc9,
which I guess would be a commit) and it itself has an object name
different from 38bdebc9.  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".

On the other hand, your lightweight-tag is directly pointing at the
object a340894d, so saying "lightweight-tag" is sufficient, as there
is no extra layer of indirection (i.e. a tag object) involved.

Hope it helps.

  reply	other threads:[~2020-06-05 17:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05 16:51 name-ref on annotated-tags is null terminated, but lightweight tags arent Max Resnick
2020-06-05 17:04 ` Junio C Hamano [this message]
2020-06-05 17:16   ` Max Resnick
2020-06-05 17:59     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqa71ho34p.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=max.resnick@forgerock.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.