summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-04-23 00:29:31 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-06-16 22:40:13 +0100
commit297ff51a0df2098ea9fe088e229bcd1318bfe466 (patch)
treef623af80f1dacfc47c3819f96cf6e3e865b6651c
parent9fe0302b9d3652f4423ab12a4db18145c6b7b13c (diff)
git-debrebase: Run gbp pq export only from (perhaps private) laundered branch
When the branch is stitched, gbp pq will descend into both sides of the pseudomerge. This will duplicate patches and be generally bad. So instead, use walk to generate, privately, a laundered version of HEAD, to use to generate the patches. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xgit-debrebase15
1 files changed, 9 insertions, 6 deletions
diff --git a/git-debrebase b/git-debrebase
index 52a06d3..7d5d5bd 100755
--- a/git-debrebase
+++ b/git-debrebase
@@ -1348,12 +1348,15 @@ sub cmd_conclude () {
do_stitch 'quick';
}
-sub make_patches_staged ($$) {
- my ($bw, $head) = @_;
+sub make_patches_staged ($) {
+ my ($head) = @_;
+ # Produces the patches that would result from $head if it were
+ # laundered.
+ my ($secret_head, $secret_bw, $last_anchor) = walk $head;
fresh_workarea();
in_workarea sub {
- runcmd @git, qw(checkout -q -b bw), $bw;
- runcmd @git, qw(checkout -q -b patch-queue/bw), $head;
+ runcmd @git, qw(checkout -q -b bw), $secret_bw;
+ runcmd @git, qw(checkout -q -b patch-queue/bw), $secret_head;
runcmd qw(gbp pq export);
runcmd @git, qw(add debian/patches);
};
@@ -1432,9 +1435,9 @@ sub cmd_convert_to_gbp () {
badusage "no arguments allowed" if @ARGV;
my $head = get_head();
my (undef, undef, undef, $ffq, $gdrlast) = ffq_prev_branchinfo();
- my ($anchor, $bw) = keycommits $head, 0;
+ keycommits $head, 0;
my $out;
- make_patches_staged $bw, $head;
+ make_patches_staged $head;
in_workarea sub {
$out = make_commit ['HEAD'], [
'Commit patch queue (converted from git-debrebase format)',