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

Re: Get a git diff without taking index into account

From
Jeff King <peff@peff.net>
Date
Feb 18, 2015, 18:32 UTC
Message-ID
<20150218183251.GB6346@peff.net>
In-Reply-To
<CAAoZyYOst-5cD7qtV=T3Oahja1JN1ZmeyAcELrn7xD0bMc7Mrg@mail.gmail.com>
On Wed, Feb 18, 2015 at 01:27:50PM -0500, Eric Frederich wrote:
> My immediate concern is not to fix the documentation but to get some
> sort of status or diff.
> I want to avoid using an index because I want to allow multiple
> processes to do different diffs at the same time.

If you only have one working tree, can't all of the processes use the same index (that matches the working tree) and do different diffs against it?

If you have multiple working trees, can you use one index per working tree, and specify it using GIT_INDEX_FILE?

If you can persist the index file for each working tree, this will be much faster in the long run, too (you can just refresh the index before each diff, which means that git does not have to actually open the files in most cases; we can compare their stat information to what is in the index, and then the index sha1 with what is in the tree).

-Peff
Previous: Eric FrederichNext: Eric Frederich
Message 7 of 11 in “Get a git diff without taking index into account”
  1. Eric FrederichFeb 18, 2015
  2. Eric FrederichFeb 18, 2015
  3. Junio C HamanoFeb 18, 2015
  4. Eric FrederichFeb 18, 2015
  5. Junio C HamanoFeb 18, 2015
  6. Eric FrederichFeb 18, 2015
  7. Jeff KingFeb 18, 2015
  8. Eric FrederichFeb 18, 2015
  9. Eric FrederichFeb 18, 2015
  10. Junio C HamanoFeb 18, 2015
  11. Jeff KingFeb 18, 2015

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.