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

Re: [PATCH v3 0/4] refs: run copy and rename through transactions

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 7, 2026, 19:55 UTC
Message-ID
<xmqq8q4970ah.fsf@gitster.g>
In-Reply-To
<cover.1791395643.git.maciej.ciemborowicz@gmail.com>
Maciej Ciemborowicz <maciej.ciemborowicz@gmail.com> writes:
Show 29 quoted lines
> Reference copy and rename bypass the transaction API. With files, the
> reference-transaction hook sees only the source deletion; with reftable,
> it sees neither endpoint. This series puts the logical ref updates and
> the reflog history into ordinary transactions so hooks can observe and
> reject the complete operation.
> ...
>  Documentation/githooks.adoc     |  10 +
>  refs.c                          | 200 ++++++++-
>  refs.h                          |  25 ++
>  refs/debug.c                    |  24 --
>  refs/files-backend.c            | 739 +++++++++++++++++---------------
>  refs/packed-backend.c           |   2 -
>  refs/refs-internal.h            |  28 +-
>  refs/reftable-backend.c         | 334 ++-------------
>  t/helper/test-ref-store.c       |  76 ++++
>  t/perf/p1424-ref-copy-rename.sh |  48 +++
>  t/t1424-ref-copy-transaction.sh | 352 +++++++++++++++
>  t/t1425-reflog-transaction.sh   |  59 +++
>  12 files changed, 1206 insertions(+), 691 deletions(-)
>  create mode 100755 t/perf/p1424-ref-copy-rename.sh
>  create mode 100755 t/t1424-ref-copy-transaction.sh
>  create mode 100755 t/t1425-reflog-transaction.sh
>
> Range-diff against v2:
> 1:  d852537d8c < -:  ---------- refs: run copy and rename through transactions
> -:  ---------- > 1:  6d7c146e57 refs: distinguish internal transactions from logical updates
> -:  ---------- > 2:  5c3ec4eb49 refs: support replacing reflogs in a transaction
> -:  ---------- > 3:  77af4e809c refs: run copy and rename through ordinary transactions
> -:  ---------- > 4:  83fa644fb3 refs: remove backend-specific copy and rename callbacks

I do not think I have time to read these humoungous patches, some of which weigh more than 1000+ lines, with fine toothed comb any time soon, but when applied to the recent tip of master 6de20f6092 (The 4th batch, 2026-10-06), it seems to break t0600 and t5510. The failing tests do not seem to be anything so system specific (and I am on a GNU/Linux platform that is not anything remarkable).

I wonder what I am doing differently. Did they pass for you? Here are the first failure from these test scripts.

Thanks.
expecting success of 0600.16 'delete fails cleanly if packed-refs.new write fails':
        # Setup and expectations are similar to the test above.
        prefix=refs/failed-packed-refs &&
        git update-ref $prefix/foo $C &&
        git pack-refs --all &&
        git update-ref $prefix/foo $D &&
        git for-each-ref $prefix >unchanged &&
        # This should not happen in practice, but it is an easy way to get a
        # reliable error (we open with create_tempfile(), which uses O_EXCL).
        : >.git/packed-refs.new &&
        test_when_finished "rm -f .git/packed-refs.new" &&
        test_must_fail git update-ref -d $prefix/foo &&
        git for-each-ref $prefix >actual &&
        test_cmp unchanged actual

test_must_fail: command succeeded: git update-ref -d refs/failed-packed-refs/foo not ok 16 - delete fails cleanly if packed-refs.new write fails

expecting success of 5510.35 'fetch --prune fails to delete branches':
        git clone . prune-fail &&
        (
                cd prune-fail &&
                git update-ref refs/remotes/origin/extrabranch main &&
                git pack-refs --all &&
                : this will prevent --prune from locking packed-refs for deleting refs, but adding loose refs still succeeds  &&
                >.git/packed-refs.new &&
                test_must_fail git fetch --prune origin
        )
Cloning into 'prune-fail'...
done.
From /usr/local/google/home/jch/w/git.git/t/trash directory.t5510-fetch/.
 - [deleted]         (none)     -> origin/extrabranch
test_must_fail: command succeeded: git fetch --prune origin
not ok 35 - fetch --prune fails to delete branches
Previous: Maciej CiemborowiczNext: Maciej Ciemborowicz
Message 17 of 35 in “[BUG] reference-transaction hook misses destination of git branch -m”
  1. Maciej CiemborowiczSep 19, 2026
  2. Karthik NayakSep 19, 2026
  3. refs: run copy and rename through transactionsMaciej Ciemborowicz, Sep 20, 2026
  4. Junio C HamanoSep 21, 2026
  5. Junio C HamanoSep 21, 2026
  6. Maciej CiemborowiczSep 22, 2026
  7. refs: run copy and rename through transactionsMaciej Ciemborowicz, Sep 23, 2026
  8. Maciej CiemborowiczSep 30, 2026
  9. Patrick SteinhardtOct 2, 2026
  10. Maciej CiemborowiczOct 2, 2026
  11. Patrick SteinhardtOct 5, 2026
  12. 0/4 refs: run copy and rename through transactionsMaciej Ciemborowicz, Oct 7, 2026
  13. 1/4 refs: distinguish internal transactions from logical updatesMaciej Ciemborowicz, Oct 7, 2026
  14. 2/4 refs: support replacing reflogs in a transactionMaciej Ciemborowicz, Oct 7, 2026
  15. 3/4 refs: run copy and rename through ordinary transactionsMaciej Ciemborowicz, Oct 7, 2026
  16. 4/4 refs: remove backend-specific copy and rename callbacksMaciej Ciemborowicz, Oct 7, 2026
  17. Junio C HamanoOct 7, 2026
  18. 0/4 refs: run copy and rename through transactionsMaciej Ciemborowicz, Oct 8, 2026
  19. 1/4 refs: distinguish internal transactions from logical updatesMaciej Ciemborowicz, Oct 8, 2026
  20. 2/4 refs: support replacing reflogs in a transactionMaciej Ciemborowicz, Oct 8, 2026
  21. 3/4 refs: run copy and rename through ordinary transactionsMaciej Ciemborowicz, Oct 8, 2026
  22. 4/4 refs: remove backend-specific copy and rename callbacksMaciej Ciemborowicz, Oct 8, 2026
  23. Patrick SteinhardtOct 8, 2026
  24. Maciej CiemborowiczOct 8, 2026
  25. Maciej CiemborowiczOct 8, 2026
  26. Junio C HamanoOct 8, 2026
  27. Maciej CiemborowiczOct 8, 2026
  28. Kristoffer HaugsbakkOct 8, 2026
  29. Maciej CiemborowiczOct 8, 2026
  30. Patrick SteinhardtOct 9, 2026
  31. brian m. carlsonOct 10, 2026
  32. Junio C HamanoOct 8, 2026
  33. Karthik NayakOct 9, 2026
  34. Maciej CiemborowiczOct 10, 2026
  35. Maciej CiemborowiczSep 23, 2026

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.