git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Junio C HamanoNext: Jeff King
Message 10 of 19 in “post-strbuf_getline cleanups”
  1. 0/6 post-strbuf_getline cleanupsJeff King, Jan 31, 2016
  2. 1/6 give "nbuf" strbuf a more meaningful nameJeff King, Jan 31, 2016
  3. Johannes SchindelinJan 31, 2016
  4. Jeff KingJan 31, 2016
  5. Johannes SchindelinJan 31, 2016
  6. 2/6 checkout-index: simplify "-z" option parsingJeff King, Jan 31, 2016
  7. 3/6 checkout-index: handle "--no-prefix" optionJeff King, Jan 31, 2016
  8. 4/6 checkout-index: handle "--no-index" optionJeff King, Jan 31, 2016
  9. Junio C HamanoFeb 1, 2016
  10. Jeff KingFeb 1, 2016
  11. 5/6 checkout-index: disallow "--no-stage" optionJeff King, Jan 31, 2016
  12. Junio C HamanoFeb 1, 2016
  13. Jeff KingFeb 1, 2016
  14. 6/6 apply, ls-files: simplify "-z" parsingJeff King, Jan 31, 2016
  15. Johannes SchindelinJan 31, 2016
  16. Junio C HamanoFeb 1, 2016
  17. Junio C HamanoFeb 1, 2016
  18. Jeff KingFeb 2, 2016
  19. Junio C HamanoFeb 1, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.