Browse Source

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
maint
Junio C Hamano 5 years ago
parent
commit
b4f0038525
  1. 10
      Documentation/git-rebase.txt
  2. 2
      builtin/rebase.c
  3. 2
      sequencer.c
  4. 8
      t/t3424-rebase-empty.sh

10
Documentation/git-rebase.txt

@ -699,6 +699,16 @@ suffer from the same shortcoming. (See @@ -699,6 +699,16 @@ suffer from the same shortcoming. (See
https://lore.kernel.org/git/20200207132152.GC2868@szeder.dev/ for
details.)

Commit Rewording
~~~~~~~~~~~~~~~~

When a conflict occurs while rebasing, rebase stops and asks the user
to resolve. Since the user may need to make notable changes while
resolving conflicts, after conflicts are resolved and the user has run
`git rebase --continue`, the rebase should open an editor and ask the
user to update the commit message. The merge backend does this, while
the apply backend blindly applies the original commit message.

Miscellaneous differences
~~~~~~~~~~~~~~~~~~~~~~~~~


2
builtin/rebase.c

@ -1543,7 +1543,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) @@ -1543,7 +1543,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
"ignoring them"),
REBASE_PRESERVE_MERGES, PARSE_OPT_HIDDEN),
OPT_RERERE_AUTOUPDATE(&options.allow_rerere_autoupdate),
OPT_CALLBACK_F(0, "empty", &options, N_("{drop,keep,ask}"),
OPT_CALLBACK_F(0, "empty", &options, "{drop,keep,ask}",
N_("how to handle commits that become empty"),
PARSE_OPT_NONEG, parse_opt_empty),
{ OPTION_CALLBACK, 'k', "keep-empty", &options, NULL,

2
sequencer.c

@ -1957,6 +1957,8 @@ static int do_pick_commit(struct repository *r, @@ -1957,6 +1957,8 @@ static int do_pick_commit(struct repository *r,
flags |= ALLOW_EMPTY;
} else if (allow == 2) {
drop_commit = 1;
unlink(git_path_cherry_pick_head(r));
unlink(git_path_merge_msg(r));
fprintf(stderr,
_("dropping %s %s -- patch contents already upstream\n"),
oid_to_hex(&commit->object.oid), msg.subject);

8
t/t3424-rebase-empty.sh

@ -123,4 +123,12 @@ test_expect_success 'rebase --interactive uses default of --empty=ask' ' @@ -123,4 +123,12 @@ test_expect_success 'rebase --interactive uses default of --empty=ask' '
test_cmp expect actual
'

test_expect_success 'rebase --merge does not leave state laying around' '
git checkout -B testing localmods~2 &&
git rebase --merge upstream &&

test_path_is_missing .git/CHERRY_PICK_HEAD &&
test_path_is_missing .git/MERGE_MSG
'

test_done

Loading…
Cancel
Save