osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/39797?usp=email )
Change subject: lint/lint_diff: allow skipping with OSMO_LINT=0 ......................................................................
lint/lint_diff: allow skipping with OSMO_LINT=0
When this script is set as pre-commit hook, it can be useful to skip the linter with this env var to make a commit that intentionally does not pass the linter (e.g. to test if it will be caught in gerrit + jenkins).
There is also "git commit --no-verify", but with that the hook that applies the Change-Id does not run.
Change-Id: Ia4563c13d9916a879a1e8afeacad8c541662adaa --- M lint/lint_diff.sh 1 file changed, 5 insertions(+), 0 deletions(-)
Approvals: pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified
diff --git a/lint/lint_diff.sh b/lint/lint_diff.sh index 60fd8b1..4b95b9f 100755 --- a/lint/lint_diff.sh +++ b/lint/lint_diff.sh @@ -5,6 +5,11 @@ SCRIPT_DIR="$(dirname "$(realpath "$0")")" ERROR=0
+if [ "$OSMO_LINT" = 0 ]; then + echo "Skipping lint_diff.sh (OSMO_LINT=0)" + exit 0 +fi + check_git_dir() { if [ -z "$GIT_DIR" ]; then echo "ERROR: path is not a git repository: $PWD"