From e020015aad6ba4584c1118caadfb9dc5693a3bc2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 10 Oct 2018 23:16:18 -0400 Subject: [PATCH] Fix rebuildPatches and grep colors not reverting junk changes we've seen some index lines change in length in some PR's, though this script was suppose to ignore those changes already. The only way I can see that not working is if the color mode of grep is breaking the pattern matching, as some people default their grep to use color=always this adds color=none to ensure colors are disabled, should ensure it. --- scripts/rebuildPatches.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/rebuildPatches.sh b/scripts/rebuildPatches.sh index 6553d1aa58..49d347d53f 100755 --- a/scripts/rebuildPatches.sh +++ b/scripts/rebuildPatches.sh @@ -14,9 +14,9 @@ function cleanupPatches { for patch in *.patch; do echo "$patch" gitver=$(tail -n 2 "$patch" | grep -ve "^$" | tail -n 1) - diffs=$($gitcmd diff --staged "$patch" | grep -E "^(\+|\-)" | grep -Ev "(From [a-z0-9]{32,}|\-\-\- a|\+\+\+ b|.index)") + diffs=$($gitcmd diff --staged "$patch" | grep --color=none -E "^(\+|\-)" | grep --color=none -Ev "(From [a-z0-9]{32,}|\-\-\- a|\+\+\+ b|^.index)") - testver=$(echo "$diffs" | tail -n 2 | grep -ve "^$" | tail -n 1 | grep "$gitver") + testver=$(echo "$diffs" | tail -n 2 | grep --color=none -ve "^$" | tail -n 1 | grep --color=none "$gitver") if [ "x$testver" != "x" ]; then diffs=$(echo "$diffs" | sed 'N;$!P;$!D;$d') fi