Page 1 of 3

Git describe shows 0.43.0 on master

Posted: 05 Aug 2018, 22:10
by Thunderforge
When I have the latest code and run git describe in the Terminal, I get openmw-0.43.0-1196-gb75b5d139. Shouldn't it start off with openmw-0.44.0?

Re: Git describe shows 0.43.0 on master

Posted: 05 Aug 2018, 22:16
by Capostrophic
OpenMW 0.44.0 tag wasn't annotated like previous releases, so git describe ignores it. zini plz fix dis

Re: Git describe shows 0.43.0 on master

Posted: 06 Aug 2018, 00:09
by raevol
That'd be my fault- what did I mess up? I put the tag on the latest commit on the 0.44 branch, which obviously is not master. I'm not sure what the correct action would have been though, I'm not very good with git.

Re: Git describe shows 0.43.0 on master

Posted: 06 Aug 2018, 04:39
by wareya
You have to manually push tags.

Re: Git describe shows 0.43.0 on master

Posted: 06 Aug 2018, 06:53
by raevol
wareya wrote: 06 Aug 2018, 04:39 You have to manually push tags.
I pushed them to the 0.44 branch. Does the branch need to be merged into master? Sorry, you need to walk me through this a little.

Re: Git describe shows 0.43.0 on master

Posted: 06 Aug 2018, 09:17
by Ace (SWE)
Tags and branches are just different types of git refs, tags are not branch-specific but rather global to the repository and linked to a particular commit.

You also have lightweight tags and annotated tags, lightweight tags are quite literally just a name linked to a commit hash, annotated tags on the other hand have additional information added to them - messages, signatures, etc.

It this case, I assume that the 0.44.0 tag was created as a lightweight tag, when it should've been an annotated tag.

Re: Git describe shows 0.43.0 on master

Posted: 06 Aug 2018, 17:30
by psi29a
man git-tag says:
Annotated tags are meant for release while lightweight tags are meant for private or temporary object labels.
annotated tags can contain a message, creator, and date different than the commit they point to. So you could use them to describe a release without making a release commit.

Lightweight tags don't have that extra information, and don't need it, since you are only going to use it yourself to develop.

git push --follow-tags will only push annotated tags

git describe without command line options only sees annotated tags

Found this:
As of Git v1.8.2, you need to use --force to replace any tags on a remote with git push, even if you are replacing a lightweight tag with something that is effectively a fast-forward or a true tag object pointing at the same commit as the existing tag reference.

git push --force origin <tagname>

Re: Git describe shows 0.43.0 on master

Posted: 06 Aug 2018, 18:00
by jvoisin
You might want to add

Code: Select all

git push --tags
to your release process :)

Re: Git describe shows 0.43.0 on master

Posted: 06 Aug 2018, 19:46
by raevol

Code: Select all

raevol@jabberwock:~/Development/openmw$ git checkout openmw-44
Switched to branch 'openmw-44'
Your branch is up to date with 'origin/openmw-44'.
raevol@jabberwock:~/Development/openmw$ git push --tags
Username for 'https://github.com': mickeylyle
Password for 'https://[email protected]': 
To https://github.com/Openmw/openmw.git
 ! [rejected]              openmw-0.42.0 -> openmw-0.42.0 (already exists)
 ! [rejected]              stable -> stable (already exists)
error: failed to push some refs to 'https://github.com/Openmw/openmw.git'
hint: Updates were rejected because the tag already exists in the remote.
raevol@jabberwock:~/Development/openmw$ 
Did that do it?

Re: Git describe shows 0.43.0 on master

Posted: 06 Aug 2018, 20:07
by Capostrophic

Code: Select all

 ! [rejected]              openmw-0.42.0 -> openmw-0.42.0 (already exists)
 ! [rejected]              stable -> stable (already exists)
error: failed to push some refs to 'https://github.com/Openmw/openmw.git'
hint: Updates were rejected because the tag already exists in the remote.
You can tell that it didn't (and it really didn't).