summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2012-02-05 14:37:38 -0500
committerOwen W. Taylor <otaylor@fishsoup.net>2012-02-05 14:40:22 -0500
commite105b5271909824ba79bf31b6ec6e9600bff1c54 (patch)
treef77873a9b4c8ca11cf52cbb045a63a892e11b718
parent191d9b2356fea1bb7b610056bdc3076c4f8a61d2 (diff)
downloadgit-bz-e105b5271909824ba79bf31b6ec6e9600bff1c54.tar.gz
Allow setting bz.default-<field name>
If you want to override something like the default version on a per-component basis, having to set that in the per-tracker configuration is unnatural and confusing. Allow setting bz.default-version instead. This is interpreted as overriding the existing configuration of default field values. Based on a patch from Dan Winship <danw@gnome.org> https://bugzilla.gnome.org/show_bug.cgi?id=651756
-rwxr-xr-xgit-bz11
-rw-r--r--git-bz.txt36
2 files changed, 40 insertions, 7 deletions
diff --git a/git-bz b/git-bz
index a3cb516..bff32a2 100755
--- a/git-bz
+++ b/git-bz
@@ -367,6 +367,17 @@ def get_default_fields(tracker):
param = key[8:].replace("-", "_")
default_fields[param] = value
+ # bz.default-* options specified in 'git config' have higher precedence
+ # than per-tracker options. We expect them to be set locally by the
+ # user for a particular git repository.
+
+ for key, value in git_config.iteritems():
+ if key.startswith("default-"):
+ param = key[8:].replace("-", "_")
+ if param in ['tracker', 'product', 'component']:
+ continue
+ default_fields[param] = value
+
return default_fields
# Utility functions for bugzilla
diff --git a/git-bz.txt b/git-bz.txt
index 8576ff8..bb78c42 100644
--- a/git-bz.txt
+++ b/git-bz.txt
@@ -346,15 +346,37 @@ git config bz.default-component general
Note the absence of --global; configuring a default product and component
globally is seldom useful.
+[[default-field-values]]
+DEFAULT FIELD VALUES
+--------------------
+When filing a bug, git-bz needs to know the default values to use for
+the fields +version+, +op-sys+, +platform+, +assigned-to+ and
++priority+. git-bz has built-in global defaults and specific defaults
+for particular common bug trackers, but if you are using a bug tracker
+that it doesn't know about, you may need to configure appropriate
+field values. Valid values for +priority+ are especially likely to vary
+between different Bugzilla instances.
+
+Also, for +version+, each product has it's own list of versions, and if
+the product owner has deleted the +unspecified+ version that git-bz
+uses as a default, you'll have to set that.
+
+The first place that git-bz checks for default field values is in the
+bugzilla config variable +bz.default-<field-name>+. So, to change the
+default value of version for the current repository, do:
+
+----------------------------------------
+git config bz.default-version 1.0
+----------------------------------------
+
+If no value is set there, then it looks for +default-<field-name>+ in
+the per-tracker configuration. See <<per-tracker-configuration, below>>.
+
+[[per-tracker-configuration]]
PER-TRACKER CONFIGURATION
-------------------------
-git-bz needs some configuration specific to the bugzilla instance (tracker),
-in particular it needs to know initial field values to use when submitting
-bugs; legal values for some fields depend on the instance. Initial field
-values are specified by the config variable +default-<field-name>+.
-
-In addition to initial field values, some other variables can be configured
-per tracker:
+In addition to <<default-field-values, default field values>>, some
+other variables can be configured per tracker:
auth-user:: the user to use for basic HTTP authentication. Since
basic auth sends passwords in clear text, you should not use this unless