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
Hi, I recently implemented GitInfo in one of my team's projects but I'm struggling with setting the correct version numbers in CI. We are using a custom Gitlab flow, which means we are having a develop branch in which all feature branches are merged. When preparing a release, we are eventually bumping the major/minor version in the project's GitInfo.txt and then merging the develop branch into the master branch. This causes a problem, because the merge creates one additional commit and the GitSemVerPatch is incemented by one. With this, it is never possible to release a x.x.0 Version from the master branch because with the merge commit, the last digit is always (at least) 1. This is weird and hard to understand for consumers why there is no .0-Version.
I dug a bit into the GitInfo.targets file and saw it is using the git rev-list --count command to retrieve the number of commits since the last change of the GitInfo.txt file. This command has an additional flag --no-merges which could be used to solve this problem. Is it possible to make the desired behavior available via config (e.g. $(GitCommitsIgnoreMerges)) or am I missing something?
The text was updated successfully, but these errors were encountered:
Yes, that would be a good addition! I'd gladly take a PR if that change gives you the desired behavior. To make it backwards compatible, I'd make GitCommitsIgnoreMerges default to false though.
You can try this locally by just modifying your restored GitInfo.targets and once you're satisfied with the behavior, you can send the PR.
Hi, I recently implemented GitInfo in one of my team's projects but I'm struggling with setting the correct version numbers in CI. We are using a custom Gitlab flow, which means we are having a
develop
branch in which all feature branches are merged. When preparing a release, we are eventually bumping the major/minor version in the project's GitInfo.txt and then merging thedevelop
branch into themaster
branch. This causes a problem, because the merge creates one additional commit and theGitSemVerPatch
is incemented by one. With this, it is never possible to release ax.x.0
Version from the master branch because with the merge commit, the last digit is always (at least)1
. This is weird and hard to understand for consumers why there is no.0
-Version.I dug a bit into the
GitInfo.targets
file and saw it is using thegit rev-list --count
command to retrieve the number of commits since the last change of theGitInfo.txt
file. This command has an additional flag--no-merges
which could be used to solve this problem. Is it possible to make the desired behavior available via config (e.g.$(GitCommitsIgnoreMerges)
) or am I missing something?The text was updated successfully, but these errors were encountered: