chiark / gitweb /
dgit: split brain reorg: Always _needed in split brain quilt modss
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 20 May 2019 20:43:41 +0000 (21:43 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 28 Jun 2019 11:45:38 +0000 (12:45 +0100)
The only differences are:

1. Call quiltify_splitbrain_needed earlier.  This is of no
consequence.

2. Call it even dpm mode when .gitignore was not edited.  This is
actually somewhat more correct.  In dpm mode we are very likely later
going to need split brain to keep the pseudomerge of the dgit view
off the maintainer branch.

And in fact that is what will happen because dopush fetches the quilt
view from the cache and that sets $split_brain unconditionally.  With
the current code structure dgit's quilt fixup imagines that it can do
a quilt fixup for dpm mode without split brain, when the .gitignore is
not edited.  But actually what is happening is that this is an empty
tree fixup, and the history inclusion *will* be done split brain, but
later.

So overall this change will have no actual overall effect.  But it is
a move towards helping untangle the quilt mode from split brain.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index 3662282d9bf7ea33c7bb025e3b20da3528de5c50..99bd51a5e73bda417b13066158d838e85fbe291d 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -5400,6 +5400,8 @@ sub quiltify_splitbrain ($$$$$$$) {
     local $ENV{GIT_AUTHOR_EMAIL} = $authline[1];
     local $ENV{GIT_AUTHOR_DATE} =  $authline[2];
 
+    quiltify_splitbrain_needed();
+
     my $fulldiffhint = sub {
        my ($x,$y) = @_;
        my $cmd = "git diff $x $y -- :/ ':!debian'";
@@ -5430,7 +5432,6 @@ END
     }
     if ($quilt_mode =~ m/gbp|unapplied/ &&
        ($diffbits->{O2A} & 01)) { # some patches
-       quiltify_splitbrain_needed();
        progress __ "dgit view: creating patches-applied version using gbp pq";
        runcmd shell_cmd 'exec >/dev/null', gbp_pq, qw(import);
        # gbp pq import creates a fresh branch; push back to dgit-view
@@ -5447,7 +5448,6 @@ END
     }
     if (($diffbits->{O2H} & 02) && # user has modified .gitignore
        !($diffbits->{O2A} & 02)) { # patches do not change .gitignore
-       quiltify_splitbrain_needed();
        progress __
            "dgit view: creating patch to represent .gitignore changes";
         ensuredir "debian/patches";