You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setup:
Gradle with Kotlin DSL and multiple subprojects, each with independent versioning
Symptom:
When running a build, either in the command line or within IntelliJ, this error occurs:
Inconsistent git describe: native was [email protected] and jgit was 05e75f8.
This occurred when a single commit addresses issues in multiple gradle subprojects within the same git repository. This causes prefixed release tags for each subproject to be added to the same commit.
After stepping through the code, I found that the RefWithTagNameComparator wasn't comparing the tags correctly.
Solution Idea
Possibly refactor how the commit hash to tag loading works so that the full tag name is used instead. Because multiple tags can point to the same commit hash, it makes sense to use the full /ref/tags listing since that is the unique listing.
Workaround:
Avoid releasing and adding two tags to the same commit. In a multiple project structure, this makes sense... in a way. One subproject's fixes and commits should be independent of the other subproject's. Write more succinct and focused commits, one per subproject.
The text was updated successfully, but these errors were encountered:
Setup:
Gradle with Kotlin DSL and multiple subprojects, each with independent versioning
Symptom:
When running a build, either in the command line or within IntelliJ, this error occurs:
Inconsistent git describe: native was [email protected] and jgit was 05e75f8.
This occurred when a single commit addresses issues in multiple gradle subprojects within the same git repository. This causes prefixed release tags for each subproject to be added to the same commit.
After stepping through the code, I found that the RefWithTagNameComparator wasn't comparing the tags correctly.
gradle-git-version/src/main/java/com/palantir/gradle/gitversion/RefWithTagNameComparator.java
Line 46 in c62bf60
The comparator then causes the incorrect ref to be added, or none at all, when trying to use updateCommitHashMap.
gradle-git-version/src/main/java/com/palantir/gradle/gitversion/JGitDescribe.java
Line 122 in 8b81ba6
Because updateCommitHashMap fails to add the commit to the map, commitHashToTag doesn't contain the correct tag.
gradle-git-version/src/main/java/com/palantir/gradle/gitversion/JGitDescribe.java
Line 53 in 8b81ba6
Solution Idea
Possibly refactor how the commit hash to tag loading works so that the full tag name is used instead. Because multiple tags can point to the same commit hash, it makes sense to use the full /ref/tags listing since that is the unique listing.
Workaround:
Avoid releasing and adding two tags to the same commit. In a multiple project structure, this makes sense... in a way. One subproject's fixes and commits should be independent of the other subproject's. Write more succinct and focused commits, one per subproject.
The text was updated successfully, but these errors were encountered: