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 actualtest_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