diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-02-15 20:18:24 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-06-16 12:25:49 +0100 |
commit | 2b440473af773ab13334f8b79537c7a3153e4e4f (patch) | |
tree | 60ca45c36a474e9cd4b3defdd8fbf8dd2de82504 | |
parent | 0943c19e7dcccf0ac05fb266b232a9c36781264e (diff) |
git-debrebase: wip stitch
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-x | git-debrebase | 25 | ||||
-rwxr-xr-x | tests/tests/gdr-edits | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/git-debrebase b/git-debrebase index 19beef8..5fcec54 100755 --- a/git-debrebase +++ b/git-debrebase @@ -29,6 +29,7 @@ # git-debrebase [<options> --] [<git-rebase options...>] # git-debrebase [<options>] analyse # git-debrebase [<options>] launder # prints breakwater tip etc. +# git-debrebase [<options>] stitch [--prose=<for commit message>] # git-debrebase [<options>] downstream-rebase-launder-v0 # experimental # # git-debrebase [<options>] gbp2debrebase-v0 \ @@ -1136,6 +1137,30 @@ sub cmd_record_ffq_prev () { } } +sub cmd_stitch () { + my $prose = ''; + GetOptions('prose=s', \$prose) or die badusage("bad options to stitch"); + badusage "no arguments allowed" if @ARGV; + my ($status, $message, $current, $ffq_prev) = ffq_prev_branchinfo(); + if ($status ne 'branch') { + fproblem $status, "could not check ffq-prev: $message"; + fproblems_maybe_bail(); + } + my $prev = $ffq_prev && git_get_ref $ffq_prev; + if (!$prev) { + fail "No ffq-prev to stitch." unless $opt_noop_ok; + } + $prose = ", $prose" if length $prose; + runcmd @git, qw(merge -s ours --no-edit -m), <<END; +Declare fast forward / record previous work + +[git-debrebase pseudomerge: stitch$prose] +END + # xxx should delete old ffq-prev + # xxx should avoid making pseudomerge if not needed + # xxx should make pseudomerge in temp tree so can do atomic update +} + sub cmd_gbp2debrebase () { badusage "needs 1 optional argument, the upstream" unless @ARGV<=1; my ($upstream_spec) = @ARGV; diff --git a/tests/tests/gdr-edits b/tests/tests/gdr-edits index bab3a3d..8bfbfc6 100755 --- a/tests/tests/gdr-edits +++ b/tests/tests/gdr-edits @@ -30,4 +30,6 @@ t-git-debrebase git diff t.before -- ':.' ':!debian/patches' +t-git-debrebase stitch --prose=wombat + t-ok |