From: Ian Jackson Date: Sat, 17 Feb 2018 12:21:09 +0000 (+0000) Subject: git-debrebase: convert-to-gbp: implementation seems to work X-Git-Tag: archive/debian/5.0~184 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=615c5264953f09dc873ac65779ec565f1d239af6 git-debrebase: convert-to-gbp: implementation seems to work Signed-off-by: Ian Jackson --- diff --git a/git-debrebase b/git-debrebase index 1a62852e..c497631c 100755 --- a/git-debrebase +++ b/git-debrebase @@ -1277,6 +1277,37 @@ sub cmd_convert_from_gbp () { update_head_checkout $old_head, $work, 'convert-from-gbp'; } +sub cmd_convert_to_gbp_v0 () { + # v0 because very raw; does not make pseudomerges or anything + badusage "no arguments allowed" if @ARGV; + my $head = get_head(); + my $ffq = (ffq_prev_branchinfo())[3]; + my $bw = breakwater_of $head; + fresh_workarea(); + my $out; + in_workarea sub { + runcmd @git, qw(checkout -q -b bw), $bw; + runcmd @git, qw(checkout -q -b patch-queue/bw), $head; + runcmd qw(gbp pq export); + runcmd @git, qw(add debian/patches); + $out = make_commit ['HEAD'], [ + 'Commit patch queue (converted from git-debrebase format)', + '[git-debrebase convert-to-gbp: commit patches]', + ]; + }; + if (defined $ffq) { + runcmd @git, qw(update-ref -m), + "debrebase: converting corresponding main branch to gbp format", + $ffq, $git_null_obj; + } + update_head_checkout $head, $out, "convert to gbp (v0)"; + print <