chiark / gitweb /
git-debrebase: Add some plans for future, in a comment
[dgit.git] / git-debrebase
index 111bb1f7b8dd0c1ae768d5eb0bfc8c9e56914191..769b9b943644b91e0ca9893602c6da66aeff059c 100755 (executable)
@@ -973,19 +973,8 @@ sub cmd_analyse () {
 }
 
 sub ffq_prev_branchinfo () {
-    # => ('status', "message", [$current, $ffq_prev, $gdrlast])
-    # 'status' may be
-    #    branch         message is undef
-    #    weird-symref   } no $current,
-    #    notbranch      }  no $ffq_prev
     my $current = git_get_symref();
-    return ('detached', 'detached HEAD') unless defined $current;
-    return ('weird-symref', 'HEAD symref is not to refs/')
-       unless $current =~ m{^refs/};
-    my $ffq_prev = "refs/$ffq_refprefix/$'";
-    my $gdrlast = "refs/$gdrlast_refprefix/$'";
-    printdebug "ffq_prev_branchinfo branch current $current\n";
-    return ('branch', undef, $current, $ffq_prev, $gdrlast);
+    return gdr_ffq_prev_branchinfo($current);
 }
 
 sub record_ffq_prev_deferred () {
@@ -1372,6 +1361,10 @@ sub cmd_breakwater () {
 sub cmd_status () {
     badusage "no arguments allowed" if @ARGV;
 
+    # todo: gdr status should print divergence info
+    # todo: gdr status should print upstream component(s) info
+    # todo: gdr should leave/maintain some refs with this kind of info ?
+
     my $oldest = [ 0 ];
     my $newest;
     my $note = sub {
@@ -1505,6 +1498,9 @@ sub make_patches ($) {
 }
 
 sub cmd_make_patches () {
+    my $opt_quiet_would_amend;
+    GetOptions('quiet-would-amend!', \$opt_quiet_would_amend)
+       or die badusage("bad options to make-patches");
     badusage "no arguments allowed" if @ARGV;
     my $old_head = get_head();
     my $new = make_patches $old_head;
@@ -1519,7 +1515,8 @@ sub cmd_make_patches () {
        print STDERR failmsg
            "Patch export produced patch amendments".
            " (abandoned output commit $new).".
-           "  Try laundering first.";
+           "  Try laundering first."
+           unless $opt_quiet_would_amend;
        finish 7;
     }
 }