From da992ebcc40745c01d1f49bdd6621c0707234b24 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Sun, 13 Jan 2019 15:28:03 -0700 Subject: [PATCH] always ignore submodules with git-status In a couple of cases, we do specify --ignore-submodules for the actual check, but when dumping the results to the console, we omit the --ignore-submodules. Fix that. Same for check_format.sh - don't consider submodules for files changes that suggest a CHANGELOG.md update. This is in preparation for adding isa-l as an SPDK submodule. isa-l doesn't use any .gitignore files, so I want to make sure we're just ignoring anything related to isa-l build artifacts. We could probably remove our local DPDK submodule patch to its .gitignore after this patch but will leave that for another time. Signed-off-by: Jim Harris Change-Id: Id9be9ce87569004c426d02c6cd44d645f3ff859f Reviewed-on: https://review.gerrithub.io/c/440808 Tested-by: SPDK CI Jenkins Reviewed-by: Seth Howell Reviewed-by: Shuhei Matsumoto Reviewed-by: Darek Stojaczyk Reviewed-by: Ben Walker Chandler-Test-Pool: SPDK Automated Test System --- autobuild.sh | 2 +- autopackage.sh | 2 +- scripts/check_format.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/autobuild.sh b/autobuild.sh index 9c6af3864..9fd887e3a 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -84,7 +84,7 @@ timing_exit "$make_timing_label" timing_enter generated_files_check if [ `git status --porcelain --ignore-submodules | wc -l` -ne 0 ]; then echo "Generated files missing from .gitignore:" - git status --porcelain + git status --porcelain --ignore-submodules exit 1 fi timing_exit generated_files_check diff --git a/autopackage.sh b/autopackage.sh index 19b5cd286..ed898ee5e 100755 --- a/autopackage.sh +++ b/autopackage.sh @@ -16,7 +16,7 @@ $MAKE clean if [ `git status --porcelain --ignore-submodules | wc -l` -ne 0 ]; then echo make clean left the following files: - git status --porcelain + git status --porcelain --ignore-submodules exit 1 fi diff --git a/scripts/check_format.sh b/scripts/check_format.sh index b439dd34e..fee080384 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -210,7 +210,7 @@ fi # are detected. echo -n "Checking whether CHANGELOG.md should be updated..." staged=$(git diff --name-only --cached .) -working=$(git status -s --porcelain | grep -iv "??" | awk '{print $2}') +working=$(git status -s --porcelain --ignore-submodules | grep -iv "??" | awk '{print $2}') files="$staged $working" if [[ "$files" = " " ]]; then files=$(git diff-tree --no-commit-id --name-only -r HEAD)