[PATCH 08/13] email: add support for X-Aiaiai-Base-Commit
Jacob Keller
jacob.e.keller at intel.com
Thu Mar 20 16:37:06 PDT 2014
Allow prospective hooks to detect a base-commit in some manner, instead
of assuming the tip of the tree is the only place to test. This can be
helpful for testing patch re-submissions. Primarly intended for models
where a maintainer keeps a patch-queue branch on which he pushes and
pops patches, so that validation can test them.
Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
---
doc/email/configuration.txt | 6 ++++++
email/aiaiai-email-test-patchset | 12 +++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/doc/email/configuration.txt b/doc/email/configuration.txt
index 9056e0c0fb74..709effea1cba 100644
--- a/doc/email/configuration.txt
+++ b/doc/email/configuration.txt
@@ -192,6 +192,12 @@ to set them, in order to help customize aiaiai.
default +project from the email address, and could be set in a scenario
where the project is not specified by address.
+* X-Aiaiai-Base-Commit
+ This header tells aiaiai what to use as the base commit, instead of the
+ configured branch. This can be useful if the hook can detect that the patch
+ is a replacement for something already on the tree. This is primarily
+ useful if your work flow uses a patch-queue model.
+
2.4.1 Dispatcher Hook
~~~~~~~~~~~~~~~~~~~~~
diff --git a/email/aiaiai-email-test-patchset b/email/aiaiai-email-test-patchset
index c02b331387d0..e1f06e2f836e 100755
--- a/email/aiaiai-email-test-patchset
+++ b/email/aiaiai-email-test-patchset
@@ -299,11 +299,21 @@ if [ "$pcfg_accept_notify" = "1" ]; then
send_accepted_email
fi
+# Use the Base-Commit header if specified, otherwise use the branch
+commit="$(fetch_header "X-Aiaiai-Base-Commit" < "$mbox")"
+if [ -z "$commit" ]; then
+ # Use the default branch
+ commit="$pcfg_branch"
+else
+ # Warn that we are testing against a commit
+ verbose "Found X-Aiaiai-Base-Commit. Testing against $commit."
+fi
+
# Test the path (or patch-set)
verbose "Test configs \"$pcfg_configs\" branch \"$pcfg_branch\" of \"$pcfg_path\""
aiaiai-test-patchset $verbose ${cfg_preserve_files:+--preserve} \
${pcfg_targets:+--targets "$pcfg_targets"} $bisectability $sparse $smatch $cppcheck $coccinelle \
- -i "$mbox" -j "$cfg_jobs" -c "$pcfg_branch" -w "$tmpdir" \
+ -i "$mbox" -j "$cfg_jobs" -c "$commit" -w "$tmpdir" \
${pcfg_defconfigdir:+-C "$pcfg_defconfigdir"} \
${pcfg_unwanted_keywords:+-K "$pcfg_unwanted_keywords"} \
${pcfg_kmake_opts:+-M "$pcfg_kmake_opts"} -- \
--
1.8.3.1
More information about the aiaiai
mailing list