Skip to content

Commit

Permalink
Properly squash commits created by git commit --fixup=amend:$rev
Browse files Browse the repository at this point in the history
git commit --fixup=amend:$rev allows to overwrite the commit message of
a previous commit. This results in a commit with prefix "amend!". Expand
the pattern that triggers using git rebase -i --autosquash to also match
on such commits.
  • Loading branch information
Uwe Kleine-König authored and ukleinek committed Oct 18, 2023
1 parent 545e4e6 commit e62b520
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion umpf
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ rebase_branch() {
echo "# umpf-hashinfo: ${topicrev}" >&${series_out}
${GIT} rev-parse HEAD > "${STATE}/prev_head"
if ${GIT} log --oneline "${base}..${topicrev}" | grep -q '\(fixup\|squash\)!'; then
if ${GIT} log --oneline "${base}..${topicrev}" | grep -q '\(amend\|fixup\|squash\)!'; then
args="-i --autosquash"
fi
if ! ${GIT} rebase -q ${args} --onto HEAD "${base}" "${topicrev}" >&2; then
Expand Down

0 comments on commit e62b520

Please sign in to comment.