Skip to content

Commit

Permalink
fix hack/git-validation.sh script
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Luap99 committed Nov 2, 2022
1 parent 67c68ae commit 18ee330
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions hack/git-validation.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 18ee330

Please sign in to comment.