-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reapply "Check for fixup commits on CI" (#3745)
Re-enable the check for fixup commits (see #3742), make it work for forks, and extend it to "amend!" and "WIP" commits (and a few others).
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
base_ref=$1 | ||
|
||
# Determine the base commit | ||
base_commit=$(git merge-base HEAD origin/"$base_ref") | ||
|
||
# Check if base_commit is set correctly | ||
if [ -z "$base_commit" ]; then | ||
echo "Failed to determine base commit." | ||
exit 1 | ||
fi | ||
echo "Base commit: $base_commit" | ||
|
||
# Get commits with "fixup!" in the message from base_commit to HEAD | ||
commits=$(git log -i -E --grep '^fixup!' --grep '^squash!' --grep '^amend!' --grep '^[^\n]*WIP' --grep '^[^\n]*DROPME' --format="%h %s" "$base_commit..HEAD") | ||
|
||
if [ -z "$commits" ]; then | ||
echo "No fixup commits found." | ||
exit 0 | ||
else | ||
echo "Fixup or WIP commits found:" | ||
echo "$commits" | ||
exit 1 | ||
fi |