[PATCH RFC aiaiai 04/11] email: don't allow pcfg_branch to default

Jacob Keller jacob.e.keller at intel.com
Thu Mar 27 11:40:02 PDT 2014


Since we don't allow pcfg_path to default, it makes little sense to
allow pcfg_branch to default. Also, it would be better to have a die
check on branch, so that we fail if the project doesn't specify the
branch.

Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
---
 doc/email/configuration.txt     | 10 +++++-----
 doc/email/example-aiaiai.cfg    | 19 ++++++++++---------
 email/aiaiai-email-sh-functions | 21 +++++++++------------
 3 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/doc/email/configuration.txt b/doc/email/configuration.txt
index 1f3b758cd931..70a307f15797 100644
--- a/doc/email/configuration.txt
+++ b/doc/email/configuration.txt
@@ -90,11 +90,6 @@ additive.
     the kernel, or possibly inside the defconfigdir as specified by other
     option. Multiple configs are supported by seperating with spaces. Each
     config will be tested. See the example-aiaiai.cfg for details and examples.
-* branch
-    What git refspec to validate against. Usually this should be a remote
-    branch ie: origin/master, but can actually be any refspec. Note that the
-    defconfigs specified in the config option must actually be available from
-    the refspec.
 * always_cc
     A comma seperated list of addresses to always Cc when creating replies. For
     example, it could be a mailing list to which all aiaiai replies go.
@@ -155,6 +150,11 @@ specified for each project.
     also does not depend on the tree being (or not) bare, so you can feel free
     to make this a bare remote or a local tree. Generally, aiaiai works best if
     the tree is locally stored on the same machine as the aiaiai process.
+* branch
+    What git refspec to validate against. Usually this should be a remote
+    branch ie: origin/master, but can actually be any refspec. Note that the
+    defconfigs specified in the config option must actually be available from
+    the refspec.
 
 2.4 Aiaiai Hooks
 ~~~~~~~~~~~~~~~~
diff --git a/doc/email/example-aiaiai.cfg b/doc/email/example-aiaiai.cfg
index 6101c5824fc6..73014d8520f4 100644
--- a/doc/email/example-aiaiai.cfg
+++ b/doc/email/example-aiaiai.cfg
@@ -78,13 +78,6 @@
 	# CROSS_COMPILE="arm-eabi-". The last component is optional.
 	configs = x86_64_defconfig,x86_64 i386_defconfig,i386
 
-	# Git refspec to validate the patches against. Usually this a the
-	# remote branch name. But may actually be any refspec.
-	#
-	# Note, the defconfig files specified in the "configs" option must be
-	# part of this git refspec.
-	branch = origin/master
-
 	# Comma-separated list of e-mail addresses to always CC when replying.
 	# These are maintainers or other project supervisors. This may be a
 	# separate mailing list for replies from Aiaiai.
@@ -139,7 +132,9 @@
 # The e-mail front-end may operate on several project. Each project has its
 # own kernel tree, kernel configuration, and some other settings. These are
 # configured in per-project sections. Section names have to start with "prj_"
-# and follow with the name of the project.
+# and follow with the name of the project. The 'name', 'description', 'path'
+# and 'branch' settings are required and are not provided by the [defaults]
+# section, so must be set for each project.
 
 # This is the "android" project section.
 [prj_android]
@@ -157,6 +152,13 @@
 	# server. No default value.
 	path = /home/aiaiai/work/git/android-x86
 
+	# Git refspec to validate the patches against. Usually this a the
+	# remote branch name. But may actually be any refspec.
+	#
+	# Note, the defconfig files specified in the "configs" option must be
+	# part of this git refspec.
+	branch = origin/3.0-mid
+
 	# See the [defaults] section above for detailed explanation of the
 	# options below, and their formats. Be aware that any value set here
 	# will override the default value, ignoring anything set there. For
@@ -164,7 +166,6 @@
 	# value and actually set the option to the empty value. To use the
 	# default, simply leave the option out of the per-project section.
 	configs = android_defconfig,i386 android_debug_defconfig,i386
-	branch = origin/3.0-mid
 	always_cc =
 	reply_to_all = 1
 	accept_notify = 1
diff --git a/email/aiaiai-email-sh-functions b/email/aiaiai-email-sh-functions
index f996e9db4a46..b80892151514 100644
--- a/email/aiaiai-email-sh-functions
+++ b/email/aiaiai-email-sh-functions
@@ -182,10 +182,10 @@ parse_config()
 # per-option variables and their values are exactly as in the configuration
 # file:
 #
