From 0e16c65fd2ced7b8970747f148522f1c54b2a081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 30 Jun 2020 13:02:40 +0200 Subject: shellrc.d/git: gitbmerge error on applied suggestions commits These are commits created by Gitlab and should not be in tree neither (same as fixup commits). --- shellrc.d/git | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'shellrc.d/git') diff --git a/shellrc.d/git b/shellrc.d/git index a662cb0..493d89b 100644 --- a/shellrc.d/git +++ b/shellrc.d/git @@ -12,10 +12,14 @@ _gitbworktree() { # 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 + [ -z "$(git log --grep="^fixup\!" HEAD.."$1")" ] || { echo "First squash fixups!" - exit 1 - fi + return 1 + } + [ -z "$(git log --grep="^Apply suggestion to " HEAD.."$1")" ] || { + echo "First squash suggestions!" + return 1 + } local wt wt="$(_gitbworktree "$1")" if [ -n "$wt" ]; then -- cgit v1.2.3