summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2014-03-27 11:40:03 -0700
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2014-03-31 11:14:49 +0300
commit207502c808710170e965528d516dd25254662a92 (patch)
tree7673cdfbc778daefa39e2541af9c264f09a45edc
parent7234904732fe89ab43c5e6cd184e88663b8098fa (diff)
downloadaiaiai-207502c808710170e965528d516dd25254662a92.tar.gz
email: add canonical_url variable for list_projects
If supplied, this url can be used to add a [git clone -b <branch> <url>] section to the list_projects output, which indicates to the user how to clone the specified project. This can be useful to enable users to more easily see how to start working on a project. The canonical url is not used by aiaiai as an access point. It mainly is useful if the local clones that aiaiai uses are setup as --mirror clones. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r--doc/email/configuration.txt4
-rw-r--r--doc/email/example-aiaiai.cfg5
-rw-r--r--email/aiaiai-email-sh-functions3
-rwxr-xr-xemail/aiaiai-email-test-patchset12
4 files changed, 21 insertions, 3 deletions
diff --git a/doc/email/configuration.txt b/doc/email/configuration.txt
index 70a307f..9056e0c 100644
--- a/doc/email/configuration.txt
+++ b/doc/email/configuration.txt
@@ -155,6 +155,10 @@ specified for each project.
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.
+* canonical_url
+ The url to use when displaying a url for user consumption. Intended to be a
+ patch-submitter visible mirror of the local path used internally. If not
+ supplied, aiaiai will display the path instead.
2.4 Aiaiai Hooks
~~~~~~~~~~~~~~~~
diff --git a/doc/email/example-aiaiai.cfg b/doc/email/example-aiaiai.cfg
index 73014d8..f9c7e0f 100644
--- a/doc/email/example-aiaiai.cfg
+++ b/doc/email/example-aiaiai.cfg
@@ -152,6 +152,11 @@
# server. No default value.
path = /home/aiaiai/work/git/android-x86
+ # Remote url used for display only. Aiaiai does not directly use this,
+ # and does not attempt to keep the path up to date itself. This is used
+ # only for display to the user.
+ canonical_url = git://aiaiai/git/android-x86
+
# Git refspec to validate the patches against. Usually this a the
# remote branch name. But may actually be any refspec.
#
diff --git a/email/aiaiai-email-sh-functions b/email/aiaiai-email-sh-functions
index b808921..20e4826 100644
--- a/email/aiaiai-email-sh-functions
+++ b/email/aiaiai-email-sh-functions
@@ -213,7 +213,7 @@ __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, pcfg_path and pcfg_branch.
+# pcfg_name, pcfg_description, pcfg_path, pcfg_branch and pcfg_canonical_url.
#
# The following variables are defined, but receive default values from the
# [defaults] section, if they are not specified in the project section:
@@ -241,6 +241,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"
+ pcfg_canonical_url="$(ini_config_get "$cfgfile" "prj_$prj" "canonical_url")"
# The following options all take default value from the "defaults"
# section, and hence "override" those settings. First we need to populate those.
diff --git a/email/aiaiai-email-test-patchset b/email/aiaiai-email-test-patchset
index c02b331..c5b5a3d 100755
--- a/email/aiaiai-email-test-patchset
+++ b/email/aiaiai-email-test-patchset
@@ -73,9 +73,17 @@ list_projects()
# Get project description
local descr
ini_config_get_or_die descr "$cfgfile" "prj_$prj" "description"
-
local email="$cfg_ownmail_local+$prj@$cfg_ownmail_domain"
- printf "* %s\n" "$prj ($email): $descr"
+
+ # If given a url, display a sample clone line in the project
+ url="$(ini_config_get "$cfgfile" "prj_$prj" "canonical_url")"
+ branch="$(ini_config_get "$cfgfile" "prj_$prj" "branch")"
+
+ if [ -n "$url" ]; then
+ printf "* %s\n" "$prj ($email) [git clone -b $branch $url]: $descr"
+ else
+ printf "* %s\n" "$prj ($email): $descr"
+ fi
done
}