Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions support/hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
DUMMY_SHA=0000000000000000000000000000000000000000

echo "Running pre-push check; to skip this step use 'push --no-verify'"
AUTHOR=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/\1/p')

# shellcheck disable=SC2034
while read -r LOCAL_REF LOCAL_SHA REMOTE_REF REMOTE_SHA
Expand All @@ -37,8 +38,8 @@ do
#
# In general, we can't assume that the commits are signed off by author
# pushing, so we settle for just checking that there is a signoff at all.
SIGNED_OFF=$(git rev-list --no-merges --grep "^Signed-off-by: " "$RANGE")
NOT_SIGNED_OFF=$(git rev-list --no-merges "$RANGE" | grep -Fxv "$SIGNED_OFF")
SIGNED_OFF=$(git rev-list --no-merges --author "$AUTHOR" --grep "^Signed-off-by: " "$RANGE")
NOT_SIGNED_OFF=$(git rev-list --no-merges --author "$AUTHOR" "$RANGE" | grep -Fxv "$SIGNED_OFF")
if [ -n "$NOT_SIGNED_OFF" ]
then
echo >&2 "ERROR: The following commits do not have DCO signoff:"
Expand Down