Re: [PATCH 4/6] checkout-index: handle "--no-index" option
- From
Jeff King <peff@peff.net>
- Date
- Feb 1, 2016, 03:22 UTC
- Message-ID
- <20160201032207.GB12217@sigill.intra.peff.net>
- In-Reply-To
- <xmqqr3gxw4j1.fsf@gitster.mtv.corp.google.com>
On Sun, Jan 31, 2016 at 06:25:22PM -0800, Junio C Hamano wrote:
Show 16 quoted lines
> Jeff King <peff@peff.net> writes: > > > I also reformatted the comment that violated our style > > guidelines, but I am not sure if it is all that helpful. It > > seems we also cancel "--index" with "--temp" or > > "--stage=all", but I do not know why. I left the content > > as-is, but if somebody knows enough to elaborate, it might > > be worth doing. > > Isn't the --index about updating the cached stat information, to > allow us to then say "the working tree file hasn't been modified > since we wrote it out"? After writing a file out to somewhere that > is not its natural location (i.e. using prefix, stage or temp would > all write the contents of F to somewhere that is not F), the next > "diff-files" would not compare the index entry with the contents > held in that relocated location, but with its natural location.
Yeah, that makes sense to me. I should have said "...but I do not know why, and I did not really look into it" in my original.
That probably makes it OK to silently ignore (as opposed to complaining that "--prefix" is used with "--index"). It is not so much "these options are incompatible" as the fact that there is no entry to update in the case of a prefix or tempfile. So "--index" is still in effect, it just has no work to do. :)
-Peff