From 80218febc125d4da8417a48e6f6252ff9f12d4c9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 1 Feb 2021 12:10:21 -0700 Subject: util: Make sure hooks do not show external diff tool At present when I 'repo upload' it opens meld and shows me all the changes I have made, sometimes many times. Add the --no-ext-diff flag to two up the pre-submit scripts to fix this. BUG=none BRANCH=none TEST=repo upload... see that meld does not run Signed-off-by: Simon Glass Change-Id: Id48cc1654f681e19052298c1ab98911883c19318 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2665297 Reviewed-by: Mike Frysinger --- util/host_command_check.sh | 3 ++- util/presubmit_check.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/util/host_command_check.sh b/util/host_command_check.sh index 62911bb0c3..f153762d84 100755 --- a/util/host_command_check.sh +++ b/util/host_command_check.sh @@ -82,7 +82,8 @@ should_check() { main() { # Do not run the check unless an EC_[xxx]CMD change is present. - if [[ -z "$(git diff "${PRESUBMIT_COMMIT}~" "${PRESUBMIT_COMMIT}" -U0 | + if [[ -z "$(git diff --no-ext-diff "${PRESUBMIT_COMMIT}~" \ + "${PRESUBMIT_COMMIT}" -U0 | egrep 'EC_[^ ]*CMD')" ]]; then exit 0 fi diff --git a/util/presubmit_check.sh b/util/presubmit_check.sh index bbf4338fad..7d46f38a0f 100755 --- a/util/presubmit_check.sh +++ b/util/presubmit_check.sh @@ -13,7 +13,8 @@ if [[ -z ${upstream_branch} ]]; then fi # This will print the offending CPRINTS invocations, if any, and the names of # the files they are in. -if git diff "${upstream_branch}" HEAD | grep -e '^+\(.*CPRINTS(.*\\n"\|++\)' | +if git diff --no-ext-diff "${upstream_branch}" HEAD | + grep -e '^+\(.*CPRINTS(.*\\n"\|++\)' | grep CPRINTS -B1 >&2 ; then echo "error: CPRINTS strings should not include newline characters" >&2 exit 1 -- cgit v1.2.1