From 8b875c05ff728c9335f692ccc21c5abfe2203d26 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 22 Apr 2018 22:28:49 +0100 Subject: [PATCH] git-debrebase: Provide and test "conclude" Signed-off-by: Ian Jackson --- git-debrebase | 13 +++++++++++++ git-debrebase.1.pod | 11 +++++++++++ tests/tests/gdr-subcommands | 4 ++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/git-debrebase b/git-debrebase index 00d2f575..636ff765 100755 --- a/git-debrebase +++ b/git-debrebase @@ -1325,6 +1325,19 @@ sub cmd_quick () { do_stitch 'quick'; } +sub cmd_conclude () { + my ($ffq_prev, $gdrlast, $ffq_prev_commitish) = ffq_prev_info(); + if (!$ffq_prev_commitish) { + fail "No ongoing git-debrebase session." unless $opt_noop_ok; + return; + } + my $dangling_head = get_head(); + + badusage "no arguments allowed" if @ARGV; + do_launder_head 'launder for git-debrebase quick'; + do_stitch 'quick'; +} + sub cmd_convert_from_gbp () { badusage "needs 1 optional argument, the upstream git rev" unless @ARGV<=1; diff --git a/git-debrebase.1.pod b/git-debrebase.1.pod index 68447b97..3e4c6984 100644 --- a/git-debrebase.1.pod +++ b/git-debrebase.1.pod @@ -55,6 +55,17 @@ The options for git-rebase must either start with C<-i>, or be prececded by C<-->, to distinguish them from options for git-debrebase. +=item git-debrebase conclude + +Finishes a git-debrebase session, +tidying up the branch and making it fast forward again. + +Specifically: if the branch is unstitched, +launders and restitches it, +making a new pseudomerge. +Otherwise, it is an error, +unless --noop-ok. + =item git-debrebase quick Unconditionally launders and restitches the branch, diff --git a/tests/tests/gdr-subcommands b/tests/tests/gdr-subcommands index 62321129..f6d817d8 100755 --- a/tests/tests/gdr-subcommands +++ b/tests/tests/gdr-subcommands @@ -148,7 +148,7 @@ make_check () { esac } -Ec="F:xxxdunno" +Ec="F:No ongoing git-debrebase session" # input state: # stitched? st'd st'd unst'd unst'd @@ -162,7 +162,7 @@ subcmd '' Ult Ull Vlt Vl subcmd stitch Ns Nu Sltf Stf #subcmd pre-push Ns Nu Sltf Stf subcmd quick ns Sl Sltf Sl -#subcmd conclude "$Ec" "$Ec" Sltf Sl +subcmd conclude "$Ec" "$Ec" Sltf Sl #subcmd make-patches sPft sPft uPft uPft #subcmd dgit-upload-hook Psft Psft SPft SPft # -- 2.30.2