Merge branch 'js/rebase-i-break'
authorJunio C Hamano <gitster@pobox.com>
Fri, 2 Nov 2018 02:04:58 +0000 (11:04 +0900)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Nov 2018 02:04:58 +0000 (11:04 +0900)
"git rebase -i" learned a new insn, 'break', that the user can
insert in the to-do list. Upon hitting it, the command returns
control back to the user.

* js/rebase-i-break:
rebase -i: introduce the 'break' command
rebase -i: clarify what happens on a failed `exec`

1  2 
Documentation/git-rebase.txt
sequencer.c
t/lib-rebase.sh
t/t3418-rebase-continue.sh
Simple merge
diff --cc sequencer.c
index 22d7532c5a3d777ee63951e55d18ff729b3212eb,ee3961ec63a0b34c29a1b253bb2106c56f57c79e..73efa92da837c895980ce2d101c190218b6a7204
@@@ -3393,6 -3249,23 +3395,24 @@@ static int checkout_onto(struct replay_
        return update_ref(NULL, "ORIG_HEAD", &oid, NULL, 0, UPDATE_REFS_MSG_ON_ERR);
  }
  
 -      if (get_oid("HEAD", &head) || !(commit = lookup_commit(&head)) ||
+ static int stopped_at_head(void)
+ {
+       struct object_id head;
+       struct commit *commit;
+       struct commit_message message;
++      if (get_oid("HEAD", &head) ||
++          !(commit = lookup_commit(the_repository, &head)) ||
+           parse_commit(commit) || get_message(commit, &message))
+               fprintf(stderr, _("Stopped at HEAD\n"));
+       else {
+               fprintf(stderr, _("Stopped at %s\n"), message.label);
+               free_message(commit, &message);
+       }
+       return 0;
+ }
  static const char rescheduled_advice[] =
  N_("Could not execute the todo command\n"
  "\n"
diff --cc t/lib-rebase.sh
index 2ca9fb69d62083494869fff6420eec39834b2eb4,584604ee63bd193795daa0f9ca4ad62d9a84b197..241f64b09b3773f5a6b35992a40097a298093771
@@@ -47,9 -47,9 +47,9 @@@ set_fake_editor () 
        action=pick
        for line in $FAKE_LINES; do
                case $line in
 -              squash|fixup|edit|reword|drop)
 +              pick|squash|fixup|edit|reword|drop)
                        action="$line";;
-               exec*)
+               exec*|break)
                        echo "$line" | sed 's/_/ /g' >> "$1";;
                "#")
                        echo '# comment' >> "$1";;
Simple merge