Skip to content

Commit

Permalink
add-interactive: Clarify “remaining hunks in the file”
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Jun 13, 2010
1 parent 0d4dbcd commit 74e42ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Documentation/git-add.txt
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ patch::

y - stage this hunk
n - do not stage this hunk
q - quit, do not stage this hunk nor any of the remaining ones
a - stage this and all the remaining hunks in the file
d - do not stage this hunk nor any of the remaining hunks in the file
q - quit; do not stage this hunk nor any of the remaining ones
a - stage this hunk and all later hunks in the file
d - do not stage this hunk nor any of the later hunks in the file
g - select a hunk to go to
/ - search for a hunk matching the given regex
j - leave this hunk undecided, see next undecided hunk
Expand Down
6 changes: 3 additions & 3 deletions git-add--interactive.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1111,9 +1111,9 @@ sub help_patch_cmd {
print colored $help_color, <<EOF ;
y - $verb this hunk$target
n - do not $verb this hunk$target
q - quit, do not $verb this hunk nor any of the remaining ones
a - $verb this and all the remaining hunks in the file
d - do not $verb this hunk nor any of the remaining hunks in the file
q - quit; do not $verb this hunk nor any of the remaining ones
a - $verb this hunk and all later hunks in the file
d - do not $verb this hunk nor any of the later hunks in the file
g - select a hunk to go to
/ - search for a hunk matching the given regex
j - leave this hunk undecided, see next undecided hunk
Expand Down

0 comments on commit 74e42ce

Please sign in to comment.