From 9d4e81e8bf0d52a063c46a3dc826f7e85068b07d Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 28 Oct 2019 19:18:23 -0700 Subject: [PATCH] hack/validate/vendor: print diff for modified files In case some files were modified (rather than merely added or removed), we're curious to see the diff for those. Signed-off-by: Kir Kolyshkin --- hack/validate/vendor | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hack/validate/vendor b/hack/validate/vendor index 41676fed53..93fb4a1e8b 100755 --- a/hack/validate/vendor +++ b/hack/validate/vendor @@ -13,6 +13,7 @@ validate_vendor_diff(){ vndr # check if any files have changed diffs="$(git status --porcelain -- vendor 2>/dev/null)" + mfiles="$(echo "$diffs" | awk '/^ M / {print $2}')" if [ "$diffs" ]; then { echo 'The result of vndr differs' @@ -21,6 +22,9 @@ validate_vendor_diff(){ echo echo 'Please vendor your package with github.com/LK4D4/vndr.' echo + if [ -n "$mfiles" ] ; then + git diff -- "$mfiles" + fi } >&2 false else