]> git.ipfire.org Git - thirdparty/git.git/commitdiff
add -p: fix worktree patch mode prompts
authorRené Scharfe <l.s.r@web.de>
Wed, 14 Sep 2022 09:47:33 +0000 (11:47 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Sep 2022 18:14:38 +0000 (11:14 -0700)
cee6cb7300 (built-in add -p: implement the "worktree" patch modes,
2019-12-21) added the worktree patch modes to the built-in add -p.
Its commit message claims to be a port of 2f0896ec3ad4 (restore:
support --patch, 2019-04-25), which did the same for the script
git-add--interactive.perl.

The script mentioned only the worktree in its prompt messages in
worktree mode, while the built-in mentions the worktree and also the
index, even though the command doesn't actually affect the index.

2c8bd8471a (checkout -p: handle new files correctly, 2020-05-27)
added new prompt messages for addition that also mention the index in
worktree mode in the built-in, but not in the script.

Correct these prompts to state that only the worktree will be affected.

Reported-by: David Plumpton <david.plumpton@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add-patch.c

index 509ca04456bd390eb757f9c04a9d35a3285e313f..1a4244ed74c6ca8d2795572249e298c276a6cb71 100644 (file)
@@ -191,10 +191,10 @@ static struct patch_mode patch_mode_worktree_head = {
        .apply_check_args = { "-R", NULL },
        .is_reverse = 1,
        .prompt_mode = {
-               N_("Discard mode change from index and worktree [y,n,q,a,d%s,?]? "),
-               N_("Discard deletion from index and worktree [y,n,q,a,d%s,?]? "),
-               N_("Discard addition from index and worktree [y,n,q,a,d%s,?]? "),
-               N_("Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "),
+               N_("Discard mode change from worktree [y,n,q,a,d%s,?]? "),
+               N_("Discard deletion from worktree [y,n,q,a,d%s,?]? "),
+               N_("Discard addition from worktree [y,n,q,a,d%s,?]? "),
+               N_("Discard this hunk from worktree [y,n,q,a,d%s,?]? "),
        },
        .edit_hunk_hint = N_("If the patch applies cleanly, the edited hunk "
                             "will immediately be marked for discarding."),
@@ -213,10 +213,10 @@ static struct patch_mode patch_mode_worktree_nothead = {
        .apply_args = { NULL },
        .apply_check_args = { NULL },
        .prompt_mode = {
-               N_("Apply mode change to index and worktree [y,n,q,a,d%s,?]? "),
-               N_("Apply deletion to index and worktree [y,n,q,a,d%s,?]? "),
-               N_("Apply addition to index and worktree [y,n,q,a,d%s,?]? "),
-               N_("Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "),
+               N_("Apply mode change to worktree [y,n,q,a,d%s,?]? "),
+               N_("Apply deletion to worktree [y,n,q,a,d%s,?]? "),
+               N_("Apply addition to worktree [y,n,q,a,d%s,?]? "),
+               N_("Apply this hunk to worktree [y,n,q,a,d%s,?]? "),
        },
        .edit_hunk_hint = N_("If the patch applies cleanly, the edited hunk "
                             "will immediately be marked for applying."),