git <tag> --fubar

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 13 03:04:39 PDT 2014


Am Sun, 13 Jul 2014 00:27:53 +0000
schrieb "Andrew Edwards" <ridimz at yahoo.com>:


> I had some issues keeping things straight in my head about which 
> repo I visited, which branch I checkout and which ones I tagged. 
> So I decided to automate the process. Starting with v2.066.0-b3 
> every repo gets tagged correctly and the tag gets pushed 
> automatically to master. I'm in nirvana. No more forgetting to 
> tag things or tagging them in the wrong places.
> 
> The problem? I screwed up the v2.066.0-b1 tags by placing them in 
> master instead of the 2.066 branch. So when I build the binaries 
> from v2.066.0-b3, it's ignoring changes in the branch.

Then delete the v2.066.0-b1 tag and recreate it, as explained below.
(You'll have to know the commit sha1 that's actually used to build
v2.066.0-b1)

> 
> To make matters worse, after visiting both branch and master for 
> all repos, everyone exhibited the same problem with the exception 
> of tools. Tools did not have the v2.066.0-b3 tag and showed the 
> same tag in both master and the branch. I tried removing the tag 
> from master to match the rest of the repos but that did not work, 
> it simply removed all references to the tag.

?
tags are not _on_ branches. if you tag a commit which is in multiple
branches then it might seem like you have a tag on multiple branches,
but you can only tag commits. That's a crucial point, you never tag
branches, or commits _on_ branches, you can only tag commits!

> 
> The only way I know to fix this is to remove all the v2.066 tags 
> and just start over with v2.066.b3.
> 
> Some advice would really be appreciated.
> 
> Regards,
> Andrew

The correct way to state this: Git tags are placed on commits, not on
branches.

I'd explain it like this, but note that it's a little more complicated
in reality, commits do not really 'belong' to branches:

If you want to make sure a tag 'is on a certain branch' you
have to tag a commit that 'is only in that branch', usually a merge
commit. http://stackoverflow.com/questions/14613540/git-tag-in-branches

As you guys use cherry-picking cherry picked commits get a different
commit hash in different branches anyway and you should be able to tag
these sha1 hashes.

(if you just use git tag without further parameters it defaults to the
current branch head, which always belongs to one branch. )

If you know the commit sha1s used for the betas you can always delete &
recreate _all_ tags.
http://git-scm.com/book/en/Git-Basics-Tagging
(See 'Tagging later')

More links:
http://stackoverflow.com/questions/5480258/how-to-delete-a-remote-git-tag
http://stackoverflow.com/a/1457536/471401
http://stackoverflow.com/a/1863224/471401


More information about the Digitalmars-d mailing list