Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359844

Summary: best way tag git repos after a release
Product: [Eclipse Project] Platform Reporter: Kim Moir <kim.moir>
Component: RelengAssignee: Platform-Releng-Inbox <platform-releng-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, daniel_megert, david_williams, dj.houghton, pwebster, remy.suen, tjwatson
Version: 3.7.1   
Target Milestone: 4.2.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Kim Moir CLA 2011-10-04 10:20:45 EDT
From Kim

After every release, I tag all the projects, for instance R3_7_1.  I've done that for the cvs projects for 3.7.1. What's the best way to do this for the git projects?  There are different tags for each bundle in 
the map files and I think some projects may have already released fixes for 3.7.x in the R3_7_maintenance branch.


From John

I think we better open a bug to talk about this. There is no way to do this in the general case. You can only tag an individual commit per repository, and someone could theoretically release the contents of an older commit in their build. I think the only way for this to work is what we do in Orion. The build tags each repository with the build id. Everything in master at the time of build gets contributed. Then, the commit that was tagged for the build in each repository is the same commit to add R3_7_1, etc, after the fact.

From Dani

for each Git repo
   - find the project with the newest tag in the map files
   - add the 'R3_7_1' tag to that tag (there are several ways to do that
Comment 1 John Arthorne CLA 2011-10-04 10:37:18 EDT
Dani's suggestion is the closest we can get with our current workflow, but it is not guaranteed to be correct. If someone committed a change to the branch, but did not contribute it to the build, then it will appear to be in the release when it isn't.
Comment 2 Paul Webster CLA 2011-10-05 17:08:40 EDT
See bug 351818 and bug 351819 comment #2

I'd hope to separate the qualifier for the plugin from the tag on the commit used to create the build, to help with EGit + large repos + eclipse source references.  But if it is useful would depend on us adopting a process similar to Orion.

PW
Comment 3 Kim Moir CLA 2011-10-05 17:34:36 EDT
On the advice of the wise PMC, I have been advised to delegate the tagging of the git repos for 3.7.1 to the components who own them.

The following Git repositories need to be tagged with R3_7_1 to match the tags that were submitted to the final build. You can see these tags in the R3_7_1 tag of org.eclipse.releng in /cvsroot/eclipse.

equinox.framework
equinox.bundles
platform.runtime
platform.resources
equinox.p2
pde.ui
platform.swt
platform.swt.binaries
platform.ui
platform.ua
Comment 4 Remy Suen CLA 2011-10-05 19:39:48 EDT
(In reply to comment #3)
> platform.ui

I'll take care of this tomorrow.
Comment 5 Remy Suen CLA 2011-10-06 08:43:16 EDT
I've pushed the R3_7_1 tag for eclipse.platform.ui to git.eclipse.org.
Comment 6 Thomas Watson CLA 2011-10-06 10:23:14 EDT
(In reply to comment #1)
> Dani's suggestion is the closest we can get with our current workflow, but it
> is not guaranteed to be correct. If someone committed a change to the branch,
> but did not contribute it to the build, then it will appear to be in the
> release when it isn't.

This was not an issue for the equinox.bundles and equinox.framework repositories but I am wondering what we would actually do if something like that happened.  I don't see any useful way to do this.  Isn't it enough to simply tag the map files used for input to the R3_7_1 build?
Comment 7 Dani Megert CLA 2011-10-06 10:31:48 EDT
> Isn't it enough to simply tag the map files used for input to the R3_7_1 build?
Yes, for the build(er) but if you want to compare stuff against a release, e.g. to track down a bug, then it is very helpful to have the tag on the repo.
Comment 8 Curtis Windatt CLA 2011-10-06 15:10:24 EDT
The tag has been added to pde.ui and pde.build (thanks DJ) repositories.
Comment 9 Curtis Windatt CLA 2011-10-06 16:03:46 EDT
I have also done platform debug and jdt debug.

I had two minor issues.  I couldn't see the tags on platform debug's git.eclipse.org page (but the tags do exist).  In jdt debug there have been several changes since the 3.7.1 release including one bug that was marked for 3.7.1 and committed, but never tagged.  Since this case was the last commit before 3.7.1, I tagged the prior commit as R3_7_1.
Comment 10 Thomas Watson CLA 2011-10-06 17:10:36 EDT
(In reply to comment #9)
> I had two minor issues.  I couldn't see the tags on platform debug's
> git.eclipse.org page (but the tags do exist).  

The gitweb cache just needs to catch up.  It does not always immediately reflect the tags you push upstream.
Comment 11 Remy Suen CLA 2011-10-06 17:17:16 EDT
(In reply to comment #10)
> (In reply to comment #9)
> > I had two minor issues.  I couldn't see the tags on platform debug's
> > git.eclipse.org page (but the tags do exist).  
> 
> The gitweb cache just needs to catch up.  It does not always immediately
> reflect the tags you push upstream.

Yes, Tom is right, the web UI is not "instant". When I need to link to a commit or tag that I've just pushed and don't see it after refreshing, I usually click on an existing commit or tag and then replace the link with the SHA-1 hash or tag that I've just pushed. That should load up in the browser even if the table view doesn't seem to show the commit or tag in question.
Comment 12 John Arthorne CLA 2011-10-07 09:44:52 EDT
(In reply to comment #9)
> I had two minor issues.  I couldn't see the tags on platform debug's
> git.eclipse.org page (but the tags do exist).

Tags aren't pushed by default. You need to do "git push --tags" or whatever the EGit equivalent is.
Comment 13 Curtis Windatt CLA 2011-10-07 10:01:51 EDT
(In reply to comment #12)
> Tags aren't pushed by default. You need to do "git push --tags" or whatever the
> EGit equivalent is.

The equivalent step in eGit is to do a Push... and on the specifications page press the button to add all tag specs.  I had added this to the git workflows wiki page, but Dani has since reverted the change as that command will push all local tags, replacing any that have been deleted on the remote.

Does anyone have a suggestion on how to push a specific set of tags from eGit? You can push a single tag from the command line using 'git push origin mynewtag'. For me I don't see any problems with pushing all tags as I don't have any other local ones and the dry run tells you what tags will be updated/changed.
Comment 14 Curtis Windatt CLA 2011-10-07 11:16:17 EDT
(In reply to comment #13)
> Does anyone have a suggestion on how to push a specific set of tags from eGit?

So on the specifications page of the push wizard you can add 'refs/tags/<tagname>' to the source ref box and hit add spec.  Only that tag will be pushed. There is content assist for that box to help you find a tag.

I have updated the wiki page accordingly.
Comment 15 Dani Megert CLA 2011-10-07 12:12:06 EDT
It really depends on how you use Git. If you keep work with local branches and tags then you should make sure that those don't end up in the shared repositories. If not, then feel free to always push all tags.
Comment 16 Thomas Watson CLA 2011-10-07 12:21:03 EDT
Out of curiosity, what actually happens if you try to push a tag upstream for a commit that does not exist upstream?  Would that automatically push your branch containing the commit upstream?
Comment 17 Dani Megert CLA 2011-10-07 12:30:11 EDT
(In reply to comment #16)
> Out of curiosity, what actually happens if you try to push a tag upstream for a
> commit that does not exist upstream?  Would that automatically push your branch
> containing the commit upstream?

Nice homework for the weekend :-)
Comment 18 Dani Megert CLA 2011-10-10 08:40:59 EDT
(In reply to comment #16)
> Out of curiosity, what actually happens if you try to push a tag upstream for a
> commit that does not exist upstream?  Would that automatically push your branch
> containing the commit upstream?
It looks like it pushes the tag only i.e. it will be unusable without pushing the other stuff.
Comment 19 Thomas Watson CLA 2011-10-10 09:13:31 EDT
(In reply to comment #18)
> (In reply to comment #16)
> > Out of curiosity, what actually happens if you try to push a tag upstream for a
> > commit that does not exist upstream?  Would that automatically push your branch
> > containing the commit upstream?
> It looks like it pushes the tag only i.e. it will be unusable without pushing
> the other stuff.

Thanks Dani, you did your weekend homework! ;-)

I would not have guessed tagging worked that way.  I had always thought that a tag in git required some commit to be associated with it.  The tag is worthless without the commit it is associated with.  I guess the commit could be pushed later.
Comment 20 Dani Megert CLA 2011-10-10 09:16:59 EDT
> I would not have guessed tagging worked that way.  I had always thought that a
> tag in git required some commit to be associated with it.  The tag is worthless
> without the commit it is associated with.  I guess the commit could be pushed
> later.
Yes. It looks like Git just creates the tag file pointing to the commit hash. Once the commit is pushed, the tag becomes usable.
Comment 21 David Williams CLA 2014-01-25 13:55:54 EST
I think this was settled a long time ago.