chiark / gitweb /
dgit: -wg / -wgf clean check is a no-op
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Oct 2018 12:29:01 +0000 (13:29 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Oct 2018 15:46:47 +0000 (16:46 +0100)
Document this, and handle it explicitly in the clean_tree_check
conditional and in the test suite.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit
dgit.1
tests/lib-build-modes

diff --git a/dgit b/dgit
index e88af4e6c41b779997e5fbe6f29c2d24af856bdf..52ae472b14d25e256ec8f635c8eae90a82ab8a38 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -6238,6 +6238,10 @@ 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.
     }
 }
 
diff --git a/dgit.1 b/dgit.1
index 5155dc04f798bf694d733059940611e9d0148e73..c3dd420bdfc6bd92cefcee407f1b256343e61559 100644 (file)
--- a/dgit.1
+++ b/dgit.1
@@ -538,7 +538,12 @@ This will delete all files which are not tracked by git.
 options other than dpkg-source
 are useful when the package's clean target is troublesome, or
 to avoid needing the build-dependencies.
-.TP
+
+dgit will only actually clean the tree if it needs to
+(because it needs to build the source package
+or binaries from your working tree).
+Otherwise any untracked files will be simply ignored.
+p.TP
 .BR --clean=git-ff " | " -wgf
 Use
 .BR "git clean -xdff"
index 837dde0c88e17fccfdd38f533693a842885cfff3..7d0d9fddcf14d18fd8ec52287c4fe1f48e17628c 100644 (file)
@@ -160,6 +160,7 @@ bm-compute-expected () {
                        ;;
        none)           ;;
        Cdpkg-source*)  ;; # handled below
+       Cgit|Cgit-ff)   ;;
        C*)             echo "TODO bm eff_cleanmode=$eff_cleanmode" ;;
        *)              fail "t-compute-expected-run $cleanmode ??" ;;
        esac