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
@@@ -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
@@@ -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