aboutsummaryrefslogtreecommitdiff
path: root/shellrc.d/common
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 /shellrc.d/common
parent3511984027aa0890572e4a1156b548faec358f63 (diff)
downloadshellrc-4e20ca69d17fedadf8be582bc6ba130ec1ab2368.tar.gz
shellrc-4e20ca69d17fedadf8be582bc6ba130ec1ab2368.tar.bz2
shellrc-4e20ca69d17fedadf8be582bc6ba130ec1ab2368.zip
gitbmerge: fail if there is fixup! commitv0.4.2
Diffstat (limited to 'shellrc.d/common')
-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"