Skip to content

Commit 74e42ce

Browse files
jrngitster
authored andcommitted
add-interactive: Clarify “remaining hunks in the file”
The "a" and "d" commands to ‘add --patch’ (accept/reject rest of file) interact with "j", "g", and "/" (skip some hunks) in a perhaps confusing way: after accepting or rejecting all _later_ hunks in the file, they return to the earlier, skipped hunks and prompt the user about them again. This behavior can be very useful in practice. One can still accept or reject _all_ undecided hunks in a file by using the "g" command to move to hunk #1 first. Reported-by: Frédéric Brière <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0d4dbcd commit 74e42ce

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Documentation/git-add.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ patch::
266266

267267
y - stage this hunk
268268
n - do not stage this hunk
269-
q - quit, do not stage this hunk nor any of the remaining ones
270-
a - stage this and all the remaining hunks in the file
271-
d - do not stage this hunk nor any of the remaining hunks in the file
269+
q - quit; do not stage this hunk nor any of the remaining ones
270+
a - stage this hunk and all later hunks in the file
271+
d - do not stage this hunk nor any of the later hunks in the file
272272
g - select a hunk to go to
273273
/ - search for a hunk matching the given regex
274274
j - leave this hunk undecided, see next undecided hunk

git-add--interactive.perl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,9 +1111,9 @@ sub help_patch_cmd {
11111111
print colored $help_color, <<EOF ;
11121112
y - $verb this hunk$target
11131113
n - do not $verb this hunk$target
1114-
q - quit, do not $verb this hunk nor any of the remaining ones
1115-
a - $verb this and all the remaining hunks in the file
1116-
d - do not $verb this hunk nor any of the remaining hunks in the file
1114+
q - quit; do not $verb this hunk nor any of the remaining ones
1115+
a - $verb this hunk and all later hunks in the file
1116+
d - do not $verb this hunk nor any of the later hunks in the file
11171117
g - select a hunk to go to
11181118
/ - search for a hunk matching the given regex
11191119
j - leave this hunk undecided, see next undecided hunk

0 commit comments

Comments
 (0)