summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-11-20 22:41:18 -0700
committerSean Whitton <spwhitton@spwhitton.name>2019-11-20 22:41:18 -0700
commitb9e038d5b58f2a7bd155ecbfd6d943b8350126de (patch)
tree3429d3af4139a9959ce5567bd4cbaf218e0c083c /lib
parent361b740cdeefc460c0fafc748ca10e2a621c5ad1 (diff)
downloaddotfiles-b9e038d5b58f2a7bd155ecbfd6d943b8350126de.tar.gz
don't require merge commits to be signed off
Diffstat (limited to 'lib')
-rwxr-xr-xlib/hooks/git/pre-push_signed-off-by7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/hooks/git/pre-push_signed-off-by b/lib/hooks/git/pre-push_signed-off-by
index 11e182d6..775f505c 100755
--- a/lib/hooks/git/pre-push_signed-off-by
+++ b/lib/hooks/git/pre-push_signed-off-by
@@ -42,8 +42,11 @@ while read local_ref local_sha remote_ref remote_sha; do
while read ref; do
msg=$(git log -n 1 --format=%B "$ref")
if ! grep -q '^Signed-off-by: ' <<<"$msg"; then
- echo >&2 "Unsigned-off commit $ref"
- exit 1
+ # allow merge commits through
+ if [ -z "$(git rev-list -1 --merges $ref~1..$ref)" ]; then
+ echo >&2 "Unsigned-off non-merge commit $ref"
+ exit 1
+ fi
fi
done < <(git rev-list "$range")
# The process substitution above is a hack to make sure loop runs in