git-commit.txt: clarify --patch mode with pathspec
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>
Duy Nguyen committed
Oct 5, 2016 at 17:26 UTC
7431596ab1f05a13adb93b44108f27cfd6578a31
1 file changed
+4
-2
Documentation/git-commit.txt
+4
-2
@@ -29,7 +29,8 @@ The content to be added can be specified in several ways:
29
2. by using 'git rm' to remove files from the working tree
30
and the index, again before using the 'commit' command;
31
32
-3. by listing files as arguments to the 'commit' command, in which
32
+3. by listing files as arguments to the 'commit' command
33
+ (without --interactive or --patch switch), in which
34
case the commit will ignore changes staged in the index, and instead
35
record the current content of the listed files (which must already
36
be known to Git);
@@ -41,7 +42,8 @@ The content to be added can be specified in several ways:
42
actual commit;
43
44
5. by using the --interactive or --patch switches with the 'commit' command
44
- to decide one by one which files or hunks should be part of the commit,
45
+ to decide one by one which files or hunks should be part of the commit
46
+ in addition to contents in the index,
47
before finalizing the operation. See the ``Interactive Mode'' section of
48
linkgit:git-add[1] to learn how to operate these modes.
49