From d158c69570f72eefd0f6d92df046a53e15342ff9 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Thu, 7 Apr 2016 01:36:23 -0500 Subject: [PATCH] Disable, Enable GPG signs as needed Pre, Post git am Disable GPG signing before AM, slows things down and doesn't play nicely. There is also zero rational or logical reason to do so for these sub-repo AMs. It's re-enabled (if needed) immediately after, pass or fail. Given GitHub's recent push for GPG signing, and our own testing, this is not only helpful, but necessary. --- scripts/applyPatches.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/applyPatches.sh b/scripts/applyPatches.sh index d4ab2fbef1..4533855757 100755 --- a/scripts/applyPatches.sh +++ b/scripts/applyPatches.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash ( -set -e PS1="$" basedir="$(cd "$1" && pwd -P)" workdir="$basedir/work" +gpgsign=$(git config commit.gpgsign) echo "Rebuilding Forked projects.... " function applyPatch { @@ -41,6 +41,20 @@ function applyPatch { fi } +function enableCommitSigningIfNeeded { + if [[ "$gpgsign" == "true" ]]; then + # Yes, this has to be global + git config --global commit.gpgsign true + fi +} + +# Disable GPG signing before AM, slows things down and doesn't play nicely. +# There is also zero rational or logical reason to do so for these sub-repo AMs. +# Calm down kids, it's re-enabled (if needed) immediately after, pass or fail. +if [[ "$gpgsign" == "true" ]]; then + git config --global commit.gpgsign false +fi + # Move into spigot dir cd "$workdir/Spigot" basedir=$(pwd) @@ -50,6 +64,7 @@ basedir=$(pwd) applyPatch ../CraftBukkit Spigot-Server patched ) || ( echo "Failed to apply Spigot Patches" + enableCommitSigningIfNeeded exit 1 ) || exit 1 # Move out of Spigot @@ -65,8 +80,10 @@ cd "$basedir" ( applyPatch "work/Spigot/Spigot-API" Paper-API HEAD && applyPatch "work/Spigot/Spigot-Server" Paper-Server HEAD + enableCommitSigningIfNeeded ) || ( echo "Failed to apply Paper Patches" + enableCommitSigningIfNeeded exit 1 ) || exit 1 )