From: Ian Jackson Date: Sun, 26 Jul 2015 18:50:29 +0000 (+0100) Subject: Honour dgit-distros.DISTRO.cmd-CMD and .opts-CMD. Closes:#793427. X-Git-Tag: debian/1.1~33 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=964758788a7b4b145fd53971d8c91771749e8d95;ds=sidebyside Honour dgit-distros.DISTRO.cmd-CMD and .opts-CMD. Closes:#793427. --- diff --git a/debian/changelog b/debian/changelog index 7944b386..8067f398 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 4c6cc9c2..f9a67ce4 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 77d32520..2e862e3f 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