[PATCH RFC 6/7] email: add support for X-Aiaiai-Cancel-Email-Test-Patchset

Jacob Keller jacob.e.keller at intel.com
Wed Mar 19 15:46:46 PDT 2014


Allow a hook to cancel the patch testing program, by adding this boolean
(0 or 1) header. This enables the pre-hook to do its own validation on
the patch, and inform the test program that it should skip this patch.

Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
---
 doc/email/configuration.txt      | 5 +++++
 email/aiaiai-email-test-patchset | 8 ++++++++
 2 files changed, 13 insertions(+)

diff --git a/doc/email/configuration.txt b/doc/email/configuration.txt
index 709effea1cba..50d4e5785cb5 100644
--- a/doc/email/configuration.txt
+++ b/doc/email/configuration.txt
@@ -198,6 +198,11 @@ to set them, in order to help customize aiaiai.
     is a replacement for something already on the tree. This is primarily
     useful if your work flow uses a patch-queue model.
 
+* X-Aiaiai-Cancel-Email-Test-Patchset
+    A boolean (0 or 1) value which indicates whether to cancel the
+    aiaiai-email-test-patchset program. This can be used so that the hook can
+    cancel validation if it determined the patch is bad for some reason.
+
 2.4.1 Dispatcher Hook
 ~~~~~~~~~~~~~~~~~~~~~
 
diff --git a/email/aiaiai-email-test-patchset b/email/aiaiai-email-test-patchset
index 3bdc62b4b862..54bef779b2b3 100755
--- a/email/aiaiai-email-test-patchset
+++ b/email/aiaiai-email-test-patchset
@@ -215,6 +215,14 @@ if [ -z "$mbox" ]; then
 fi
 
 cat "$mbox"
+
+# Check whether a hook has indicated to cancel the testing this patch set
+cancel="$(fetch_header "X-Aiaiai-Cancel-Email-Test-Patchset")"
+if [ -n "$cancel" ] && [ "$cancel" = "1" ]; then
+	verbose "Canceling $PROG without testing."
+	exit 0
+fi
+
 # Use the cover letter subject and message ID if possible. If the cover letter
 # was present, 'aiaiai-email-lda' would save them in special privat headers.
 subj="$(fetch_header "X-Aiaiai-Cover-Letter-Subject" < "$mbox")"
-- 
1.8.3.1




More information about the aiaiai mailing list