From 1658b0b4e5712658f3ee73863fe2b609fbdb650a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 5 Jul 2015 01:34:08 +0100 Subject: [PATCH] Provide --clean=git-ff (aka -wgf), which is useful for dgit itself (!) --- debian/changelog | 2 ++ dgit | 7 ++++++- dgit.1 | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 63fb0deb..d3cf4bcf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 066f2a6c..079e5dec 100755 --- 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 0f3f9c7b..1c87e9a1 100644 --- 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 -- 2.30.2