aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2018-07-17 13:26:27 +0200
committerKarel Kočí <karel.koci@nic.cz>2018-07-17 13:26:27 +0200
commit4e20ca69d17fedadf8be582bc6ba130ec1ab2368 (patch)
tree4cd6a7433a618d66898a0dd50a0f49f5cd1b76da
parent3511984027aa0890572e4a1156b548faec358f63 (diff)
downloadshellrc-0.4.2.tar.gz
shellrc-0.4.2.tar.bz2
shellrc-0.4.2.zip
gitbmerge: fail if there is fixup! commitv0.4.2
-rw-r--r--shellrc.d/common5
1 files changed, 5 insertions, 0 deletions
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"