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, 21:53 UTC
Message-ID
<xmqqzgp9o379.fsf@gitster.g>
In-Reply-To
<259de62b26302c10f429d52bec42a8a954bc5ba3.1638886972.git.ps@pks.im>
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(-)
Previous: Junio C Hamano
Message 8 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.