From 4464b89635a17f8cbbd0576f860a3d1fb2166e56 Mon Sep 17 00:00:00 2001 From: Jacob Keller Date: Fri, 14 Mar 2014 17:16:01 -0700 Subject: [PATCH] hook: add support for X-Aiaiai-Project 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 Signed-off-by: Artem Bityutskiy --- 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 e4a7e03..1f3b758 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 dd5dff4..3a7eb77 100755 --- a/email/aiaiai-email-test-patchset +++ b/email/aiaiai-email-test-patchset @@ -248,7 +248,8 @@ mv $verbose -- "$mbox" "$tmpdir/mbox" >&2 mbox="$tmpdir/mbox" # 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 -- 2.49.0