Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions dco_verify_white_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
58da8ae48f274c3c602fe03eb7675b09d23340af
11 changes: 10 additions & 1 deletion support/hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,22 @@ do
RANGE="$REMOTE_SHA..$LOCAL_SHA"
fi

# Provide a white-list to ignore the DCO verify on specific commits
DCO_WHITE_LIST_PATH="$(dirname "$(realpath "$0")")/../../dco_verify_white_list.txt"
DCO_WHITE_LIST=""
if [ -f "$DCO_WHITE_LIST_PATH" ]
then
WHITE_LIST="$(cat "$DCO_WHITE_LIST_PATH")"
fi

# Verify DCO signoff. We do this before the format checker, since it has
# some probability of failing spuriously, while this check never should.
#
# 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")
NOT_SIGNED_OFF=$(git rev-list --no-merges "$RANGE" | grep -Fxv "$SIGNED_OFF" | grep -Fxv "$WHITE_LIST")

if [ -n "$NOT_SIGNED_OFF" ]
then
echo >&2 "ERROR: The following commits do not have DCO signoff:"
Expand Down