Skip to content

Commit 00cf8fe

Browse files
committed
Merge branch 'kt/add-i-progress' into next
"git add -i" has been taught to show the total number of hunks and the hunks that has been processed so far when showing prompts. * kt/add-i-progress: add -i: show progress counter in the prompt
2 parents b3474c9 + 8085050 commit 00cf8fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

git-add--interactive.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ sub patch_update_file {
15411541
for (@{$hunk[$ix]{DISPLAY}}) {
15421542
print;
15431543
}
1544-
print colored $prompt_color,
1544+
print colored $prompt_color, "(", ($ix+1), "/$num) ",
15451545
sprintf(__($patch_update_prompt_modes{$patch_mode}{$hunk[$ix]{TYPE}}), $other);
15461546

15471547
my $line = prompt_single_character;

t/t3701-add-interactive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ test_expect_success C_LOCALE_OUTPUT 'add first line works' '
314314
git commit -am "clear local changes" &&
315315
git apply patch &&
316316
printf "%s\n" s y y | git add -p file 2>error |
317-
sed -n -e "s/^Stage this hunk[^@]*\(@@ .*\)/\1/" \
317+
sed -n -e "s/^([1-2]\/[1-2]) Stage this hunk[^@]*\(@@ .*\)/\1/" \
318318
-e "/^[-+@ \\\\]"/p >output &&
319319
test_must_be_empty error &&
320320
git diff --cached >diff &&

0 commit comments

Comments
 (0)