File: check_for_fixups.sh

package info (click to toggle)
lazygit 0.53.0%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,016 kB
  • sloc: sh: 136; makefile: 76
file content (14 lines) | stat: -rwxr-xr-x 400 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

# We will have only done a shallow clone, so the git log will consist only of
# commits on the current PR
commits=$(git log --grep='^fixup!' --grep='^squash!' --grep='^amend!' --grep='^[^\n]*WIP' --grep='^[^\n]*DROPME' --format="%h %s")

if [ -z "$commits" ]; then
    echo "No fixup commits found."
    exit 0
else
    echo "Fixup or WIP commits found:"
    echo "$commits"
    exit 1
fi