From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org, Han-Wen Nienhuys <hanwen@google.com>,
Jeff King <peff@peff.net>
Subject: Re: [RFC] fetch: update refs in a single transaction
Date: Thu, 09 Dec 2021 13:53:14 -0800 [thread overview]
Message-ID: <xmqqzgp9o379.fsf@gitster.g> (raw)
In-Reply-To: <259de62b26302c10f429d52bec42a8a954bc5ba3.1638886972.git.ps@pks.im> (Patrick Steinhardt's message of "Tue, 7 Dec 2021 15:24:21 +0100")
Patrick Steinhardt <ps@pks.im> writes:
> instead of creating one slice per updated ref. While this inefficiency
> can be easily mitigated by using the `--atomic` flag, this flag cannot
> be used in contexts where we want partial-update semantics.
Interesting and puzzling. In today's code, we use a single
transaction when "atomic" is asked for, so that we can open a
transaction, prepare bunch of ref updates, and say "commit" to
commit all of them and let the ref_transaction layer to make the
whole thing all-or-none. If we now use a single transaction for two
refs update that do not have to be atomic, it is surprising (from
the diffstat) that we can do so without changing anything in the
ref_transaction layer. Doesn't the caller at least need to say
"this transaction is best-effort 'partial-update' (whatever it
means)" vs "this transaction is all-or-none"? And doesn't the
ref_transaction layer now need to implement the 'partial-update'
thing?
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> builtin/fetch.c | 78 ++++++++++++++++---------------------------------
> 1 file changed, 25 insertions(+), 53 deletions(-)
prev parent reply other threads:[~2021-12-09 21:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-07 14:24 [RFC] fetch: update refs in a single transaction Patrick Steinhardt
2021-12-08 8:15 ` Christian Couder
2021-12-08 8:48 ` Patrick Steinhardt
2021-12-08 21:13 ` Jeff King
2021-12-09 7:11 ` Patrick Steinhardt
2021-12-10 9:04 ` Jeff King
2021-12-09 22:16 ` Junio C Hamano
2021-12-09 21:53 ` Junio C Hamano [this message]
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=xmqqzgp9o379.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=hanwen@google.com \
--cc=peff@peff.net \
--cc=ps@pks.im \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.