Skip to content

feat: support commit message increment overrides - #5123

Open
fzlzjerry wants to merge 1 commit into
GitTools:mainfrom
fzlzjerry:feat/4144-version-bump-override
Open

feat: support commit message increment overrides#5123
fzlzjerry wants to merge 1 commit into
GitTools:mainfrom
fzlzjerry:feat/4144-version-bump-override

Conversation

@fzlzjerry

@fzlzjerry fzlzjerry commented Aug 12, 2026

Copy link
Copy Markdown

Description

Add a configurable override-version-bump-message pattern with the default
=semver:\s?(?<increment>none|patch|minor|major) for the GitFlow, GitHubFlow,
and TrunkBased workflows.

The new message can lower or raise the configured branch increment. Range-based
strategies reset the accumulated commit-message increment when they encounter an
override, while Mainline applies the override at that commit and preserves the
expected version-source distance behavior from the issue scenarios.

This also updates effective configuration output, CLI overrides, the 7.0 schema,
workflow snapshots, and the configuration and version-increment documentation.

Related Issue

Resolves #4144

Motivation and Context

Regular +semver messages treat the configured branch increment as a minimum,
so they cannot lower a Patch branch to None for documentation-only changes. The
new =semver form provides an explicit override without changing the existing
+semver behavior.

How Has This Been Tested?

  • dotnet build src/GitVersion.slnx --no-restore --disable-build-servers -m:1
    (0 errors with .NET SDK 10.0.400; the one MSB3277 warning also reproduces
    on origin/main)
  • dotnet test --solution src/GitVersion.slnx --no-build --max-parallel-test-modules 1
    (37,003 passed across all six test modules)
  • dotnet format src/GitVersion.slnx --verify-no-changes --no-restore
  • npx remark with the four changed Markdown files and the repository's lint configuration

The integration coverage includes all eight acceptance scenarios from the
issue, all four override values across the three built-in workflows, same-commit
precedence, custom patterns, disabled commit-message incrementing, and invalid
capture values/configuration.

Screenshots (if appropriate):

Not applicable.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copilot AI lite review requested due to automatic review settings August 12, 2026 06:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.

Comment on lines +459 to +465
if (item is not BaseVersionOperator
|| context.IncrementOverride != VersionField.None
|| !hasBaseVersionOperator)
{
yield return item;
}

@arturcic
arturcic requested a review from HHobeck August 12, 2026 11:59
Copilot AI review requested due to automatic review settings August 12, 2026 13:13
@fzlzjerry
fzlzjerry force-pushed the feat/4144-version-bump-override branch from 8aa4108 to c2c96fb Compare August 12, 2026 13:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@fzlzjerry
fzlzjerry force-pushed the feat/4144-version-bump-override branch from c2c96fb to 09cd27c Compare August 12, 2026 13:22
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Support of '=semver: none|minor|major|patch' bump message to suppress the version increment

2 participants