From b58f7c61452fc5b8b7d70f735283ecdc1b5e8ac3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 4 Aug 2018 13:40:15 +0100 Subject: [PATCH] git-debrebase: New feature `scrap' Signed-off-by: Ian Jackson --- debian/changelog | 1 + git-debrebase | 12 ++++++++++++ git-debrebase.1.pod | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/debian/changelog b/debian/changelog index fd3f102f..787cd2ca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ dgit (6.5~) unstable; urgency=medium * test suite: gdr-import-dgitview: New test for dgit dsc imports. * git-debrebase: Provide new convert-from-dgit-view operation. The output is, unavoidably, not very pretty. Closes:#905322. + * git-debrebase: New feature `scrap'. Closes:#905063. -- diff --git a/git-debrebase b/git-debrebase index 98e645a4..62fbf615 100755 --- a/git-debrebase +++ b/git-debrebase @@ -1577,6 +1577,18 @@ sub cmd_conclude () { do_stitch 'quick'; } +sub cmd_scrap () { + my ($ffq_prev, $gdrlast, $ffq_prev_commitish) = ffq_prev_info(); + fail "No ongoing git-debrebase session." unless $ffq_prev_commitish; + my $scrapping_head = get_head(); + badusage "no arguments allowed" if @ARGV; + push @deferred_updates, + "update $gdrlast $ffq_prev_commitish $git_null_obj", + "update $ffq_prev $git_null_obj $ffq_prev_commitish"; + snags_maybe_bail(); + update_head_checkout $scrapping_head, $ffq_prev_commitish, "scrap"; +} + sub make_patches_staged ($) { my ($head) = @_; # Produces the patches that would result from $head if it were diff --git a/git-debrebase.1.pod b/git-debrebase.1.pod index e544a8c0..28f30848 100644 --- a/git-debrebase.1.pod +++ b/git-debrebase.1.pod @@ -106,6 +106,11 @@ If there is no ffq-prev, it is an error, unless --noop-ok. You should consider using B instead, because that launders the branch too. +=item git-debrebase scrap + +Throws away all the work since the branch was last stitched. +This is done by rewinding you to ffq-prev. + =item git-debrebase new-upstream [...] Rebases the delta queue -- 2.30.2