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 fd3f102ffa98b556c0c46197cb39300d6b4eb7a9..787cd2caef26a681ee3840785c7cdd96a791a361 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 98e645a43a9255b81a7821a671b406239c922f90..62fbf6156c06e644fffdf17be99f4f0e7e9ea9a7 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 e544a8c012fdc10ab0c5d8629a972d4a9e8b4119..28f3084816064107440ab23f938091d4079269c1 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