From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Christian Couder <christian.couder@gmail.com>,
Patrick Steinhardt <ps@pks.im>, git <git@vger.kernel.org>,
Han-Wen Nienhuys <hanwen@google.com>
Subject: Re: [RFC] fetch: update refs in a single transaction
Date: Thu, 09 Dec 2021 14:16:41 -0800 [thread overview]
Message-ID: <xmqqtufho246.fsf@gitster.g> (raw)
In-Reply-To: <YbEgDBJPuGXQ+2t6@coredump.intra.peff.net> (Jeff King's message of "Wed, 8 Dec 2021 16:13:48 -0500")
Jeff King <peff@peff.net> writes:
> I suspect the surgery needed for the ref-transaction code to allow
> non-atomic updates would be pretty big, though. It involves checking
> every error case to make sure it is safe to continue rather than
> aborting (and munging data structures to mark particular refs as
> "failed, don't do anything further for this one").
>
> So I dunno. All of my analysis assumes the breakdown of user
> expectations I gave above is a reasonable one. There may be others. But
> it seems like the behavior created by just this patch would be very hard
> to explain, and subject to change based on implementation details.
Oh, I should have read your analysis before reacting to the original
message myself ;-)
Yes, current callers of ref-transaction code may have some logic to
decide that it is not even worth telling a proposed change to the
ref API (e.g. non-fast-forward) but that does feel like an
unnecessary implementation detail, and a true "partial transaction"
needs cooperation by the ref-transaction layer.
And when it is done, we do not have to explain anything to the user
beyond what we already do. The "--atomic" option will make it
all-or-none, and without it, changes to each ref may or may not fail
individually with its own reason, without correlation to the outcome
of the changes to any other refs. And use of single or multiple
transactions just becomes an implementation detail of non-atomic
updates.
next prev parent reply other threads:[~2021-12-09 22:16 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 [this message]
2021-12-09 21:53 ` Junio C Hamano
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=xmqqtufho246.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=christian.couder@gmail.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 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).