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

Re: [PATCH 0/2] describe and diff: implement --no-optional-locks

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 10, 2025, 12:25 UTC
Message-ID
<xmqqwmcx9io3.fsf@gitster.g>
In-Reply-To
<20250309033908.GA2361799@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 6 quoted lines
> .... What
> git-status does with --no-optional-locks is to update the index
> internally for its _own_ use (giving it the correct results), but not to
> lock nor write out the resulting index (to avoid conflicting with other
> running programs). So it's pessimal (losing the opportunity to share
> what it learned) but prevents lock contention.

Yup, that sounds somewhat sensible. I also have to wonder, other than commands that are clearly about changing the repository state like "add", the inspection commands like diff and status should always opportunistically write the index back, without even being asked?

Show 13 quoted lines
> ... Either it must:
>
>   - accept that diff-files might return stat-dirty results (yuck)
>
>   - use its own index that is separate from the regular .git/index file.
>     But that may be overly slow, since the index "update" would rewrite
>     the whole thing from scratch. Of course all of our index writes are
>     from scratch, but you'd pay the price even when there is nothing to
>     update.
>
>   - use a command which operates all in a single process, with an
>     in-memory index that is updated but not written out (e.g., "git
>     --no-optional-locks status").
Previous: Jeff KingNext: Jeff King
Message 6 of 11 in “describe and diff: implement --no-optional-locks”
  1. 0/2 describe and diff: implement --no-optional-locksBenjamin Woodruff via GitGitGadget, Mar 6, 2025
  2. 1/2 describe: implement --no-optional-locksBenjamin Woodruff via GitGitGadget, Mar 6, 2025
  3. 2/2 diff: implement --no-optional-locksBenjamin Woodruff via GitGitGadget, Mar 6, 2025
  4. Junio C HamanoMar 6, 2025
  5. Jeff KingMar 9, 2025
  6. Junio C HamanoMar 10, 2025
  7. Jeff KingMar 10, 2025
  8. Junio C HamanoMar 10, 2025
  9. Benjamin WoodruffMar 10, 2025
  10. Junio C HamanoMar 10, 2025
  11. Jeff KingMar 11, 2025

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.