From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Benjamin Woodruff via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, Benjamin Woodruff <github@benjam.info>
Subject: Re: [PATCH 0/2] describe and diff: implement --no-optional-locks
Date: Mon, 10 Mar 2025 05:25:32 -0700 [thread overview]
Message-ID: <xmqqwmcx9io3.fsf@gitster.g> (raw)
In-Reply-To: <20250309033908.GA2361799@coredump.intra.peff.net> (Jeff King's message of "Sat, 8 Mar 2025 22:39:08 -0500")
Jeff King <peff@peff.net> writes:
> .... 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?
> ... 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").
next prev parent reply other threads:[~2025-03-10 12:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 5:58 [PATCH 0/2] describe and diff: implement --no-optional-locks Benjamin Woodruff via GitGitGadget
2025-03-06 5:58 ` [PATCH 1/2] describe: " Benjamin Woodruff via GitGitGadget
2025-03-06 5:58 ` [PATCH 2/2] diff: " Benjamin Woodruff via GitGitGadget
2025-03-06 16:11 ` [PATCH 0/2] describe and " Junio C Hamano
2025-03-09 3:39 ` Jeff King
2025-03-10 12:25 ` Junio C Hamano [this message]
2025-03-10 16:08 ` Jeff King
2025-03-10 18:53 ` Junio C Hamano
2025-03-10 20:50 ` Benjamin Woodruff
2025-03-10 23:04 ` Junio C Hamano
2025-03-11 2:10 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqwmcx9io3.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=github@benjam.info \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).