summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-07-18 14:19:47 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-07-19 15:29:01 +0100
commit236b11e106008dcf767ede43a5926d9b985f59e7 (patch)
treeae5ad3d1365e7dea12cebf313a95458ba7c2b8bd
parentea3d6683dcb55e588833e59af9f740709cd709b5 (diff)
Provide -wc aka --clean=check.
-rw-r--r--debian/changelog1
-rwxr-xr-xdgit11
-rw-r--r--dgit.14
3 files changed, 15 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 6e62f07..67086e0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ dgit (0.31~~) unstable; urgency=low
Useability improvements:
* Provide -wdd aka --clean=dpkg-source-d. Closes:#792433.
+ * Provide -wc aka --clean=check.
Infrastructure:
* Provide for mirroring git updates to a different server.
diff --git a/dgit b/dgit
index 47c55f3..1a2ee88 100755
--- a/dgit
+++ b/dgit
@@ -2639,6 +2639,12 @@ sub clean_tree () {
runcmd_ordryrun_local @git, qw(clean -xdf);
} elsif ($cleanmode eq 'git-ff') {
runcmd_ordryrun_local @git, qw(clean -xdff);
+ } elsif ($cleanmode eq 'check') {
+ my $leftovers = cmdoutput @git, qw(clean -xdn);
+ if (length $leftovers) {
+ print STDERR $leftovers, "\n" or die $!;
+ fail "tree contains uncommitted files and --clean=check specified";
+ }
} elsif ($cleanmode eq 'none') {
} else {
die "$cleanmode ?";
@@ -2878,7 +2884,7 @@ sub parseopts () {
} elsif (m/^--build-products-dir=(.*)/s) {
push @ropts, $_;
$buildproductsdir = $1;
- } elsif (m/^--clean=(dpkg-source(?:-d)?|git|git-ff|none)$/s) {
+ } elsif (m/^--clean=(dpkg-source(?:-d)?|git|git-ff|check|none)$/s) {
push @ropts, $_;
$cleanmode = $1;
} elsif (m/^--clean=(.*)$/s) {
@@ -2959,6 +2965,9 @@ sub parseopts () {
} elsif (s/^-wdd$//s) {
push @ropts, $&;
$cleanmode = 'dpkg-source-d';
+ } elsif (s/^-wc$//s) {
+ push @ropts, $&;
+ $cleanmode = 'check';
} else {
badusage "unknown short option \`$_'";
}
diff --git a/dgit.1 b/dgit.1
index 698bf2f..3e402e1 100644
--- a/dgit.1
+++ b/dgit.1
@@ -278,6 +278,10 @@ This is like
but it also removes any subdirectories containing different git
trees (which only unusual packages are likely to create).
.TP
+.BR --clean=check " | " -wn
+Merely check that the tree is clean (does not contain uncommitted
+files), before building a source package.
+.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