Repository navigation
fix(conventional_commit): preserve body text matching a footer - #1126
Open
amalsaidov wants to merge 1 commit into
Open
amalsaidov wants to merge 1 commit into
amalsaidov wants to merge 1 commit into
Conversation
The body was computed by stripping each extracted footer from the body with `String.replaceAll`, which removes every occurrence of that text anywhere in the body, not just the trailing footer line. When a body paragraph legitimately contains the same text as a footer (e.g. an inline "Refs invertase#123" referenced in prose and again as a trailer), the inline occurrence was silently deleted, corrupting the parsed body. Remove footer lines by matching whole lines instead, so only the actual footer lines are stripped and body prose is left intact.
|
|
spydon
approved these changes
Dec 2, 2026
Collaborator
|
Hey @amalsaidov, can you sign the CLA so that we can get this merged? |
This branch has not been deployed
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
ConventionalCommit.tryParsebuilds the commitbodyby stripping each extracted footer out of the message withString.replaceAll:replaceAllremoves every occurrence of the footer text, not just the trailing footer line. If a body paragraph legitimately contains the same text as a footer, the inline occurrence is silently deleted and the parsed body is corrupted.Reproduction
The old Refs #123 approach was wrong and needed a rewrite.The old approach was wrong and needed a rewrite.Fix
Remove footer lines by matching whole lines instead of doing substring replacement, so only the real footer lines are stripped and body prose is left intact.
Testing
Added a test that fails before the change and passes after it. All existing
conventional_committests still pass;dart formatanddart analyzeare clean on the touched files.