[PATCH RFC 4/4] hook: add support for X-Aiaiai-Project

Jacob Keller jacob.e.keller at intel.com
Fri Mar 14 17:16:01 PDT 2014

Rather than determining the project strictly from the +project portion
of the aiaiai address, also allow the dispatcher hook to insert the
project hook into the mbox header. This could be used to allow advanced
configuration of the project, such as by checking patch diffs to see
which files are modified.

Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
 doc/email/CONFIGURATION          | 8 ++++++++
 email/aiaiai-email-test-patchset | 3 ++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/doc/email/CONFIGURATION b/doc/email/CONFIGURATION
index e4a7e0353be2..1f3b758cd931 100644
--- a/doc/email/CONFIGURATION
+++ b/doc/email/CONFIGURATION
@@ -180,6 +180,14 @@ formulate a reply to the 0/n email instead of replying to the 1/n email of a
 patch series. This helps indicate that the entire patch series was validated,
 instead of appearing as though only the first patch was tested.
+The following headers will be used if available, and may be helpful for hooks
+to set them, in order to help customize aiaiai.
+* X-Aiaiai-Project
+    This header tells aiaiai which project should be used. It overrides the
+    default +project from the email address, and could be set in a scenario
+    where the project is not specified by address.
 2.4.1 Dispatcher Hook
diff --git a/email/aiaiai-email-test-patchset b/email/aiaiai-email-test-patchset
index dd5dff47c85b..3a7eb77d0b2b 100755
--- a/email/aiaiai-email-test-patchset
+++ b/email/aiaiai-email-test-patchset
@@ -248,7 +248,8 @@ mv $verbose -- "$mbox" "$tmpdir/mbox" >&2
 # Find out the project name
-prj="$(fetch_project_name "$to" "$cfg_ownmail")"
+prj="$(fetch_header "X-Aiaiai-Project" < "$mbox")"
+[ -n "$prj" ] || prj="$(fetch_project_name "$to" "$cfg_ownmail")"
 verbose "Project \"$prj\""
 # Replies will refer the first patch of the patch-set under test

More information about the aiaiai mailing list