summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-07-26 19:50:29 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-07-26 19:55:59 +0100
commit964758788a7b4b145fd53971d8c91771749e8d95 (patch)
tree01968c26e922113db24cfab406ca1251c17ebba4
parentf4e23593ad4e04711ec34d5b1d70f3a0508f2b66 (diff)
Honour dgit-distros.DISTRO.cmd-CMD and .opts-CMD. Closes:#793427.
-rw-r--r--debian/changelog1
-rwxr-xr-xdgit26
-rw-r--r--dgit.117
3 files changed, 44 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 7944b38..8067f39 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -38,6 +38,7 @@ dgit (1.1~~) unstable; urgency=low
* Test suite: Honour DGIT_TEST_DEBUG=''.
* Print a supplementary message when push fails, giving advice to
the user about how to retry. Closes:#793144.
+ * Honour dgit-distros.DISTRO.cmd-CMD and .opts-CMD. Closes:#793427.
--
diff --git a/dgit b/dgit
index 4c6cc9c..f9a67ce 100755
--- a/dgit
+++ b/dgit
@@ -3164,6 +3164,32 @@ sub parseopts () {
}
sub finalise_opts_opts () {
+ foreach my $k (keys %opts_opt_map) {
+ my $om = $opts_opt_map{$k};
+
+ my $v = access_cfg("cmd-$k", 'RETURN-UNDEF');
+ if (defined $v) {
+ badcfg "cannot set command for $k"
+ unless length $om->[0];
+ $om->[0] = $v;
+ }
+
+ foreach my $c (access_cfg_cfgs("opts-$k")) {
+ local ($debuglevel) = $debuglevel-2;
+ my @cmd = (@git, qw(config -z --get-all), $c);
+ my $vs = cmdoutput_errok @cmd;
+ if ($?==0) {
+ badcfg "cannot configure options for $k"
+ if $opts_opt_cmdonly{$k};
+ push @$om, split /\0/, $vs;
+ } elsif ($?==256) {
+ die "$k $c ?" if length $vs;
+ } else {
+ failedcmd @cmd;
+ }
+ }
+ }
+
foreach my $k (keys %opts_opt_cmdline_opts) {
push @{ $opts_opt_map{$k} }, @{ $opts_opt_cmdline_opts{$k} };
}
diff --git a/dgit.1 b/dgit.1
index 77d3252..2e862e3 100644
--- a/dgit.1
+++ b/dgit.1
@@ -633,6 +633,23 @@ Not relevant for Debian.
.TP
.BI dgit-distro. distro .upload-host
Might be useful if you have an intermediate queue server.
+.TP
+.BI dgit-distro. distro .cmd- cmd
+Program to use instead of
+.IR cmd .
+Works like
+.BR -- \fIcmd\fR = "... ."
+.TP
+.BI dgit-distro. distro .opts- cmd
+Extra options to pass to
+.IR cmd .
+Works like
+.BR -- \fIcmd\fR : "... ."
+To pass several options, configure multiple values in git config
+(with git config --add). The options for
+.BI dgit.default.opts- cmd
+.BI dgit-distro. distro /push.opts- cmd
+and are all used, followed by options from dgit's command line.
.SH ACCESS CONFIGURATION
There are many other settings which specify how a particular distro's
services (archive and git) are provided. These should not normally be