Skip to content

Commit d064702

Browse files
jupedgitster
authored andcommitted
git-apply.txt: update descriptions of --cached, --index
The blurb for "--cached" says it implies "--index", but in reality "--cached" and "--index" are distinct modes with different behavior. Additionally, the descriptions of "--index" and "--cached" are somewhat unclear about what might be modified, and what "--index" looks for to determine that the index and working copy "match". Rewrite the blurbs for both options for clarity and accuracy. Signed-off-by: Raymond E. Pasco <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 47ae905 commit d064702

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Documentation/git-apply.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ OPTIONS
6161
file and detects errors. Turns off "apply".
6262

6363
--index::
64-
When `--check` is in effect, or when applying the patch
65-
(which is the default when none of the options that
66-
disables it is in effect), make sure the patch is
67-
applicable to what the current index file records. If
68-
the file to be patched in the working tree is not
69-
up to date, it is flagged as an error. This flag also
70-
causes the index file to be updated.
64+
Apply the patch to both the index and the working tree (or
65+
merely check that it would apply cleanly to both if `--check` is
66+
in effect). Note that `--index` expects index entries and
67+
working tree copies for relevant paths to be identical (their
68+
contents and metadata such as file mode must match), and will
69+
raise an error if they are not, even if the patch would apply
70+
cleanly to both the index and the working tree in isolation.
7171

7272
--cached::
73-
Apply a patch without touching the working tree. Instead take the
74-
cached data, apply the patch, and store the result in the index
75-
without using the working tree. This implies `--index`.
73+
Apply the patch to just the index, without touching the working
74+
tree. If `--check` is in effect, merely check that it would
75+
apply cleanly to the index entry.
7676

7777
--intent-to-add::
7878
When applying the patch only to the working tree, mark new

0 commit comments

Comments
 (0)