From: Junio C Hamano Date: Fri, 2 Nov 2018 02:04:58 +0000 (+0900) Subject: Merge branch 'js/rebase-i-break' X-Git-Tag: v2.20.0-rc0~84 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=789b1f70422d5c9ffb3a0ecb11284aa0ac13985e;p=git Merge branch 'js/rebase-i-break' "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` --- 789b1f70422d5c9ffb3a0ecb11284aa0ac13985e diff --cc sequencer.c index 22d7532c5a,ee3961ec63..73efa92da8 --- a/sequencer.c +++ b/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); } + 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(&head)) || ++ 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 2ca9fb69d6,584604ee63..241f64b09b --- a/t/lib-rebase.sh +++ b/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";;