-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I keep merging PRs that still have fixup commits on them! This will make it impossible to do so
- Loading branch information
1 parent
73bcbe4
commit c76bc48
Showing
2 changed files
with
47 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 -P --grep "fixup\!" --format="%h %s" "$base_commit..HEAD") | ||
|
||
if [ -z "$commits" ]; then | ||
echo "No fixup commits found." | ||
exit 0 | ||
else | ||
echo "Fixup commits found:" | ||
echo "$commits" | ||
exit 1 | ||
fi |