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

Speed up rebuilding patches and reduce diff

Dieser Commit ist enthalten in:
Minecrell 2020-05-06 11:31:08 +02:00 committet von GitHub
Ursprung f37381ea8a
Commit 5c0bfffa09
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -16,13 +16,7 @@ function cleanupPatches {
cd "$1" cd "$1"
for patch in *.patch; do for patch in *.patch; do
echo "$patch" echo "$patch"
gitver=$(tail -n 2 "$patch" | grep -ve "^$" | tail -n 1) diffs=$($gitcmd diff --staged "$patch" | grep --color=none -E "^(\+|\-)" | grep --color=none -Ev "(\-\-\- 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")
if [ "x$testver" != "x" ]; then
diffs=$(echo "$diffs" | sed 'N;$!P;$!D;$d')
fi
if [ "x$diffs" == "x" ] ; then if [ "x$diffs" == "x" ] ; then
$gitcmd reset HEAD "$patch" >/dev/null $gitcmd reset HEAD "$patch" >/dev/null
@ -56,7 +50,7 @@ function savePatches {
cd "$basedir/$target" cd "$basedir/$target"
$gitcmd format-patch --no-stat -N -o "$basedir/${what_name}-Patches/" upstream/upstream >/dev/null $gitcmd format-patch --zero-commit --full-index --no-signature --no-stat -N -o "$basedir/${what_name}-Patches/" upstream/upstream >/dev/null
cd "$basedir" cd "$basedir"
$gitcmd add -A "$basedir/${what_name}-Patches" $gitcmd add -A "$basedir/${what_name}-Patches"
if [ "$nofilter" == "0" ]; then if [ "$nofilter" == "0" ]; then