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

Re: [PATCH v4 2/2] fetch: fix non-conflicting tags not being committed

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 12, 2025, 16:34 UTC
Message-ID
<xmqq346jtdky.fsf@gitster.g>
In-Reply-To
<CAOLa=ZQAQ1dtstD+uqh=vzV+w5q2uWsnZkzqucHuj_W_VL931A@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 33 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
>
>> On Tue, Nov 11, 2025 at 02:27:08PM +0100, Karthik Nayak wrote:
>>> The cleanup section is reached with `retcode` set in several scenarios:
>>>
>>>    - `truncate_fetch_head()` and `open_fetch_head()` both set `retcode`
>>>      before the transaction is created, so no commit is attempted.
>>>
>>>    - `prune_refs()` sets `retcode` after creating the transaction, so
>>>      the commit will now proceed. Before batched updates, `prune_refs()`
>>>      created its own transaction internally with all-or-nothing
>>>      semantics. This was done since all deletions were made without an
>>>      old OID, which meant they were assumed to never fail. This change
>>>      allows partial deletions to succeed, consistent with how other
>>>      reference updates behave during fetch.
>>
>> Okay, so we do have a change in behaviour for `prune_refs()`. I guess
>> the reasoning is sound, but I was wondering why we don't have a test for
>> this.
>>
>> I guess the reason is that, as you said, it should in theory always
>> succeed. But what if with the "files" backend one of the refs that we're
>> about to prune was locked? Would that be a case where we continue with
>> pruning the remaining refs now?
>>
>
> I was thinking of concurrent writes to lock the reference, and didn't
> think of a nice way to do this. Your solution works and is indeed better.
>
> I started writing the test and realized that the pruning happens before
> we create the batched updates transaction. So I was _wrong_ and there is
> no change for `prune_refs()` either, as the transaction is never defined
> at this stage. Will amend and send in a new version.

Thanks, both. I too was wondering what was going on in that part of the flow.

Previous: Karthik NayakNext: Karthik Nayak
Message 25 of 54 in “fetch: fix non-conflicting tags not being committed”
  1. fetch: fix non-conflicting tags not being committedKarthik Nayak, Nov 3, 2025
  2. Eric SunshineNov 3, 2025
  3. Karthik NayakNov 3, 2025
  4. Justin ToblerNov 3, 2025
  5. fetch: fix non-conflicting tags not being committedKarthik Nayak, Nov 6, 2025
  6. Patrick SteinhardtNov 6, 2025
  7. Junio C HamanoNov 6, 2025
  8. Karthik NayakNov 7, 2025
  9. Patrick SteinhardtNov 7, 2025
  10. Karthik NayakNov 7, 2025
  11. Justin ToblerNov 6, 2025
  12. Karthik NayakNov 7, 2025
  13. 0/2 fetch: fix non-conflicting tags not being committedKarthik Nayak, Nov 8, 2025
  14. 1/2 fetch: extract out reference committing logicKarthik Nayak, Nov 8, 2025
  15. Patrick SteinhardtNov 10, 2025
  16. Karthik NayakNov 10, 2025
  17. 2/2 fetch: fix non-conflicting tags not being committedKarthik Nayak, Nov 8, 2025
  18. Patrick SteinhardtNov 10, 2025
  19. Karthik NayakNov 10, 2025
  20. 0/2 fetch: fix non-conflicting tags not being committedKarthik Nayak, Nov 11, 2025
  21. 1/2 fetch: extract out reference committing logicKarthik Nayak, Nov 11, 2025
  22. 2/2 fetch: fix non-conflicting tags not being committedKarthik Nayak, Nov 11, 2025
  23. Patrick SteinhardtNov 12, 2025
  24. Karthik NayakNov 12, 2025
  25. Junio C HamanoNov 12, 2025
  26. 0/2 fetch: fix non-conflicting tags not being committedKarthik Nayak, Nov 13, 2025
  27. 1/2 fetch: extract out reference committing logicKarthik Nayak, Nov 13, 2025
  28. 2/2 fetch: fix non-conflicting tags not being committedKarthik Nayak, Nov 13, 2025
  29. Junio C HamanoNov 13, 2025
  30. Karthik NayakNov 15, 2025
  31. Junio C HamanoNov 17, 2025
  32. Karthik NayakNov 17, 2025
  33. 0/3 fetch: fix non-conflicting tags not being committedKarthik Nayak, Nov 18, 2025
  34. 1/3 fetch: extract out reference committing logicKarthik Nayak, Nov 18, 2025
  35. 2/3 fetch: fix non-conflicting tags not being committedKarthik Nayak, Nov 18, 2025
  36. 3/3 fetch: fix failed batched updates skipping operationsKarthik Nayak, Nov 18, 2025
  37. Junio C HamanoNov 18, 2025
  38. Karthik NayakNov 19, 2025
  39. 0/3 fetch: fix non-conflicting tags not being committedKarthik Nayak, Nov 19, 2025
  40. 1/3 fetch: extract out reference committing logicKarthik Nayak, Nov 19, 2025
  41. 2/3 fetch: fix non-conflicting tags not being committedKarthik Nayak, Nov 19, 2025
  42. 3/3 fetch: fix failed batched updates skipping operationsKarthik Nayak, Nov 19, 2025
  43. Eric SunshineNov 19, 2025
  44. Junio C HamanoNov 19, 2025
  45. Karthik NayakNov 21, 2025
  46. 0/3 fetch: fix non-conflicting tags not being committedKarthik Nayak, Nov 21, 2025
  47. 1/3 fetch: extract out reference committing logicKarthik Nayak, Nov 21, 2025
  48. 2/3 fetch: fix non-conflicting tags not being committedKarthik Nayak, Nov 21, 2025
  49. Patrick SteinhardtDec 1, 2025
  50. Karthik NayakDec 2, 2025
  51. 3/3 fetch: fix failed batched updates skipping operationsKarthik Nayak, Nov 21, 2025
  52. Patrick SteinhardtDec 1, 2025
  53. Karthik NayakDec 2, 2025
  54. Junio C HamanoNov 21, 2025

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.