chiark / gitweb /
Honour dgit-distros.DISTRO.cmd-CMD and .opts-CMD. Closes:#793427.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jul 2015 18:50:29 +0000 (19:50 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jul 2015 18:55:59 +0000 (19:55 +0100)
debian/changelog
dgit
dgit.1

index 7944b386cd43554d2b640f5c1e70253ddfd599c4..8067f39819e6ce33041856670a0113a922a4be48 100644 (file)
@@ -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 4c6cc9c29124f9a145ad9b63a540cad68beca0ed..f9a67ce4ff7939a9c00e0b05e49a2e0c6dd4c26f 100755 (executable)
--- 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 77d325204d61b1397e4c7fd0c3ff09c1f6b621a3..2e862e3fdb8e73b5b27be9291eeac4c795e7bdae 100644 (file)
--- 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