Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 506673 - tag created with no author and no date
Summary: tag created with no author and no date
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Gitflow (show other bugs)
Version: 4.1.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.5.1   Edit
Assignee: Matthias Sohn CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-28 00:59 EDT by Daniel Armbrust CLA
Modified: 2016-10-30 16:50 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Armbrust CLA 2016-10-28 00:59:46 EDT
I recently used the Gitflow support in eclipse to release a project.  I thought it had all worked fine - until a while later, I noticed that GitBlit was now broken: https://groups.google.com/forum/#!topic/gitblit/Gdk_HjjPBTk

It turns out, that the gitflow release created the release tag without specifying a time or a date.

Here is a tag from a release done by JGitFlow:

me@overkill:/mnt/STORAGE/Work/project git show 3.04
tag 3.04
Tagger: ci-server <ci-server@myserver.com>
Date:   Fri May 13 08:44:38 2016 -0400
[...]

And here is the tag created by the eclipse gitflow plugin:
me@overkill:/mnt/STORAGE/Work/project git show 1.0
tag 1.0

[...]

While it is a bug for GitBlit to break when these are missing, it seems like Tagger and Date should be populated when creating a tag.
Comment 1 Matthias Sohn CLA 2016-10-28 04:52:32 EDT
what is the output of
$ git cat-file -t 1.0

I tried creating a release using EGit gitflow using current master and found it's creating an annotated tag containing tagger and timestamp information.

As I wasn't able to reproduce your problem, can you provide steps to reproduce ?
Comment 2 Daniel Armbrust CLA 2016-10-28 10:34:10 EDT
Hmm, 
Maybe its already fixed in a newer env.

My version is still     
Java implementation of Git	4.1.1.201511131810-r	org.eclipse.jgit.feature.group	Eclipse JGit

I simply did:
Init Gitflow
Start Release
Finish Release

And now, command line git shows:
darmbrust@overkill:/mnt/STORAGE/Work/project$ git show 1.0.1
tag 1.0.1

Release of 1.0.1
commit f803a3bcf1077db7a2e262cf906cbc280dd0f6c4
Merge: 0f3559d 2fe5638
Author: darmbrust <daniel.armbrust.list@gmail.com>
Date:   Fri Oct 28 09:30:30 2016 -0500

    Merge branch 'release/1.0.1'

darmbrust@overkill:/mnt/STORAGE/Work/project$ git cat-file -t 1.0.1
tag
darmbrust@overkill:/mnt/STORAGE/Work/project$ 

I can reproduce it at will with this version.
Comment 3 Matthias Sohn CLA 2016-10-28 10:41:38 EDT
(In reply to Daniel Armbrust from comment #2)
> Hmm, 
> Maybe its already fixed in a newer env.
> 
> My version is still     
> Java implementation of Git	4.1.1.201511131810-r
> org.eclipse.jgit.feature.group	Eclipse JGit
> 
> I simply did:
> Init Gitflow
> Start Release
> Finish Release
> 
> And now, command line git shows:
> darmbrust@overkill:/mnt/STORAGE/Work/project$ git show 1.0.1
> tag 1.0.1
> 
> Release of 1.0.1
> commit f803a3bcf1077db7a2e262cf906cbc280dd0f6c4
> Merge: 0f3559d 2fe5638
> Author: darmbrust <daniel.armbrust.list@gmail.com>
> Date:   Fri Oct 28 09:30:30 2016 -0500
> 
>     Merge branch 'release/1.0.1'
> 

this shows EGit gitflow created an annotated tag containing tagger and timestamp

> darmbrust@overkill:/mnt/STORAGE/Work/project$ git cat-file -t 1.0.1
> tag

-> annotated tag

> darmbrust@overkill:/mnt/STORAGE/Work/project$ 
> 
> I can reproduce it at will with this version.

so I can't see a problem with this tag 1.0.1
Comment 4 Matthias Sohn CLA 2016-10-28 11:03:58 EDT
Another reason could be a bug in gitblit if it fails to parse the annotated tag's object body.
When loading an object e.g. from a RevWalk JGit by default only loads the object's ID, if you want to access any fields you have to ensure to first run one of the parseXXX methods of RevWalk, e.g. parseTag, parseBody, parseHeader, peel otherwise those fields aren't loaded but null.
Comment 5 Daniel Armbrust CLA 2016-10-28 11:27:46 EDT
(In reply to Matthias Sohn from comment #3)
> (In reply to Daniel Armbrust from comment #2)
> > Hmm, 
> > Maybe its already fixed in a newer env.
> > 
> > My version is still     
> > Java implementation of Git	4.1.1.201511131810-r
> > org.eclipse.jgit.feature.group	Eclipse JGit
> > 
> > I simply did:
> > Init Gitflow
> > Start Release
> > Finish Release
> > 
> > And now, command line git shows:
> > darmbrust@overkill:/mnt/STORAGE/Work/project$ git show 1.0.1
> > tag 1.0.1
> > 
> > Release of 1.0.1
> > commit f803a3bcf1077db7a2e262cf906cbc280dd0f6c4
> > Merge: 0f3559d 2fe5638
> > Author: darmbrust <daniel.armbrust.list@gmail.com>
> > Date:   Fri Oct 28 09:30:30 2016 -0500
> > 
> >     Merge branch 'release/1.0.1'
> > 
> 
> this shows EGit gitflow created an annotated tag containing tagger and
> timestamp
> 
> > darmbrust@overkill:/mnt/STORAGE/Work/project$ git cat-file -t 1.0.1
> > tag
> 
> -> annotated tag
> 
> > darmbrust@overkill:/mnt/STORAGE/Work/project$ 
> > 
> > I can reproduce it at will with this version.
> 
> so I can't see a problem with this tag 1.0.1

I'm not sure on the difference between an annotated tag and a tag... but when I let JGitFlow do the process, it produces a tag that looks like this:

darmbrust@overkill:/mnt/STORAGE/Work/otherProject$ git show 3.04
tag 3.04
Tagger: ci-server <ci-server@myserver.com>
Date:   Fri May 13 08:44:38 2016 -0400

[jgitflow-plugin]tagging release 3.04
commit f2499e141998885f4e0127c532fcd43e8be2ed5a
Merge: 29fea0f c784404
Author: ci-server <ci-server@myserver.com>
Date:   Fri May 13 08:44:38 2016 -0400

    Merge branch 'release/3.04'

darmbrust@overkill:/mnt/STORAGE/Work/otherProject$ git cat-file -t 3.04
tag
darmbrust@overkill:/mnt/STORAGE/Work/otherProject$ 


As you can see, this contains a "Tagger" and "Date" field, which are not present in the tag that the Eclipse gitflow integration created.
Comment 6 Eclipse Genie CLA 2016-10-28 18:49:30 EDT
New Gerrit change created: https://git.eclipse.org/r/84150
Comment 7 Matthias Sohn CLA 2016-10-28 18:50:47 EDT
you are right the gitflow bundle didn't set PersonIdent which causes tagger and timestamp to be unset, pushed a fix for review
Comment 8 Eclipse Genie CLA 2016-10-30 10:28:57 EDT
Gerrit change https://git.eclipse.org/r/84150 was merged to [stable-4.5].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=fca4b977171a4f510def0b20a5d9b4f5506df6c8