fix(bump): use commit subject for non-conventional bumps#1478
Open
jagath-sajjan wants to merge 1 commit intoorhun:mainfrom
Open
fix(bump): use commit subject for non-conventional bumps#1478jagath-sajjan wants to merge 1 commit intoorhun:mainfrom
jagath-sajjan wants to merge 1 commit intoorhun:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1478 +/- ##
==========================================
+ Coverage 47.35% 47.69% +0.34%
==========================================
Files 24 24
Lines 2131 2135 +4
==========================================
+ Hits 1009 1018 +9
+ Misses 1122 1117 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes version bump detection for multiline custom commits when
conventional_commits = false.Previously, git-cliff passed the full non-conventional commit message into version bump detection. When a multiline commit was provided via
--with-commit,custom_major_increment_regexandcustom_minor_increment_regexcould be ignored, causing an incorrect patch bump.This change makes nonconventional commits use only the subject line (the first line) for bump calculation, while preserving the full message for changelog generation. It also adds regression tests covering multiline major and minor bump cases.
Motivation and Context
Fixes #1476.
This is needed for users who disable conventional commits and rely on custom prefixes like
breakingorfeatat the start of free-form commit subjects. With this fix, multiline--with-commitinput behaves consistently with single-line input for version bumping.How Has This Been Tested?
Added regression coverage in
git-cliff-core/src/release.rsfor:custom_major_increment_regexcustom_minor_increment_regexCommands run:
cargo fmt --allcargo test -p git-cliff-core release::test::bump_version -- --nocaptureNotes:
cargo test -p git-cliff-corestill showed existing unrelated failures inrepo::test::{get_latest_tag, git_tags, resolves_existing_tag_with_name_and_message}in my local environment.Screenshots / Logs (if applicable)
N/A
Types of Changes
Checklist:
cargo +nightly fmt --allcargo clippy --tests --verbose -- -D warningscargo test