Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Critical
-
Resolution: Fixed
-
Component/s: git-client-plugin
-
Labels:None
-
Environment:Java 1.8
Git 2.4.5
Git Client Plugin: 1.18.0
Git Plugin: 2.4.0
-
Similar Issues:
Description
The RAW command listed here: https://github.com/jenkinsci/git-client-plugin/blob/b6fe319297b9ef5ceb29b260aa37c6cf994b414a/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L734
Is using the old formatting of "%ai" and "%ci" for retrieving the Author and Committer timestamps. In Git 2.0 and above, the lowercase "i" refers to "ISO-8601-like" while a newly added uppercase "I" returns "ISO-8601-strict": http://git-scm.com/docs/pretty-formats
I'm not sure why, but when upgrading 1.14.1 of git-client to 1.18.0, this started breaking for us. We're now getting -1 for all timestamps. I think it's from this change: https://github.com/jenkinsci/git-client-plugin/commit/de49c9bf21f560ac3851c4f7ea3a3597a114ac8e#diff-4a13310f7c84a9d6e133def48c0aed5a
Here is an example:
$ git --version git version 2.4.5 $ git whatchanged --no-abbrev -M --format="commit %H%ntree %T%nparent %P%nauthor %aN <%aE> %ai%ncommitter %cN <%cE> %ci%n%n%w(76,4,4)%s%n%n%b" commit 688eda2a898ba11e6173f75d8fbd19cc172abb6a tree 12a4ac27c0f153644daf083c7e1601644ac7ab17 parent d1da71b1f09f675af86b7fe1937d9c5f2740b182 author Mark Waite <mark.earl.waite@gmail.com> 2015-08-20 08:48:02 -0600 committer Mark Waite <mark.earl.waite@gmail.com> 2015-08-20 08:48:02 -0600 Update findbugs maven plugin to 3.0.2 $ git whatchanged --no-abbrev -M --format="commit %H%ntree %T%nparent %P%nauthor %aN <%aE> %aI%ncommitter %cN <%cE> %cI%n%n%w(76,4,4)%s%n%n%b" commit 688eda2a898ba11e6173f75d8fbd19cc172abb6a tree 12a4ac27c0f153644daf083c7e1601644ac7ab17 parent d1da71b1f09f675af86b7fe1937d9c5f2740b182 author Mark Waite <mark.earl.waite@gmail.com> 2015-08-20T08:48:02-06:00 committer Mark Waite <mark.earl.waite@gmail.com> 2015-08-20T08:48:02-06:00 Update findbugs maven plugin to 3.0.2
With the lower-case "i" we're not getting ISO8601 and it's not parsing in: https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/GitChangeSet.java#L213-L216
Can you describe where you're seeing the time stamp as "-1"? Is it in the change logs, the summary of changes with each build, through an API call, or some other location?
Can you provide a series of steps that will allow others to see the same failure you're seeing?
Does your time zone or locale affect the behavior?
The plugin needs to support git versions older than git 2. Many users are running older platforms (CentOS 6 - git 1.7.1, CentOS 7 - git 1.8.3.1, Debian 6 - git 1.7.2.5, Debian 7 - git 1.7.10.4, Ubuntu 14.04 - git 1.9.1, Windows - msysgit 1.9.5). I'm willing to consider inserting git version specific code, but it is more painful to maintain, more difficult to test, and more likely to break.