3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 02:50:09 +01:00

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.
Dieser Commit ist enthalten in:
Aikar 2018-10-10 23:16:18 -04:00
Ursprung f21e10da65
Commit e020015aad
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 401ADFC9891FAAFE

Datei anzeigen

@ -14,9 +14,9 @@ function cleanupPatches {
for patch in *.patch; do for patch in *.patch; do
echo "$patch" echo "$patch"
gitver=$(tail -n 2 "$patch" | grep -ve "^$" | tail -n 1) 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 if [ "x$testver" != "x" ]; then
diffs=$(echo "$diffs" | sed 'N;$!P;$!D;$d') diffs=$(echo "$diffs" | sed 'N;$!P;$!D;$d')
fi fi