From e105b5271909824ba79bf31b6ec6e9600bff1c54 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sun, 5 Feb 2012 14:37:38 -0500 Subject: Allow setting bz.default- 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 https://bugzilla.gnome.org/show_bug.cgi?id=651756 --- git-bz | 11 +++++++++++ git-bz.txt | 36 +++++++++++++++++++++++++++++------- 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-+. 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-+ in +the per-tracker configuration. See <>. + +[[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-+. - -In addition to initial field values, some other variables can be configured -per tracker: +In addition to <>, 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 -- cgit v1.2.3