-# __dcfg_configs, __dcfg_branch, __dcfg_always_cc, __dcfg_reply_to_all,
-# __dcfg_accept_notify, __dcfg_unwanted_keywords, __dcfg_kmake_opts,
-# __dcfg_targets, __dcfg_defconfigdir, __dcfg_bisectability, __dcfg_sparse,
-# __dcfg_smatch, __dcfg_cppcheck, __dcfg_coccinelle
+# __dcfg_configs, __dcfg_always_cc, __dcfg_reply_to_all, __dcfg_accept_notify,
+# __dcfg_unwanted_keywords, __dcfg_kmake_opts, __dcfg_targets,
+# __dcfg_defconfigdir, __dcfg_bisectability, __dcfg_sparse, __dcfg_smatch,
+# __dcfg_cppcheck, __dcfg_coccinelle
 #
 # It is expected that this is used internally by the parse_prj_config and
 # should not normally be called outside of this file.
@@ -196,7 +196,6 @@ __parse_default_config()
 	local cfgfile="$1"; shift
 
 	__dcfg_configs="$(ini_config_get "$cfgfile" "defaults" "configs")"
-	__dcfg_branch="$(ini_config_get "$cfgfile" "defaults" "branch")"
 	__dcfg_always_cc="$(ini_config_get "$cfgfile" "defaults" "always_cc")"
 	__dcfg_reply_to_all="$(ini_config_get "$cfgfile" "defaults" "reply_to_all")"
 	__dcfg_accept_notify="$(ini_config_get "$cfgfile" "defaults" "accept_notify")"
@@ -214,15 +213,14 @@ __parse_default_config()
 # Similar to "parse_config", but parses a project configuration section. If the
 # project is found, the following variables are defined:
 #
-# pcfg_name, pcfg_description, and pcfg_path.
+# pcfg_name, pcfg_description, pcfg_path and pcfg_branch.
 #
 # The following variables are defined, but receive default values from the
 # [defaults] section, if they are not specified in the project section:
 #
-# pcfg_configs, pcfg_branch, pcfg_always_cc, pcfg_reply_to_all,
-# pcfg_accept_notify, pcfg_unwanted_keywords, pcfg_kmake_opts, pcfg_targets,
-# pcfg_defconfigdir, pcfg_bisectability, pcfg_sparse, pcfg_smatch,
-# pcfg_cppcheck, pcfg_coccinelle
+# pcfg_configs, pcfg_always_cc, pcfg_reply_to_all, pcfg_accept_notify,
+# pcfg_unwanted_keywords, pcfg_kmake_opts, pcfg_targets, pcfg_defconfigdir,
+# pcfg_bisectability, pcfg_sparse, pcfg_smatch, pcfg_cppcheck, pcfg_coccinelle
 #
 # If the project is not found, this function only defined an empty "pcfg_name"
 # variable.
@@ -242,6 +240,7 @@ parse_prj_config()
 
 	ini_config_get_or_die pcfg_description   "$cfgfile" "prj_$prj" "description"
 	ini_config_get_or_die pcfg_path          "$cfgfile" "prj_$prj" "path"
+	ini_config_get_or_die pcfg_branch        "$cfgfile" "prj_$prj" "branch"
 
 	# The following options all take default value from the "defaults"
 	# section, and hence "override" those settings. First we need to populate those.
@@ -253,8 +252,6 @@ parse_prj_config()
 	# project config does not specify anything.
 	pcfg_configs="$(ini_config_get "$cfgfile" "prj_$prj" "configs")"
 	ini_config_is_set "$cfgfile" "prj_$prj" "configs" || pcfg_configs="$__dcfg_configs"
-	pcfg_branch="$(ini_config_get "$cfgfile" "prj_$prj" "branch")"
-	ini_config_is_set "$cfgfile" "prj_$prj" "branch" || pcfg_branch="$__dcfg_branch"
 	pcfg_reply_to_all="$(ini_config_get "$cfgfile" "prj_$prj" "reply_to_all")"
 	ini_config_is_set "$cfgfile" "prj_$prj" "reply_to_all" || pcfg_reply_to_all="$__dcfg_reply_to_all"
 	pcfg_accept_notify="$(ini_config_get "$cfgfile" "prj_$prj" "accept_notify")"
-- 
1.8.3.1




More information about the aiaiai mailing list