Skip to content
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

[ISSUE]: Not possible to increment CommitsSinceVersionSource by first-parent-only #4328

Open
2 tasks done
roofiq opened this issue Nov 22, 2024 · 0 comments
Open
2 tasks done

Comments

@roofiq
Copy link

roofiq commented Nov 22, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

AzureDevops task

GitVersion version

6.0.5

Operating system

Linux

What are you seeing?

GitVersion is incrementing CommitsSinceVersionSource from latest tag. The variable is being incremented by all the commits, that were merged, full history is being taken.

Example of how it is working right now:
Lets say our current version calculated on develop branch is 1.1.0-dev.20, where 20 is the CommitsSinceVersionSource.
So if a pull request is merged and it contains 10 commits, version calculated for this branch would be 1.1.0-dev.31. Because it includes the whole history.

What is expected?

I would like to increment version by only First Parent commits count.

Example of what I want to achieve:
Lets say our current version calculated on develop branch is 1.1.0-dev.20, where 20 is the CommitsSinceVersionSource.
So if a pull request is merged and it contains 10 commits, I want my version to be 1.1.0-dev.21.

What is the best way to achieve it?

Steps to Reproduce

Setup repo and create pull requests to develop branch, that will have below GitVersion.yml configuration:

assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch
tag-prefix: '[vV]?'
version-in-branch-pattern: (?<version>[vV]?\d+(\.\d+)?(\.\d+)?).*
major-version-bump-message: '\+semver:\s?(breaking|major)'
minor-version-bump-message: '\+semver:\s?(feature|minor)'
patch-version-bump-message: '\+semver:\s?(fix|patch)'
no-bump-message: '\+semver:\s?(none|skip)'
tag-pre-release-weight: 60000
commit-date-format: yyyy-MM-dd
merge-message-formats: {}
update-build-number: true
semantic-version-format: Strict
strategies:
- Fallback
- ConfiguredNextVersion
- MergeMessage
- TaggedCommit
- TrackReleaseBranches
- VersionInBranchName
branches:
  develop:
    mode: ContinuousDelivery
    label: dev
    increment: Minor
    prevent-increment:
      when-current-commit-tagged: false
    track-merge-target: false
    track-merge-message: true
    regex: ^dev(elop)?(ment)?$
    source-branches:
    - main
    is-source-branch-for: []
    tracks-release-branches: true
    is-release-branch: false
    is-main-branch: false
    pre-release-weight: 0
ignore:
  sha: []
mode: ContinuousDelivery
label: null
increment: Inherit
prevent-increment:
  of-merged-branch: false
  when-branch-merged: false
  when-current-commit-tagged: true
track-merge-target: false
track-merge-message: true
commit-message-incrementing: Enabled
regex: ''
source-branches: []
is-source-branch-for: []
tracks-release-branches: false
is-release-branch: false
is-main-branch: false

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant