Skip to content

Commit

Permalink
git-commit.txt: clarify --patch mode with pathspec
Browse files Browse the repository at this point in the history
How pathspec is used, with and without --interactive/--patch, is
different. But this is not clear from the document. These changes hint
the user to keep reading (to option #5) instead of stopping at #2 and
assuming --patch/--interactive behaves the same way.

And since all the options listed here always mention how the index is
involved (or not) in the final commit, add that bit for #5 as well. This
"on top of the index" is implied when you head over git-add(1), but if
you just go straight to the "Interactive mode" and not read what git-add
is for, you may miss it.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
pclouds authored and gitster committed Oct 5, 2016
1 parent 0b65a8d commit 7431596
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Documentation/git-commit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ The content to be added can be specified in several ways:
2. by using 'git rm' to remove files from the working tree
and the index, again before using the 'commit' command;

3. by listing files as arguments to the 'commit' command, in which
3. by listing files as arguments to the 'commit' command
(without --interactive or --patch switch), in which
case the commit will ignore changes staged in the index, and instead
record the current content of the listed files (which must already
be known to Git);
Expand All @@ -41,7 +42,8 @@ The content to be added can be specified in several ways:
actual commit;

5. by using the --interactive or --patch switches with the 'commit' command
to decide one by one which files or hunks should be part of the commit,
to decide one by one which files or hunks should be part of the commit
in addition to contents in the index,
before finalizing the operation. See the ``Interactive Mode'' section of
linkgit:git-add[1] to learn how to operate these modes.

Expand Down

0 comments on commit 7431596

Please sign in to comment.