diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-11-20 22:41:18 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-11-20 22:41:18 -0700 |
commit | b9e038d5b58f2a7bd155ecbfd6d943b8350126de (patch) | |
tree | 3429d3af4139a9959ce5567bd4cbaf218e0c083c /lib | |
parent | 361b740cdeefc460c0fafc748ca10e2a621c5ad1 (diff) | |
download | dotfiles-b9e038d5b58f2a7bd155ecbfd6d943b8350126de.tar.gz |
don't require merge commits to be signed off
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/hooks/git/pre-push_signed-off-by | 7 |
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 |