chiark / gitweb /
Split brain: Further improvements to split brain patch application
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 4 Jun 2016 15:45:06 +0000 (16:45 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Jul 2016 15:47:47 +0000 (16:47 +0100)
* Direct gbp-pq's stdout to /dev/null
* Specify GIT_COMMITER_* so that the results are reproducible
* Detect .gitignore problem

dgit

diff --git a/dgit b/dgit
index 29cf5076acd0942d746dda59249ef3c7469115c7..4edf9827fe181a3c00eedf895b021f3aa316329e 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2563,12 +2563,23 @@ sub quiltify_splitbrain ($$) {
        ($diffbits->{O2A} & 01) && # some patches
        !($diffbits->{H2O} & 01)) { # but HEAD is like orig
        quiltify_splitbrain_needed();
-       runcmd @gbppq, qw(import);
-       die "SPLIT BRAIN";
-    }
+       progress "creating patches-applied version using gbp-pq";
+       my @authline = clogp_authline($clogp);
+       local $ENV{GIT_COMMITTER_NAME} =  $authline[0];
+       local $ENV{GIT_COMMITTER_EMAIL} = $authline[1];
+       local $ENV{GIT_COMMITTER_DATE} =  $authline[2];
+       open STDOUT, ">/dev/null" or die $!;
+       runcmd shell_cmd 'exec >/dev/null', @gbppq, qw(import);
+    }
+    if (($diffbits->{H2O} & 02) && # user has modified .gitignore
+       !($diffbits->{O2A} & 02)) { # patches do not change .gitignore
+       quiltify_splitbrain_needed();
+       progress "creating patch to represent .gitignore changes";
     die 'xxx gitignore';
+       
+    }
     die 'xxx memoisation via git-reflog';
-    die 'xxx fast forward';
+    die 'xxx fast forward (should not depend on quilt mode, but will always be needed if we did $split_brain)';
 }
 
 sub quiltify ($$$$) {