fix hack/git-validation.sh script

It is impossible to have this passing because it did not run in CI and
invalid commit were merged since the fixed commit. The correct way
should be to always use the merge base commit instead, at least this
will only check commit that are actually part of the PR not all which is
wasteful. Also removed unused $PATH overwrite and $GITVALIDATE_FLAGS
var.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger 2022-11-02 16:49:12 +01:00
parent c90fdc85f8
commit 1c4761c67e
No known key found for this signature in database
GPG Key ID: EB145DD938A3CAF2
1 changed files with 2 additions and 6 deletions

View File

@ -1,13 +1,9 @@
#!/usr/bin/env bash
export PATH=${GOPATH%%:*}/bin:${PATH}
export GIT_VALIDATION=tests/tools/build/git-validation
if [ ! -x "$GIT_VALIDATION" ]; then
echo git-validation is not installed.
echo Try installing it with \"make install.tools\"
exit 1
fi
if test "$TRAVIS" != true ; then
#GITVALIDATE_EPOCH=":/git-validation epoch"
GITVALIDATE_EPOCH="9b6484f0058d38a1b85d8b0a3e2ca83684d02e8b"
fi
exec "$GIT_VALIDATION" -q -run DCO,short-subject ${GITVALIDATE_EPOCH:+-range "${GITVALIDATE_EPOCH}""..${GITVALIDATE_TIP:-@}"} ${GITVALIDATE_FLAGS}
EPOCH_TEST_COMMIT=$(git merge-base ${DEST_BRANCH:-main} HEAD)
exec "$GIT_VALIDATION" -q -run DCO,short-subject -range "${EPOCH_TEST_COMMIT}..HEAD"