]> www.infradead.org Git - users/dedekind/aiaiai.git/commitdiff
hook: add support for X-Aiaiai-Project
authorJacob Keller <jacob.e.keller@intel.com>
Sat, 15 Mar 2014 00:16:01 +0000 (17:16 -0700)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tue, 18 Mar 2014 13:35:22 +0000 (15:35 +0200)
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@intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
doc/email/CONFIGURATION
email/aiaiai-email-test-patchset

index e4a7e0353be2c96d3f010b718afe8f0372ac436a..1f3b758cd931a038066e9969c8e381f86d1a42db 100644 (file)
@@ -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
 ~~~~~~~~~~~~~~~~~~~~~
 
index dd5dff47c85b6fdbfa67bffe32068c291fb0d749..3a7eb77d0b2b508462b7f71d81bee54768808821 100755 (executable)
@@ -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