osmith has uploaded this change for review.

View Change

lint/lint_diff.sh: allow skipping with 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(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/97/39797/1
diff --git a/lint/lint_diff.sh b/lint/lint_diff.sh
index 60fd8b1..6a40ba4 100755
--- a/lint/lint_diff.sh
+++ b/lint/lint_diff.sh
@@ -5,6 +5,11 @@
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
ERROR=0

+if [ "$LINT" = 0 ]; then
+ echo "Skipping lint_diff.sh (LINT=0)"
+ exit 0
+fi
+
check_git_dir() {
if [ -z "$GIT_DIR" ]; then
echo "ERROR: path is not a git repository: $PWD"

To view, visit change 39797. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ia4563c13d9916a879a1e8afeacad8c541662adaa
Gerrit-Change-Number: 39797
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>