chiark / gitweb /
dgit: Honour new .clean-mode-newer access config option
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Oct 2018 09:55:36 +0000 (10:55 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Oct 2018 09:55:36 +0000 (10:55 +0100)
This will allow us to extend the set of clean modes without causing
irresolvable compatibility problems for users.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit
dgit.1

diff --git a/dgit b/dgit
index de14c1ef0478eade067b3c5c4797629dbcf63d0a..8c7f288a75597f8086d02ecb25a3be1a43416226 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -7355,7 +7355,10 @@ sub parseopts_late_defaults () {
 
     if (!defined $cleanmode) {
        local $access_forpush;
-       $cleanmode = access_cfg('clean-mode', 'RETURN-UNDEF');
+       $cleanmode = access_cfg('clean-mode-newer', 'RETURN-UNDEF');
+       $cleanmode = undef if $cleanmode && $cleanmode !~ m/^$cleanmode_re$/;
+
+       $cleanmode //= access_cfg('clean-mode', 'RETURN-UNDEF');
        $cleanmode //= 'dpkg-source';
 
        badcfg f_ "unknown clean-mode \`%s'", $cleanmode unless
diff --git a/dgit.1 b/dgit.1
index d34231fd8d2bd94f70d23e708f1375c3f903d932..ccf1ea597e111bb447ca86795992ae67f7883001 100644 (file)
--- a/dgit.1
+++ b/dgit.1
@@ -1219,7 +1219,13 @@ the default value used if there is no distro-specific setting.
 One of the values for the command line --clean= option; used if
 --clean is not specified.
 .TP
-.BR dgit-distro. \fIdistro\fR .quilt-mode
+.BR dgit-distro. \fIdistro\fR .clean-mode-newer
+Like .clean-mode,
+but ignored if the value does not make sense to this version of dgit.
+Setting both .clean-mode and .clean-mode-newer is useful
+to provide a single git config compatible with different dgit versions.
+.TP
+.BR dgit-distro. \fIdistro\fR .quilt-
 One of the values for the command line --quilt= option; used if
 --quilt is not specified.
 .TP