Remove useless hashes from patches

This avoids annoying conflicts as well as gets rid of diff noise
from clients preferring different hash lengths
This commit is contained in:
Aikar 2018-10-18 22:36:03 -04:00
parent 7141632abf
commit fa72a71601
No known key found for this signature in database
GPG Key ID: 401ADFC9891FAAFE
1 changed files with 4 additions and 2 deletions

View File

@ -12,9 +12,11 @@ echo "Rebuilding patch files from current fork state..."
function cleanupPatches { function cleanupPatches {
cd "$1" cd "$1"
for patch in *.patch; do for patch in *.patch; do
echo "$patch" sed -ri 's/index [a-f0-9]+\.\.[a-f0-9]+/index 7ac07ac07ac0..7ac07ac07ac0/g' "$patch"
sed -ri 's/^From [a-f0-9]{32,}/From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0/g' "$patch"
$gitcmd add -A $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 --color=none -E "^(\+|\-)" | grep --color=none -Ev "(From [a-z0-9]{32,}|\-\-\- a|\+\+\+ b|^.index)") diffs=$($gitcmd diff --staged "$patch" | grep --color=none -E "^(\+|\-)" | grep --color=none -Ev "(From [a-f0-9]{32,}|\-\-\- a|\+\+\+ b|^.index)")
testver=$(echo "$diffs" | tail -n 2 | grep --color=none -ve "^$" | tail -n 1 | grep --color=none "$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