Skip to content

Commit b4f0038

Browse files
committed
Merge branch 'en/rebase-backend'
Band-aid fixes for two fallouts from switching the default "rebase" backend. * en/rebase-backend: git-rebase.txt: highlight backend differences with commit rewording sequencer: clear state upon dropping a become-empty commit i18n: unmark a message in rebase.c
2 parents a56d361 + 120b1eb commit b4f0038

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

Documentation/git-rebase.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,16 @@ suffer from the same shortcoming. (See
699699
https://lore.kernel.org/git/[email protected]/ for
700700
details.)
701701

702+
Commit Rewording
703+
~~~~~~~~~~~~~~~~
704+
705+
When a conflict occurs while rebasing, rebase stops and asks the user
706+
to resolve. Since the user may need to make notable changes while
707+
resolving conflicts, after conflicts are resolved and the user has run
708+
`git rebase --continue`, the rebase should open an editor and ask the
709+
user to update the commit message. The merge backend does this, while
710+
the apply backend blindly applies the original commit message.
711+
702712
Miscellaneous differences
703713
~~~~~~~~~~~~~~~~~~~~~~~~~
704714

builtin/rebase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
15431543
"ignoring them"),
15441544
REBASE_PRESERVE_MERGES, PARSE_OPT_HIDDEN),
15451545
OPT_RERERE_AUTOUPDATE(&options.allow_rerere_autoupdate),
1546-
OPT_CALLBACK_F(0, "empty", &options, N_("{drop,keep,ask}"),
1546+
OPT_CALLBACK_F(0, "empty", &options, "{drop,keep,ask}",
15471547
N_("how to handle commits that become empty"),
15481548
PARSE_OPT_NONEG, parse_opt_empty),
15491549
{ OPTION_CALLBACK, 'k', "keep-empty", &options, NULL,

sequencer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,6 +1957,8 @@ static int do_pick_commit(struct repository *r,
19571957
flags |= ALLOW_EMPTY;
19581958
} else if (allow == 2) {
19591959
drop_commit = 1;
1960+
unlink(git_path_cherry_pick_head(r));
1961+
unlink(git_path_merge_msg(r));
19601962
fprintf(stderr,
19611963
_("dropping %s %s -- patch contents already upstream\n"),
19621964
oid_to_hex(&commit->object.oid), msg.subject);

t/t3424-rebase-empty.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,12 @@ test_expect_success 'rebase --interactive uses default of --empty=ask' '
123123
test_cmp expect actual
124124
'
125125

126+
test_expect_success 'rebase --merge does not leave state laying around' '
127+
git checkout -B testing localmods~2 &&
128+
git rebase --merge upstream &&
129+
130+
test_path_is_missing .git/CHERRY_PICK_HEAD &&
131+
test_path_is_missing .git/MERGE_MSG
132+
'
133+
126134
test_done

0 commit comments

Comments
 (0)