-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: ensure fixup commits match an earlier, unmerged commit (#32023)
Previously, `validate-commit-message` would treat `fixup! `-prefixed commits like this: - It would strip the `fixup! ` prefix. - It would validate the rest of the commit message header as any other commit. However, fixup commits are special in that they need to exactly match an earlier commit message header (sans the `fixup! ` prefix) in order for git to treat them correctly. Otherwise, they will not be squashed into the original commits and will be merged as is. Fixup commits can end up not matching their original commit for several reasons (e.g. accidental typo, changing the original commit message, etc.). This commit prevents invalid fixup commits to pass validation by ensuring that they match an earlier (unmerged) commit (i.e. a commit between the current HEAD and the BASE commit). NOTE: This new behavior is currently not activated in the pre-commit git hook, that is used to validate commit messages (because the preceding, unmerged commits are not available there). It _is_ activated in `gulp validate-commit-message`, which is run as part of the `lint` job on CI and thus will detect invalid commits, before their getting merged. PR Close #32023
- Loading branch information
Showing
3 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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