From 4e20ca69d17fedadf8be582bc6ba130ec1ab2368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 17 Jul 2018 13:26:27 +0200 Subject: gitbmerge: fail if there is fixup! commit --- shellrc.d/common | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'shellrc.d/common') diff --git a/shellrc.d/common b/shellrc.d/common index 7fc8047..6fbbfc1 100644 --- a/shellrc.d/common +++ b/shellrc.d/common @@ -58,9 +58,14 @@ genhex() { # Automatic branch merger (merge branch, push it to server and remove branch) # Expects name of the branch as argument +# It fails if it's not fast forward merge and if there is fixup! commit. gitbmerge() { ( set -e + if [ -n "$(git log --grep="^fixup\!" HEAD.."$1")" ]; then + echo "First squash fixups!" + exit 1 + fi local WT="$(git worktree list | sed -nE "/\[$1\]/{s/([^ ]+) .*/\1/p}")" if [ -n "$WT" ]; then rm -r "$WT" -- cgit v1.2.3