]> git.ipfire.org Git - thirdparty/git.git/commit - Documentation/git-update-index.txt
git-update-index.txt: reword possibly confusing example
authorElijah Newren <newren@gmail.com>
Wed, 8 Aug 2018 20:28:07 +0000 (13:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Aug 2018 21:53:16 +0000 (14:53 -0700)
commit388d0ff6e52d1d9f193db997a7f4ca1ee74e178f
tree93d84b7e9e2af6cdda73df3e71226e16908e78fb
parent53f9a3e157dbbc901a02ac2c73346d375e24978c
git-update-index.txt: reword possibly confusing example

The following phrase could be interpreted multiple ways:
  "To pretend you have a file with mode and sha1 at path"

In particular, I can think of two:
  1. Pretend we have some new file, which happens to have a given mode
     and sha1
  2. Pretend one of the files we are already tracking has a different
     mode and sha1 than what it really does

I think people could easily assume either case while reading, but the
example command provided doesn't actually handle the first case, which
caused some minor frustration to at least one user.  Modify the example
command so that it correctly handles both cases, and re-order the
wording in a way that makes it more likely folks will assume the first
interpretation.  I believe the new example shouldn't pose any obstacles
to those wanting the second interpretation (at worst, they pass an
unnecessary extra flag).

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-update-index.txt