rebase: update --empty=ask to --empty=stop

When git-am(1) got its own `--empty` option in 7c096b8d61 (am: support
--empty=<option> to handle empty patches, 2021-12-09), `stop` was used
instead of `ask`. `stop` is a more accurate term for describing what
really happens, and consistency is good.

Update git-rebase(1) to also use `stop`, while keeping `ask` as a
deprecated synonym. Update the tests to primarily use `stop`, but also
ensure that `ask` is still allowed.

In a future commit, we'll be adding a new `--empty` option for
git-cherry-pick(1) as well, making the consistency even more relevant.

Reported-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Brian Lyles <brianmlyles@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Brian Lyles
2024-03-25 18:16:50 -05:00
committed by Junio C Hamano
parent 64a443efe4
commit c282eba2d5
3 changed files with 34 additions and 18 deletions

View File

@@ -72,6 +72,17 @@ test_expect_success 'rebase --merge --empty=keep' '
test_cmp expect actual
'
test_expect_success 'rebase --merge --empty=stop' '
git checkout -B testing localmods &&
test_must_fail git rebase --merge --empty=stop upstream &&
git rebase --skip &&
test_write_lines D C B A >expect &&
git log --format=%s >actual &&
test_cmp expect actual
'
test_expect_success 'rebase --merge --empty=ask' '
git checkout -B testing localmods &&
test_must_fail git rebase --merge --empty=ask upstream &&
@@ -101,9 +112,9 @@ test_expect_success 'rebase --interactive --empty=keep' '
test_cmp expect actual
'
test_expect_success 'rebase --interactive --empty=ask' '
test_expect_success 'rebase --interactive --empty=stop' '
git checkout -B testing localmods &&
test_must_fail git rebase --interactive --empty=ask upstream &&
test_must_fail git rebase --interactive --empty=stop upstream &&
git rebase --skip &&
@@ -112,7 +123,7 @@ test_expect_success 'rebase --interactive --empty=ask' '
test_cmp expect actual
'
test_expect_success 'rebase --interactive uses default of --empty=ask' '
test_expect_success 'rebase --interactive uses default of --empty=stop' '
git checkout -B testing localmods &&
test_must_fail git rebase --interactive upstream &&
@@ -194,9 +205,9 @@ test_expect_success 'rebase --exec uses default of --empty=keep' '
test_cmp expect actual
'
test_expect_success 'rebase --exec --empty=ask' '
test_expect_success 'rebase --exec --empty=stop' '
git checkout -B testing localmods &&
test_must_fail git rebase --exec "true" --empty=ask upstream &&
test_must_fail git rebase --exec "true" --empty=stop upstream &&
git rebase --skip &&