1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-21 12:16:54 +02:00
lazygit/scripts/check_for_fixups.sh
Stefan Haller 1919a2d2d6 Reapply "Check for fixup commits on CI"
This reverts commit f2db9fa3f91311fb42967234222bc510cf89b8bf.
2024-07-13 14:08:44 +02:00

26 lines
563 B
Bash
Executable File

#!/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