-
Notifications
You must be signed in to change notification settings - Fork 302
Wrong version of git.commit.id.describe #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What is the output of |
Here is the configuration:
And here is the output: |
Could you also run I'm assuming you are currently running in the situation that is outlined in the readme in the section Change your config with the following: <gitDescribe>
<tags>true</tags>
<always>true</always>
<abbrev>7</abbrev>
<forceLongFormat>true</forceLongFormat>
</gitDescribe> and let me know if this changes the situation. |
Configuration change has not affected the generated file. Dunno if it's relevant but we use Git v.1.9.5 |
On the Jenkins do you perform a shallow clone or a full clone of the repo? Does usage of native git change the situation? <configuration>
....
<useNativeGit>true</useNativeGit>
....
</configuration> can you send me the output of As of now I have tried to reproduce this with the following setup: |
I didn't find the Jenkins clone settings so I assume the default behaviour is used. Yes, with
The reproduction steps seems to be correct, although the tags are generated by Jenkins. Regarding #235, well, yes, we use |
So far I was not able to reproduce the situation. Bash-Skript: #!/bin/bash
MAIN_GIT_FOLDER=/tmp/sampleGit
MERGE_CONFLICT_FILE=${MAIN_GIT_FOLDER}/README.txt
ONLY_IN_BRANCH_FILE=${MAIN_GIT_FOLDER}/BRANCH.txt
BRANCH_NAME="release-16.1"
function changeAndCommitFile {
FILE="$1"
DATE="$2"
echo `date +%s.%N` > ${FILE}
git add ${FILE}
git commit --date "${DATE}" -m "msg"
}
function changeAndCommitFileAndTag {
FILE="$1"
DATE="$2"
TAG="$3"
changeAndCommitFile "${FILE}" "${DATE}"
GIT_COMMITTER_DATE="${DATE}" git tag ${TAG}
}
function mergeBranch {
DATE="$1"
BRANCH="$2"
GIT_COMMITTER_DATE="${DATE}" git merge ${BRANCH} -m "merge"
}
rm -rf ${MAIN_GIT_FOLDER}
mkdir -p ${MAIN_GIT_FOLDER}
cd ${MAIN_GIT_FOLDER}
git init
# * 2016-08-01 11:59:08 -0700 ed2d2d5 (tag: 16.1.1.0-SNAPSHOT)
changeAndCommitFileAndTag "${MERGE_CONFLICT_FILE}" "2016-08-01 11:59:08 -0700" "16.1.1.0-SNAPSHOT"
# | * 2016-08-05 02:35:08 -0700 ade5a5a (tag: 16.1.1.0)
git checkout -b ${BRANCH_NAME}
changeAndCommitFileAndTag "${ONLY_IN_BRANCH_FILE}" "2016-08-05 02:35:08 -0700" "16.1.1.0"
# | * 2016-08-05 02:35:36 -0700 9fbe608 (tag: 16.1.1.1-SNAPSHOT)
changeAndCommitFileAndTag "${ONLY_IN_BRANCH_FILE}" "2016-08-05 02:35:36 -0700" "16.1.1.1-SNAPSHOT"
# * | 2016-08-05 04:34:07 -0700 6f40078 (tag: 16.2.1.0)
git checkout master
changeAndCommitFileAndTag "${MERGE_CONFLICT_FILE}" "2016-08-05 04:34:07 -0700" "16.2.1.0"
# * | 2016-08-05 05:05:21 -0700 9b66c3c (tag: 16.2.1.1-SNAPSHOT)
changeAndCommitFileAndTag "${MERGE_CONFLICT_FILE}" "2016-08-05 05:05:21 -0700" "16.2.1.1-SNAPSHOT"
# * | 2016-08-08 12:24:06 +0300 724470a
# changeAndCommitFile "${MERGE_CONFLICT_FILE}" "2016-08-08 12:24:06 +0300"
mergeBranch "2016-08-08 12:24:06 +0300" ${BRANCH_NAME}
# | * 2016-08-10 06:20:30 -0700 ee79076 (tag: 16.1.1.1)
git checkout ${BRANCH_NAME}
changeAndCommitFileAndTag "${ONLY_IN_BRANCH_FILE}" "2016-08-10 06:20:30 -0700" "16.1.1.1"
# | * 2016-08-10 06:51:48 -0700 7b20d97 (tag: 16.1.1.2-SNAPSHOT)
changeAndCommitFileAndTag "${ONLY_IN_BRANCH_FILE}" "2016-08-10 06:51:48 -0700" "16.1.1.2-SNAPSHOT"
# | * 2016-09-15 10:46:17 +0300 61ec8b6 (origin/release-16.1)
# HEAD of branch -> produce conflict here
changeAndCommitFile "${MERGE_CONFLICT_FILE}" "2016-09-15 10:46:17 +0300"
# * 2016-09-15 17:08:38 +0300 1bea26a (HEAD)
git checkout master
mergeBranch "2016-09-15 17:08:38 +0300" ${BRANCH_NAME}
# "merge" & conflict resolution by just overriding the file again :-)
changeAndCommitFile "${MERGE_CONFLICT_FILE}" "2016-09-15 17:08:38 +0300"
# * 2016-09-30 00:07:09 -0700 a5dd338 (tag: 16.2.1.1)
changeAndCommitFileAndTag "${MERGE_CONFLICT_FILE}" "2016-09-30 00:07:09 -0700" "16.2.1.1"
# * 2016-09-30 00:39:35 -0700 dc9f0d3 (tag: 16.2.1.2-SNAPSHOT)
changeAndCommitFileAndTag "${MERGE_CONFLICT_FILE}" "2016-09-30 00:39:35 -0700" "16.2.1.2-SNAPSHOT"
# * 2016-10-03 02:19:07 -0700 b7f095e (tag: 16.2.1.2)
changeAndCommitFileAndTag "${MERGE_CONFLICT_FILE}" "2016-10-03 02:19:07 -0700" "16.2.1.2"
# * 2016-10-03 02:50:36 -0700 b16f13e (tag: 16.3.1.1-SNAPSHOT)
changeAndCommitFileAndTag "${MERGE_CONFLICT_FILE}" "2016-10-03 02:50:36 -0700" "16.3.1.1-SNAPSHOT"
# fin
git log --date-order --graph --tags --simplify-by-decoration --pretty=format:'%ai %h %d' This is how
my current pom to run the test with the 2.2.0 plugin looks like
When I'm on HEAD (in my current git tree this would be 32ff343; in yours 1bea26a)
When I'm on 97108d5 (tag: 16.2.1.1) in your tree 61ec8b6 (origin/release-16.1)
From my side this looks how it should be. |
What be be also worth trying:
and try clone the (git) repository and build the latest 2.2.2-SNAPSHOT version and see if the issue is still present.... |
Wow, that looks really cool) Not much help but some logs when I set verbose to true:
|
I'm closing this since I couldn't reproduce. |
Yeah, sure. Anyway, after I set useNativeGit to true this issue never reproduced. |
Mhh thats interesting.... |
I wish I could help you more. Tell me if I can! |
Well, funny enough searching for
Luckily, this time it was that infamous small gotcha with tags as per the original issue - it's been a very long time since I opened it, so suggest we close it now. |
Hi, while this may still be an issue in the plugin it's impossible to reproduce/debug without a public repository. i understand that you don't want to share private company repositories....well as outlined above without the ability to debug I now decided to finally put this on the graveyard as can't reproduce. if you ever bump into this again with a public repo where there the issue can be reproduced, please be invited to create a new issue with the relevant details. |
We use 2.2.0 plugin version with "generateGitPropertiesFile" property set to "true" and recently faced a really weird situation. I'll do my best to describe it correctly.
The main problem is that git.commit.id.describe field is wrong in generated properties file. I can tell that because "git describe" command returns different version, e.g.
git describe --> 16.2.1.1-SNAPSHOT
but in file:
So, how that happened? We perform project releases via Jenkins and the problem was caused by some merge conflicts because of versions in different branches.
We did some changes in branch for 16.1 release (with version 16.1.1.2) and then merge that branch into current master where version was 16.2.1.1. So, the merge conflict happened and resolved but after that the problem above appeared. When I checkout to the commit prior to the merge everything works just fine. But on merge-commit and after "git.commit.id.describe" is wrong.
Hope I explained it clear) Tell me if you need more details.
The text was updated successfully, but these errors were encountered: