Re: [PATCH] git-update-index.txt: reword possibly confusing example
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 8, 2018, 21:31 UTC
- Message-ID
- <xmqqzhxweeam.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180808202807.15350-1-newren@gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 15 quoted lines
> 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 do not think the rephrasing loses those who want to update an existing path, and is a good one.
Show 7 quoted lines
> -To pretend you have a file with mode and sha1 at path, say: > +To pretend you have a file at path with mode and sha1, say: > > ---------------- > -$ git update-index --cacheinfo <mode>,<sha1>,<path> > +$ git update-index --add --cacheinfo <mode>,<sha1>,<path> > ----------------