Re: Strange annotated tag issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 21, 2019 at 11:59:42AM -0500, Robert Dailey wrote:

> I have a particular tag in my repo that shows 2 annotated
> descriptions, which is very confusing.
> 
> The command I ran:
> 
> ```
> git show --format=fuller 4.2.0.1900
> ```
> 
> And the output:
> 
> ```
> tag 4.2.0/1900
> Tagger:     John Doe <john.doe@xxxxxxxxxx>
> TaggerDate: Fri Jul 18 10:46:30 2014 -0500
> 
> QA/Internal Release for 4.2.0.19
> 
> tag 4.2.0/1900
> Tagger:     John Doe <john.doe@xxxxxxxxxx>
> TaggerDate: Fri Jul 18 10:46:15 2014 -0500
> 
> QA/Internal Release
> 
> commit 2fcfd00ef84572fb88852be55315914f37e91e11 (tag: 4.2.0.1900)

Tags can point to any object, including another tag. It looks like
somebody made an annotated tag of an annotated tag (probably by
mistake, given that they have the same tag-name).

Try this:

  git init
  git commit -m commit --allow-empty
  git tag -m inner mytag HEAD
  git tag -f -m outer mytag mytag

  git show mytag

which produces similar output. You can walk the chain yourself with "git
at-file tag 4.2.0.1900". That will have a "type" and "object" field
which presumably point to the second commit.

My guess is that somebody was trying to amend the tag commit message,
but used the tag name to create the second one, rather than the original
commit. I.e,. any of these would have worked for the second command to
replace the old tag:

  git tag -f -m 'new message' mytag HEAD

  git tag -f -m 'new message' 2fcfd00ef84572fb88852be55315914f37e91e11

  git tag -f -m 'new message' mytag mytag^{commit}

If the original tag isn't signed, you could rewrite it at this point
using one of the above commands, coupled with GIT_COMMITTER_* to munge
the author and date.  But note that fetch doesn't update modified tags
by default, so it may just cause confusion if you have a lot of people
using the repository.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux