]> www.infradead.org Git - users/dedekind/aiaiai.git/commitdiff
email: add canonical_url variable for list_projects
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 27 Mar 2014 18:40:03 +0000 (11:40 -0700)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 31 Mar 2014 08:14:49 +0000 (11:14 +0300)
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>
doc/email/configuration.txt
doc/email/example-aiaiai.cfg
email/aiaiai-email-sh-functions
email/aiaiai-email-test-patchset

index 70a307f15797fe7487e8b9f9ce74c0abe1c029ea..9056e0c0fb74b7d539fa90986e236b3091b4b1a2 100644 (file)
@@ -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
 ~~~~~~~~~~~~~~~~
index 73014d8520f438b658e16af4b36adfe60ebe7e65..f9c7e0fbdc67205d8dad099eb773e8cfb366280e 100644 (file)
        # 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.
        #
index b80892151514ca3c79cddda3b6e370c99dbe527d..20e482603d7305501380c3daa0a9a8b84d7763ac 100644 (file)
@@ -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.
index c02b331387d080ec32bc56c7bf67477c088d9426..c5b5a3d78b596761c6a09ceafc55d58c753e911f 100755 (executable)
@@ -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
 }