chiark / gitweb /
git-debrebase: New feature `scrap'
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 4 Aug 2018 12:40:15 +0000 (13:40 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 4 Aug 2018 12:41:32 +0000 (13:41 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
git-debrebase
git-debrebase.1.pod

index fd3f102..787cd2c 100644 (file)
@@ -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.
 
  --
 
index 98e645a..62fbf61 100755 (executable)
@@ -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
index e544a8c..28f3084 100644 (file)
@@ -106,6 +106,11 @@ If there is no ffq-prev, it is an error, unless --noop-ok.
 You should consider using B<conclude> 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 <new-version> [<upstream-details>...]
 
 Rebases the delta queue