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

Re: [RFC] fetch: update refs in a single transaction

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 9, 2021, 22:16 UTC
Message-ID
<xmqqtufho246.fsf@gitster.g>
In-Reply-To
<YbEgDBJPuGXQ+2t6@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> 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.

Previous: Jeff KingNext: Junio C Hamano
Message 7 of 8 in “[RFC] fetch: update refs in a single transaction”
  1. Patrick SteinhardtDec 7, 2021
  2. Christian CouderDec 8, 2021
  3. Patrick SteinhardtDec 8, 2021
  4. Jeff KingDec 8, 2021
  5. Patrick SteinhardtDec 9, 2021
  6. Jeff KingDec 10, 2021
  7. Junio C HamanoDec 9, 2021
  8. Junio C HamanoDec 9, 2021

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.