summaryrefslogtreecommitdiff
path: root/git-debrebase
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-02-10 14:15:09 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-06-16 12:25:49 +0100
commit850b9cacb62d6009cb503cbec266174fe92a90a7 (patch)
tree66f1b5dafd42b01d42731c54b29c9542068382db /git-debrebase
parentaebf260fa5e34808157bf42f1dd70d3ce85c11aa (diff)
git-debrebase: bugfixes
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'git-debrebase')
-rwxr-xr-xgit-debrebase37
1 files changed, 31 insertions, 6 deletions
diff --git a/git-debrebase b/git-debrebase
index 50f5e16..88118aa 100755
--- a/git-debrebase
+++ b/git-debrebase
@@ -162,7 +162,7 @@ sub get_differs ($$) {
my @cmd = (@git, qw(diff-tree -z --no-renames));
push @cmd, @$opts;
push @cmd, "$_:" foreach $x, $y;
- push @cmd, @$limits;
+ push @cmd, '--', @$limits;
my $diffs = cmdoutput @cmd;
foreach (split /\0/, $diffs) { $fn->(); }
};
@@ -770,9 +770,8 @@ sub update_head ($$$) {
sub update_head_checkout ($$$) {
my ($old, $new, $mrest) = @_;
- my $symref = git_get_symref();
- runcmd @git, qw(checkout), $new, qw(.);
update_head $old, $new, $mrest;
+ runcmd @git, qw(reset --hard);
}
sub update_head_postlaunder ($$$) {
@@ -1020,13 +1019,39 @@ sub cmd_gbp2debrebase () {
if ((git_cat_file "$upstream:debian")[0] ne 'missing') {
fproblem "upstream ($upstream) contains debian/ directory";
}
- die;
+
+ fproblems_maybe_bail();
+
+ my $work;
fresh_workarea();
in_workarea sub {
- runcmd @git, qw(checkout -b work), $old_head;
-
+ runcmd @git, qw(checkout -q -b gdr-internal), $old_head;
+ # make a branch out of the patch queue - we'll want this in a mo
+ runcmd qw(gbp pq import);
+ # strip the patches out
+ runcmd @git, qw(checkout -q gdr-internal~0);
+ rm_subdir_cached 'debian/patches';
+ $work = make_commit ['HEAD'], [
+ 'git-debrebase import: drop patch queue',
+ 'Delete debian/patches, as part of converting to git-debrebase format.',
+ '[git-debrebase gbp2debrebase drop-patches]'
+ ];
+ # make the breakwater pseudomerge
+ # the tree is already exactly right
+ $work = make_commit [$work, $upstream], [
+ 'git-debrebase import: declare upstream',
+ 'First breakwater merge.',
+ '[git-debrebase declare-upstream breakwater]'
+ ];
+
+ # rebase the patch queue onto the new breakwater
+ runcmd @git, qw(reset --quiet --hard patch-queue/gdr-internal);
+ runcmd @git, qw(rebase --quiet --onto), $work, qw(gdr-internal);
+ $work = get_head();
};
+
+ update_head_checkout $old_head, $work, 'gbp2debrebase';
}
sub cmd_downstream_rebase_launder_v0 () {