chiark / gitweb /
git-debrebase: Snag on repeated conversions
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Aug 2018 22:25:48 +0000 (23:25 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Aug 2018 22:43:08 +0000 (23:43 +0100)
If debrebase-last says we are ahead of some previous gdr work, it is
carrying on is unlikely to be helpful.  It would only be sensible if
the package is vacillating between branch formats, and this is
reflected and visible in the branch history.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
git-debrebase
tests/tests/gdr-import-dgitview

index 614a576c0032b70b1442481cbb307577746fac89..3ac55a0b693b2354e101fc8fe8b3e058ad46ee5f 100644 (file)
@@ -19,6 +19,8 @@ dgit (6.7~) unstable; urgency=medium
   * git-debrebase: convert-from-gbp: Improve messages.  Closes:#906641.
   * git-debrebase: Highly experimental merge resolution support,
     enabled only with special command line option.
   * git-debrebase: convert-from-gbp: Improve messages.  Closes:#906641.
   * git-debrebase: Highly experimental merge resolution support,
     enabled only with special command line option.
+  * git-debrebase: Check in convert-from-* whether ffq-prev or
+    debrebase-last indicate that we are already in gdr format.
 
  --
 
 
  --
 
index 059d02b546e8b33020ca7bdb48cacd7972d6e660..d80c8d35bb1875e509f658077eb3a1ed7cb7c69a 100755 (executable)
@@ -2416,6 +2416,9 @@ sub begin_convert_from () {
 
     fail "ffq-prev exists, this is already managed by git-debrebase!"
        if $ffq_prev && git_get_ref $ffq_prev;
 
     fail "ffq-prev exists, this is already managed by git-debrebase!"
        if $ffq_prev && git_get_ref $ffq_prev;
+    snag 'already-converted',
+       "ahead of debrebase-last, this is already managed by git-debrebase!"
+       if $gdrlast && git_get_ref $gdrlast && is_fast_fwd $gdrlast, $head;
     return ($head, undef);
 }
 
     return ($head, undef);
 }
 
index 3670deb373438da89afe1f0b7cd43b1c3cc48679..18d06f5658e26d263c534f55d16f3a036b25bb54 100755 (executable)
@@ -38,7 +38,8 @@ t-ref-head
 t-git-debrebase --noop-ok convert-from-dgit-view
 t-ref-head
 
 t-git-debrebase --noop-ok convert-from-dgit-view
 t-ref-head
 
-t-git-debrebase convert-from-dgit-view --always-convert-anyway
+t-git-debrebase -falready-converted convert-from-dgit-view \
+        --always-convert-anyway
 t-expect-fail E:'ref varies' t-ref-head
 t-gdr-good laundered
 
 t-expect-fail E:'ref varies' t-ref-head
 t-gdr-good laundered