chiark / gitweb /
git-debrebase: Provide "prepush"
[dgit.git] / git-debrebase
index fcca5b1ad6b0cb4bb4ee893bf7b61b8216a79bbe..46ea06af925394634e08eab9a16af02e215709fa 100755 (executable)
@@ -396,6 +396,15 @@ sub classify ($) {
        # BreakwaterStart commits are also anchors in the terminology
        # of git-debrebase(5), but they are untagged (and always
        # manually generated).
+       #
+       # We cannot not tolerate any tagged linear commit (ie,
+       # BreakwaterStart commits tagged `[anchor:') because such a
+       # thing could result from an erroneous linearising raw git
+       # rebase of a merge anchor.  That would represent a corruption
+       # of the branch. and we want to detect and reject the results
+       # of such corruption before it makes it out anywhere.  If we
+       # reject it here then we avoid making the pseudomerge which
+       # would be needed to push it.
 
        my $badanchor = sub { $unknown->("git-debrebase \`anchor' but @_"); };
        @p == 2 or return $badanchor->("has other than two parents");
@@ -1309,11 +1318,25 @@ sub cmd_stitch () {
     badusage "no arguments allowed" if @ARGV;
     do_stitch($prose);
 }
+sub cmd_prepush () { cmd_stitch(); }
+
+sub cmd_quick () {
+    badusage "no arguments allowed" if @ARGV;
+    do_launder_head 'launder for git-debrebase 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 conclude';
-    do_stitch 'conclude';
+    do_launder_head 'launder for git-debrebase quick';
+    do_stitch 'quick';
 }
 
 sub cmd_convert_from_gbp () {