Repository navigation
fix: do not judge the fixup!, squash! and amend! subjects git writes - #734
Conversation
git commit --fixup, --squash and --fixup=amend: put "fixup! ", "squash! " or "amend! " in front of the target commit's subject. CC004 counted that prefix, so a fixup of a subject that fit the limit was rejected, and CC002 rejected every one of them for its lower-case "fixup!". CC003 skipped only "fixup! ". The subject rules (CC002-CC005) now skip these subjects, as they skip a merge or revert subject. Whether they are allowed stays CC009's call. Closes #733
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #734 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 16 16
Lines 3156 3159 +3
Branches 626 626
=========================================
+ Hits 3156 3159 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
Move the squash! and amend! cases into their own test, so the benchmarked one measures the same two calls as on main.
|



Closes #733.
git commit --fixup,--squashand--fixup=amend:putfixup!,squash!oramend!in front of the target commit's subject. The subject rules judged that prefix as if the author had written it:fixup!, and suggestedFixup! ..., whichgit rebase --autosquashwould no longer recognise.fixup!, but notsquash!oramend!.CC002 to CC005 now skip these subjects, the same way they skip a merge or
Revert "..."subject, and CC001 already exempts them. Whether they are allowed at all stays CC009's call (allow_fixup_commits). Only git's exact prefix counts:fixup!! ...orFixup! ...is the author's and is still judged. Skipping, rather than measuring the rest of the line, also coversamend!, where the rest of the line is the subject being replaced.Before (v2.24.0)
After
squash!andamend!behave the same; a stackedfixup! fixup!too.Tests
New cases for CC002 and CC004 (each prefix, stacked prefixes, author look-alikes still judged), CC003 extended to
squash!/amend!, andis_autosquash_subjectitself. README'ssubject_max_lengthrow names the new exemption; the site's rules and configuration pages follow after the release.Summary by CodeRabbit
fixup!,squash!, oramend!prefixes. These checks recognize the prefixes only in their expected form; author-written lookalikes are still checked. The existing policy for allowing fixup commits is unchanged.