chiark / gitweb /
Fix some bugs in dgit fetch --dry-run which made dgit push --dry-run often not work...
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 28 Aug 2013 22:36:54 +0000 (23:36 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 28 Aug 2013 22:36:54 +0000 (23:36 +0100)
debian/changelog
dgit
dgit.1

index 6d3d78343a7124448ff87063b7ea81b5d504e7ec..cbc2dd4e47e437f5c64ccd597e0e86f36d4354f0 100644 (file)
@@ -9,6 +9,8 @@ dgit (0.13) unstable; urgency=low
   * When uploading to Debian, tell dput to upload to "ftp-master".  This
     avoids problems with derivatives whose dput has a different default.
     Closes: #720958.
+  * Fix some bugs in dgit fetch --dry-run which made dgit push
+    --dry-run often not work at all.
 
  --
 
diff --git a/dgit b/dgit
index 35c02afc0bcce12867bec7688e7ee9d29abfb22d..0a599b0d2ff4278ba45109f1eae31f082382d15b 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -680,8 +680,7 @@ sub is_fast_fwd ($$) {
 }
 
 sub git_fetch_us () {
-    badusage "cannot dry run with fetch" if $dryrun;
-    runcmd @git, qw(fetch),access_giturl(),fetchspec();
+    runcmd_ordryrun @git, qw(fetch),access_giturl(),fetchspec();
 }
 
 sub fetch_from_archive () {
@@ -768,7 +767,7 @@ sub clone ($) {
     if (check_for_git()) {
        print "fetching existing git history\n";
        git_fetch_us();
-       runcmd @git, qw(fetch origin);
+       runcmd_ordryrun @git, qw(fetch origin);
     } else {
        print "starting new git history\n";
     }
diff --git a/dgit.1 b/dgit.1
index f97e458fb0b15fe75cffabd64bed9c7812fe46d7..86f19b491b5c7206daf19517016288fe0dfea759 100644 (file)
--- a/dgit.1
+++ b/dgit.1
@@ -565,5 +565,6 @@ sane way to find the path in the archive pool of the .dsc for a
 particular suite.  I'm assured that the archive layout is a
 `well known algorithm' by now.
 
---dry-run often does not work with fetch, even though this is a
-logically plausible request.  (It fails, instead.)
+--dry-run does not always work properly, as not doing some of the git
+fetches may result in subsequent actions being different.  Doing a
+non-dry-run dgit fetch first will help.