@@ -48,8 +48,8 @@ test_expect_success 'unknown command' '
4848git add -N command &&
4949git diff command >expect &&
5050cat >>expect <<-EOF &&
51- (1/1) Stage addition [y,n,q,a,d,e,p,?]? Unknown command ${SQ}W${SQ} (use ${SQ}?${SQ} for help)
52- (1/1) Stage addition [y,n,q,a,d,e,p,?]?$SP
51+ (1/1) Stage addition [y,n,q,a,d,e,p,P, ?]? Unknown command ${SQ}W${SQ} (use ${SQ}?${SQ} for help)
52+ (1/1) Stage addition [y,n,q,a,d,e,p,P, ?]?$SP
5353EOF
5454git add -p -- command <command >actual 2>&1 &&
5555test_cmp expect actual
@@ -332,9 +332,9 @@ test_expect_success 'different prompts for mode change/deleted' '
332332git -c core.filemode=true add -p >actual &&
333333sed -n "s/^\(([0-9/]*) Stage .*?\).*/\1/p" actual >actual.filtered &&
334334cat >expect <<-\EOF &&
335- (1/1) Stage deletion [y,n,q,a,d,p,?]?
336- (1/2) Stage mode change [y,n,q,a,d,k,K,j,J,g,/,p,?]?
337- (2/2) Stage this hunk [y,n,q,a,d,K,J,g,/,e,p,?]?
335+ (1/1) Stage deletion [y,n,q,a,d,p,P, ?]?
336+ (1/2) Stage mode change [y,n,q,a,d,k,K,j,J,g,/,p,P, ?]?
337+ (2/2) Stage this hunk [y,n,q,a,d,K,J,g,/,e,p,P, ?]?
338338EOF
339339test_cmp expect actual.filtered
340340'
@@ -521,13 +521,13 @@ test_expect_success 'split hunk setup' '
521521test_expect_success ' goto hunk 1 with "g 1"' '
522522test_when_finished "git reset" &&
523523tr _ " " >expect <<-EOF &&
524- (2/2) Stage this hunk [y,n,q,a,d,K,J,g,/,e,p,?]? + 1: -1,2 +1,3 +15
524+ (2/2) Stage this hunk [y,n,q,a,d,K,J,g,/,e,p,P, ?]? + 1: -1,2 +1,3 +15
525525_ 2: -2,4 +3,8 +21
526526go to which hunk? @@ -1,2 +1,3 @@
527527_10
528528+15
529529_20
530- (1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,?]?_
530+ (1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,P, ?]?_
531531EOF
532532test_write_lines s y g 1 | git add -p >actual &&
533533tail -n 7 <actual >actual.trimmed &&
@@ -540,7 +540,7 @@ test_expect_success 'goto hunk 1 with "g1"' '
540540_10
541541+15
542542_20
543- (1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,?]?_
543+ (1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,P, ?]?_
544544EOF
545545test_write_lines s y g1 | git add -p >actual &&
546546tail -n 4 <actual >actual.trimmed &&
@@ -550,11 +550,11 @@ test_expect_success 'goto hunk 1 with "g1"' '
550550test_expect_success ' navigate to hunk via regex /pattern' '
551551test_when_finished "git reset" &&
552552tr _ " " >expect <<-EOF &&
553- (2/2) Stage this hunk [y,n,q,a,d,K,J,g,/,e,p,?]? @@ -1,2 +1,3 @@
553+ (2/2) Stage this hunk [y,n,q,a,d,K,J,g,/,e,p,P, ?]? @@ -1,2 +1,3 @@
554554_10
555555+15
556556_20
557- (1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,?]?_
557+ (1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,P, ?]?_
558558EOF
559559test_write_lines s y /1,2 | git add -p >actual &&
560560tail -n 5 <actual >actual.trimmed &&
@@ -567,7 +567,7 @@ test_expect_success 'navigate to hunk via regex / pattern' '
567567_10
568568+15
569569_20
570- (1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,?]?_
570+ (1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,P, ?]?_
571571EOF
572572test_write_lines s y / 1,2 | git add -p >actual &&
573573tail -n 4 <actual >actual.trimmed &&
@@ -579,11 +579,11 @@ test_expect_success 'print again the hunk' '
579579tr _ " " >expect <<-EOF &&
580580+15
581581 20
582- (1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,?]? @@ -1,2 +1,3 @@
582+ (1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,P, ?]? @@ -1,2 +1,3 @@
583583 10
584584+15
585585 20
586- (1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,?]?_
586+ (1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,P, ?]?_
587587EOF
588588test_write_lines s y g 1 p | git add -p >actual &&
589589tail -n 7 <actual >actual.trimmed &&
@@ -595,11 +595,11 @@ test_expect_success TTY 'print again the hunk (PAGER)' '
595595cat >expect <<-EOF &&
596596<GREEN>+<RESET><GREEN>15<RESET>
597597 20<RESET>
598- <BOLD;BLUE>(1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,?]? <RESET>PAGER <CYAN>@@ -1,2 +1,3 @@<RESET>
598+ <BOLD;BLUE>(1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,P, ?]? <RESET>PAGER <CYAN>@@ -1,2 +1,3 @@<RESET>
599599PAGER 10<RESET>
600600PAGER <GREEN>+<RESET><GREEN>15<RESET>
601601PAGER 20<RESET>
602- <BOLD;BLUE>(1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,?]? <RESET>
602+ <BOLD;BLUE>(1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,P, ?]? <RESET>
603603EOF
604604test_write_lines s y g 1 P |
605605(
@@ -796,21 +796,21 @@ test_expect_success 'colors can be overridden' '
796796<BLUE>+<RESET><BLUE>new<RESET>
797797<CYAN> more-context<RESET>
798798<BLUE>+<RESET><BLUE>another-one<RESET>
799- <YELLOW>(1/1) Stage this hunk [y,n,q,a,d,s,e,p,?]? <RESET><BOLD>Split into 2 hunks.<RESET>
799+ <YELLOW>(1/1) Stage this hunk [y,n,q,a,d,s,e,p,P, ?]? <RESET><BOLD>Split into 2 hunks.<RESET>
800800<MAGENTA>@@ -1,3 +1,3 @@<RESET>
801801<CYAN> context<RESET>
802802<BOLD>-old<RESET>
803803<BLUE>+<RESET><BLUE>new<RESET>
804804<CYAN> more-context<RESET>
805- <YELLOW>(1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,?]? <RESET><MAGENTA>@@ -3 +3,2 @@<RESET>
805+ <YELLOW>(1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,P, ?]? <RESET><MAGENTA>@@ -3 +3,2 @@<RESET>
806806<CYAN> more-context<RESET>
807807<BLUE>+<RESET><BLUE>another-one<RESET>
808- <YELLOW>(2/2) Stage this hunk [y,n,q,a,d,K,J,g,/,e,p,?]? <RESET><MAGENTA>@@ -1,3 +1,3 @@<RESET>
808+ <YELLOW>(2/2) Stage this hunk [y,n,q,a,d,K,J,g,/,e,p,P, ?]? <RESET><MAGENTA>@@ -1,3 +1,3 @@<RESET>
809809<CYAN> context<RESET>
810810<BOLD>-old<RESET>
811811<BLUE>+new<RESET>
812812<CYAN> more-context<RESET>
813- <YELLOW>(1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,?]? <RESET>
813+ <YELLOW>(1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,P, ?]? <RESET>
814814EOF
815815test_cmp expect actual
816816'
@@ -1424,9 +1424,9 @@ test_expect_success 'invalid option s is rejected' '
14241424test_write_lines j s q | git add -p >out &&
14251425sed -ne "s/ @@.*//" -e "s/ \$//" -e "/^(/p" <out >actual &&
14261426cat >expect <<-EOF &&
1427- (1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,s,e,p,?]?
1428- (2/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,?]? Sorry, cannot split this hunk
1429- (2/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,?]?
1427+ (1/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,s,e,p,P, ?]?
1428+ (2/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,P, ?]? Sorry, cannot split this hunk
1429+ (2/2) Stage this hunk [y,n,q,a,d,k,K,j,J,g,/,e,p,P, ?]?
14301430EOF
14311431test_cmp expect actual
14321432'
0 commit comments