osmith submitted this change.
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(-)
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"
To view, visit change 39797. To unsubscribe, or for help writing mail filters, visit settings.