Browse Source

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 <ray@ameretat.dev>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Raymond E. Pasco 4 years ago committed by Junio C Hamano
parent
commit
d064702be3
  1. 20
      Documentation/git-apply.txt

20
Documentation/git-apply.txt

@ -61,18 +61,18 @@ OPTIONS
file and detects errors. Turns off "apply". file and detects errors. Turns off "apply".


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


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


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

Loading…
Cancel
Save