chiark / gitweb /
Provide --clean=git-ff (aka -wgf), which is useful for dgit itself (!)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 5 Jul 2015 00:34:08 +0000 (01:34 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 5 Jul 2015 00:34:37 +0000 (01:34 +0100)
debian/changelog
dgit
dgit.1

index 63fb0debadecbdcb3034fc43846694fe34ebf164..d3cf4bcf241bd87c0d7de13198541214351a6434 100644 (file)
@@ -36,6 +36,8 @@ dgit (0.30) unstable; urgency=high
     dpkg-buildpackage, suppressing calls to the package's clean target.
     Also, expand the documentation in this area slightly.  Closes:#768590.
 
+  * Provide --clean=git-ff (aka -wgf), which is useful for dgit itself (!)
+
   Minor improvements:
 
   * Reduce some noise output and improve the clarity of some messages.
diff --git a/dgit b/dgit
index 066f2a6c63fd0ef7ffb29ee968c083bdca8b86dd..079e5dec7c212c0c4ea1be9ecb76f4891af75cfb 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2635,6 +2635,8 @@ sub clean_tree () {
        runcmd_ordryrun_local @dpkgbuildpackage, qw(-T clean);
     } elsif ($cleanmode eq 'git') {
        runcmd_ordryrun_local @git, qw(clean -xdf);
+    } elsif ($cleanmode eq 'git-ff') {
+       runcmd_ordryrun_local @git, qw(clean -xdff);
     } elsif ($cleanmode eq 'none') {
     } else {
        die "$cleanmode ?";
@@ -2871,7 +2873,7 @@ sub parseopts () {
            } elsif (m/^--build-products-dir=(.*)/s) {
                push @ropts, $_;
                $buildproductsdir = $1;
-           } elsif (m/^--clean=(dpkg-source|git|none)$/s) {
+           } elsif (m/^--clean=(dpkg-source|git|git-ff|none)$/s) {
                push @ropts, $_;
                $cleanmode = $1;
            } elsif (m/^--clean=(.*)$/s) {
@@ -2943,6 +2945,9 @@ sub parseopts () {
                } elsif (s/^-wg$//s) {
                    push @ropts, $&;
                    $cleanmode = 'git';
+               } elsif (s/^-wgf$//s) {
+                   push @ropts, $&;
+                   $cleanmode = 'git-ff';
                } elsif (s/^-wd$//s) {
                    push @ropts, $&;
                    $cleanmode = 'dpkg-source';
diff --git a/dgit.1 b/dgit.1
index 0f3f9c7b9e226389cff69261582b0bef2fdb38bf..1c87e9a1f089cb2593f4a910745e58d466594a73 100644 (file)
--- a/dgit.1
+++ b/dgit.1
@@ -269,6 +269,15 @@ from being run.
 the downside is simply that git clean may delete files you forgot to
 git add.
 .TP
+.BR --clean=git-ff " | " -wgf
+The source tree should be cleaned, before building a source package
+with one of the build options, using
+.BR "git clean -xdff" .
+This is like
+"git clean -xdf"
+but it also removes any subdirectories containing different git
+trees (which only unusual packages are likely to create).
+.TP
 .BR --clean=none " | " -wn
 Do not clean the tree before building a source package.  If there are
 files which are not in git, or if the build creates such files, a