summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-01-04 00:22:22 +0100
committerRobin Jarry <robin@jarry.cc>2023-01-04 00:22:22 +0100
commit9a70b1aed7d4c6ee73102c59a44389a8a5a62ef8 (patch)
tree712c76304d1cffb8e1c44e926b5d27b3f24c83f1
parentddfa5cac1fe9ce602b7b8b5624122cc46f83d62a (diff)
downloadaerc-9a70b1aed7d4c6ee73102c59a44389a8a5a62ef8.tar.gz
aerc-9a70b1aed7d4c6ee73102c59a44389a8a5a62ef8.zip
sendemail-validate: fix compat with older git versions
Seen with git 2.34: error: unknown option `empty=drop' Check the patch file manually instead and abort early. Signed-off-by: Robin Jarry <robin@jarry.cc>
-rwxr-xr-xcontrib/sendemail-validate12
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/sendemail-validate b/contrib/sendemail-validate
index 024506fb..f334bff5 100755
--- a/contrib/sendemail-validate
+++ b/contrib/sendemail-validate
@@ -8,16 +8,16 @@ die() {
}
email="${1?email file}"
+# skip empty patches (cover letter)
+grep -q "^diff --git " "$email" || exit 0
+echo 'Cloning upstream repo in temp dir ...'
tmp=$(mktemp -d)
trap "rm -rf -- $tmp" EXIT
git clone -q --depth=1 "https://git.sr.ht/~rjarry/aerc" "$tmp" ||
die "Failed to clone upstream repository. No network connection?"
export GIT_DIR="$tmp/.git"
-git -C "$tmp" am -q3 --empty=drop "$email" ||
- die "Failed to apply patch on current upstream master branch. git pull --rebase?"
-if ! git -C "$tmp" diff --quiet origin/master; then
- # patch is empty (cover letter)
- exit 0
-fi
+git -C "$tmp" am -3 "$email" ||
+ die "Failed to apply patch on upstream master branch. git pull --rebase?"
+echo 'Running `make all lint tests check-patches` ...'
make -sC "$tmp" all lint tests check-patches ||
die "Please fix the above issues and amend your patch."