From: Jacob Keller Date: Sat, 15 Mar 2014 00:16:01 +0000 (-0700) Subject: hook: add support for X-Aiaiai-Project X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4464b89635a17f8cbbd0576f860a3d1fb2166e56;p=users%2Fdedekind%2Faiaiai.git 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 --- 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