chiark / gitweb /
dgit: Provide --program!:option
[dgit.git] / dgit
diff --git a/dgit b/dgit
index e88af4e6c41b779997e5fbe6f29c2d24af856bdf..a5f93145f8ebea94d948fad55cbef5da6e2e19d3 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -6222,7 +6222,7 @@ sub clean_tree_check_git_wd ($) {
                          (f_ <<END, $message);
 %s
 If this is just missing .gitignore entries, use a different clean
-mode, eg --clean=dpkg-source,no-check (-wdu/-wddu) to ignore them
+mode, eg --clean=dpkg-source,no-check (-wdn/-wddn) to ignore them
 or --clean=git (-wg/-wgf) to use \`git clean' instead.
 END
 }
@@ -6238,6 +6238,13 @@ sub clean_tree_check () {
     } elsif ($cleanmode =~ m{^dpkg-source}) {
        clean_tree_check_git_wd __
  "tree contains uncommitted files (NB dgit didn't run rules clean)";
+    } elsif ($cleanmode =~ m{^git}) {
+       # If we were actually cleaning these files would be summarily
+       # deleted.  Since we're not, and not using the working tree
+       # anyway, we can just ignore them - nothing will use them.
+    } elsif ($cleanmode eq 'none') {
+    } else {
+       confess "$cleanmode ?";
     }
 }
 
@@ -6260,7 +6267,7 @@ sub clean_tree () {
        clean_tree_check();
     } elsif ($cleanmode eq 'none') {
     } else {
-       die "$cleanmode ?";
+       confess "$cleanmode ?";
     }
 }
 
@@ -7185,6 +7192,12 @@ sub parseopts () {
                     ($om = $opts_opt_map{$1})) {
                push @ropts, $_;
                push @$om, $2;
+           } elsif (m/^--([-0-9a-z]+)\!:(.*)/s &&
+                    !$opts_opt_cmdonly{$1} &&
+                    ($om = $opts_opt_map{$1})) {
+               push @ropts, $_;
+               my $cmd = shift @$om;
+               @$om = ($cmd, grep { $_ ne $2 } @$om);
            } elsif (m/^--(gbp|dpm)$/s) {
                push @ropts, "--quilt=$1";
                $quilt_mode = $1;