| Here is where the plugin tests dates and it uses the "timestamp" of the tag: https://github.com/jenkinsci/basic-branch-build-strategies-plugin/blob/master/src/main/java/jenkins/branch/buildstrategies/basic/TagBuildStrategyImpl.java#L152 It is up to the the implementers of TagSCMHead to provide that: https://github.com/jenkinsci/scm-api-plugin/blob/master/src/main/java/jenkins/scm/api/mixin/TagSCMHead.java The git plugin does what Mark Waite described - use the date of tag creation for annotated tags and the date of the last commit for lightweight tags: https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/jenkins/plugins/git/GitTagSCMHead.java#L37-L38 This comment on SO repeats what Mark Waite said:
There is no date information attached to a lightweight tag. ... The dates in the output of git log --tags --simplify-by-decoration --pretty="format:%ai %d" are the dates of the objects to which the tags point, not the dates when the tags themselves were created.
I think either of the command above would have this same problem, but you'd need to test them to be sure. Further, it is likely that this behavior will differ depending on the underlying branch source - git, github, bitbucket, etc. |