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 <fbriere@fbriere.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
Jun 12, 2010 at 22:32 UTC
74e42ce122bfcbd2e1a06395b80d6a4b44580148
2 files changed
+6
-6
Documentation/git-add.txt
+3
-3
@@ -266,9 +266,9 @@ patch::
266
267
y - stage this hunk
268
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
272
g - select a hunk to go to
273
/ - search for a hunk matching the given regex
274
j - leave this hunk undecided, see next undecided hunk
git-add--interactive.perl
+3
-3
@@ -1111,9 +1111,9 @@ sub help_patch_cmd {
1111
print colored $help_color, <<EOF ;
1112
y - $verb this hunk$target
1113
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
1117
g - select a hunk to go to
1118
/ - search for a hunk matching the given regex
1119
j - leave this hunk undecided, see next undecided hunk