Git development
 help / color / mirror / Atom feed
* [PATCH 06/11] reftable/block: fix OOB read with bogus block size
From: Patrick Steinhardt @ 2026-06-24  8:23 UTC (permalink / raw)
  To: git; +Cc: oxsignal
In-Reply-To: <20260624-pks-reftable-hardening-v1-0-66e4ce87c6b9@pks.im>

The block size is read from the block header, which is untrusted data.
We use it without verification to access the restart count at the end of
the block as well as to compute the restart table offset. With a bogus
block size that exceeds the data we have actually read this can lead to
an out-of-bounds read:

  ==1458284==ERROR: AddressSanitizer: SEGV on unknown address 0x7d8ff7de4b7d (pc 0x55555598c339 bp 0x7fffffff4ef0 sp 0x7fffffff4eb0 T0)
  ==1458284==The signal is caused by a READ memory access.
      #0 0x55555598c339 in reftable_get_be16 ./build/../reftable/basics.h:118:9
      #1 0x55555598bee2 in reftable_block_init ./build/../reftable/block.c:344:18
      #2 0x555555813e0e in test_reftable_block__corrupt_block_size ./build/../t/unit-tests/u-reftable-block.c:540:8
      #3 0x5555557f684e in clar_run_test ./build/../t/unit-tests/clar/clar.c:335:3
      #4 0x5555557f2e69 in clar_run_suite ./build/../t/unit-tests/clar/clar.c:431:3
      #5 0x5555557f2882 in clar_test_run ./build/../t/unit-tests/clar/clar.c:636:4
      #6 0x5555557f375f in clar_test ./build/../t/unit-tests/clar/clar.c:687:11
      #7 0x5555557fa49d in cmd_main ./build/../t/unit-tests/unit-test.c:62:8
      #8 0x55555584b55a in main ./build/../common-main.c:9:11
      #9 0x7ffff7a2b284 in __libc_start_call_main (/nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib/libc.so.6+0x2b284) (BuildId: 8ae0b698f2d4e727f569f64bb166e08ae30bd077)
      #10 0x7ffff7a2b337 in __libc_start_main@GLIBC_2.2.5 (/nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib/libc.so.6+0x2b337) (BuildId: 8ae0b698f2d4e727f569f64bb166e08ae30bd077)
      #11 0x555555694c24 in _start (./build/t/unit-tests+0x140c24)

  ==1458284==Register values:
  rax = 0x00007d8ff7de4b7d  rbx = 0x00007fffffff4f00  rcx = 0x0000000000000006  rdx = 0x0000000000000010
  rdi = 0x00007d8ff7de4b7d  rsi = 0x00007bfff5cf0420  rbp = 0x00007fffffff4ef0  rsp = 0x00007fffffff4eb0
   r8 = 0x00000f807eb960b8   r9 = 0x0000000000000001  r10 = 0x00007bfff5cf05e7  r11 = 0x000000000000000f
  r12 = 0x00007fffffff58f8  r13 = 0x0000000000000001  r14 = 0x0000555555ee8160  r15 = 0x0000000000000000
  AddressSanitizer can not provide additional info.

Verify that the claimed block size fits into the block data before using
it.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 reftable/block.c                |  9 +++++++++
 t/unit-tests/u-reftable-block.c | 45 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/reftable/block.c b/reftable/block.c
index b86cb9ec5a..4d6b11c2e7 100644
--- a/reftable/block.c
+++ b/reftable/block.c
@@ -340,6 +340,15 @@ int reftable_block_init(struct reftable_block *block,
 		full_block_size = block_size;
 	}
 
+	/*
+	 * Ensure that we have sufficient data available now to satisfy the
+	 * claimed block size.
+	 */
+	if (block_size > block->block_data.len) {
+		err = REFTABLE_FORMAT_ERROR;
+		goto done;
+	}
+
 	restart_count = reftable_get_be16(block->block_data.data + block_size - 2);
 	restart_off = block_size - 2 - 3 * restart_count;
 
diff --git a/t/unit-tests/u-reftable-block.c b/t/unit-tests/u-reftable-block.c
index 40274af5c0..1f35aed91a 100644
--- a/t/unit-tests/u-reftable-block.c
+++ b/t/unit-tests/u-reftable-block.c
@@ -500,3 +500,48 @@ void test_reftable_block__corrupt_log_block_size(void)
 	block_writer_release(&writer);
 	reftable_buf_release(&data);
 }
+
+void test_reftable_block__corrupt_block_size(void)
+{
+	struct reftable_block_source source = { 0 };
+	struct block_writer writer = {
+		.last_key = REFTABLE_BUF_INIT,
+	};
+	struct reftable_record rec = {
+		.type = REFTABLE_BLOCK_TYPE_REF,
+		.u.ref = {
+			.value_type = REFTABLE_REF_VAL1,
+			.refname = (char *) "refs/heads/main",
+		},
+	};
+	struct reftable_block block = { 0 };
+	struct reftable_buf data;
+
+	data.len = 1024;
+	REFTABLE_CALLOC_ARRAY(data.buf, data.len);
+	cl_assert(data.buf != NULL);
+
+	cl_must_pass(block_writer_init(&writer, REFTABLE_BLOCK_TYPE_REF,
+				       (uint8_t *) data.buf, data.len,
+				       0, hash_size(REFTABLE_HASH_SHA1)));
+	cl_must_pass(block_writer_add(&writer, &rec));
+	cl_assert(block_writer_finish(&writer) > 0);
+
+	/*
+	 * The block size is stored as a big-endian 24-bit integer right after
+	 * the one-byte block type at the start of the block. Corrupt it to
+	 * claim a size that is larger than the data we actually have. Reading
+	 * the restart count and restart table relative to such a bogus block
+	 * size must not access out-of-bounds memory.
+	 */
+	reftable_put_be24((uint8_t *) data.buf + 1, 0xffffff);
+
+	block_source_from_buf(&source, &data);
+	cl_assert_equal_i(reftable_block_init(&block, &source, 0, 0, data.len,
+					      REFTABLE_HASH_SIZE_SHA1, REFTABLE_BLOCK_TYPE_REF),
+			  REFTABLE_FORMAT_ERROR);
+
+	reftable_block_release(&block);
+	block_writer_release(&writer);
+	reftable_buf_release(&data);
+}

-- 
2.55.0.rc1.745.g43192e7977.dirty


^ permalink raw reply related

* [PATCH 05/11] reftable/block: fix OOB write with bogus inflated log size
From: Patrick Steinhardt @ 2026-06-24  8:23 UTC (permalink / raw)
  To: git; +Cc: oxsignal
In-Reply-To: <20260624-pks-reftable-hardening-v1-0-66e4ce87c6b9@pks.im>

The "log" reftable block stores reflog information. This information is
compressed using zlib. The inflated size is stored in the block header
so that callers can easily learn ahead of time how large of a buffer
they have to allocate to inflate the data in a single pass. So to
reconstruct the full inflated block we:

  - Copy over the header as-is, as it's not deflated.

  - Append the inflated data to the buffer.

The inflated block size stored in the header also includes the length of
the header itself. So to figure out the bytes that should be inflated by
zlib we need to subtract the header size, which is trusted data, from
the block size, which is untrusted data derived from the block header.

While we do verify that we were able to inflate all data as expected, we
don't verify ahead of time that the encoded block length is larger than
the header length. This can lead to an underflow, which makes zlib
assume that it can write more data into the target buffer than we have
allocated. The result is an out-of-bounds write:

  ==1422297==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7c1ff6de5231 at pc 0x55555579a628 bp 0x7fffffff4f10 sp 0x7fffffff46d0
  WRITE of size 4 at 0x7c1ff6de5231 thread T0
      #0 0x55555579a627 in __asan_memcpy (./build/t/unit-tests+0x246627)
      #1 0x55555598b093 in reftable_block_init ./build/../reftable/block.c:277:3
      #2 0x555555813701 in test_reftable_block__corrupt_log_block_size ./build/../t/unit-tests/u-reftable-block.c:495:20
      #3 0x5555557f684e in clar_run_test ./build/../t/unit-tests/clar/clar.c:335:3
      #4 0x5555557f2e69 in clar_run_suite ./build/../t/unit-tests/clar/clar.c:431:3
      #5 0x5555557f2882 in clar_test_run ./build/../t/unit-tests/clar/clar.c:636:4
      #6 0x5555557f375f in clar_test ./build/../t/unit-tests/clar/clar.c:687:11
      #7 0x5555557fa49d in cmd_main ./build/../t/unit-tests/unit-test.c:62:8
      #8 0x55555584af4a in main ./build/../common-main.c:9:11
      #9 0x7ffff7a2b284 in __libc_start_call_main (/nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib/libc.so.6+0x2b284) (BuildId: 8ae0b698f2d4e727f569f64bb166e08ae30bd077)
      #10 0x7ffff7a2b337 in __libc_start_main@GLIBC_2.2.5 (/nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib/libc.so.6+0x2b337) (BuildId: 8ae0b698f2d4e727f569f64bb166e08ae30bd077)
      #11 0x555555694c24 in _start (./build/t/unit-tests+0x140c24)

  0x7c1ff6de5231 is located 0 bytes after 1-byte region [0x7c1ff6de5230,0x7c1ff6de5231)
  allocated by thread T0 here:
      #0 0x55555579db1b in realloc.part.0 asan_malloc_linux.cpp.o
      #1 0x5555559868d7 in reftable_realloc ./build/../reftable/basics.c:36:9
      #2 0x55555598a98f in reftable_alloc_grow ./build/../reftable/basics.h:229:10
      #3 0x55555598ae58 in reftable_block_init ./build/../reftable/block.c:269:3
      #4 0x555555813701 in test_reftable_block__corrupt_log_block_size ./build/../t/unit-tests/u-reftable-block.c:495:20
      #5 0x5555557f684e in clar_run_test ./build/../t/unit-tests/clar/clar.c:335:3
      #6 0x5555557f2e69 in clar_run_suite ./build/../t/unit-tests/clar/clar.c:431:3
      #7 0x5555557f2882 in clar_test_run ./build/../t/unit-tests/clar/clar.c:636:4
      #8 0x5555557f375f in clar_test ./build/../t/unit-tests/clar/clar.c:687:11
      #9 0x5555557fa49d in cmd_main ./build/../t/unit-tests/unit-test.c:62:8
      #10 0x55555584af4a in main ./build/../common-main.c:9:11
      #11 0x7ffff7a2b284 in __libc_start_call_main (/nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib/libc.so.6+0x2b284) (BuildId: 8ae0b698f2d4e727f569f64bb166e08ae30bd077)
      #12 0x7ffff7a2b337 in __libc_start_main@GLIBC_2.2.5 (/nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib/libc.so.6+0x2b337) (BuildId: 8ae0b698f2d4e727f569f64bb166e08ae30bd077)
      #13 0x555555694c24 in _start (./build/t/unit-tests+0x140c24)

  SUMMARY: AddressSanitizer: heap-buffer-overflow (./build/t/unit-tests+0x246627) in __asan_memcpy
  Shadow bytes around the buggy address:
    0x7c1ff6de4f80: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
    0x7c1ff6de5000: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
    0x7c1ff6de5080: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
    0x7c1ff6de5100: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
    0x7c1ff6de5180: fa fa fd fd fa fa fd fd fa fa fd fa fa fa fd fd
  =>0x7c1ff6de5200: fa fa 04 fa fa fa[01]fa fa fa fa fa fa fa fa fa
    0x7c1ff6de5280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
    0x7c1ff6de5300: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
    0x7c1ff6de5380: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
    0x7c1ff6de5400: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
    0x7c1ff6de5480: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  Shadow byte legend (one shadow byte represents 8 application bytes):
    Addressable:           00
    Partially addressable: 01 02 03 04 05 06 07
    Heap left redzone:       fa
    Freed heap region:       fd
    Stack left redzone:      f1
    Stack mid redzone:       f2
    Stack right redzone:     f3
    Stack after return:      f5
    Stack use after scope:   f8
    Global redzone:          f9
    Global init order:       f6
    Poisoned by user:        f7
    Container overflow:      fc
    Array cookie:            ac
    Intra object redzone:    bb
    ASan internal:           fe
    Left alloca redzone:     ca
    Right alloca redzone:    cb

Fix the bug by adding a sanity check and add a unit test.

Reported-by: oxsignal <awo@kakao.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 reftable/block.c                |  9 +++++++++
 t/unit-tests/u-reftable-block.c | 44 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+)

diff --git a/reftable/block.c b/reftable/block.c
index 920b3f4486..b86cb9ec5a 100644
--- a/reftable/block.c
+++ b/reftable/block.c
@@ -260,6 +260,15 @@ int reftable_block_init(struct reftable_block *block,
 			goto done;
 	}
 
+	/*
+	 * Verify that the block size covers at least the table header, block
+	 * header and the 2 byte restart counter.
+	 */
+	if (block_size < header_size + 4 + 2) {
+		err = REFTABLE_FORMAT_ERROR;
+		goto done;
+	}
+
 	if (block_type == REFTABLE_BLOCK_TYPE_LOG) {
 		uint32_t block_header_skip = 4 + header_size;
 		uLong dst_len = block_size - block_header_skip;
diff --git a/t/unit-tests/u-reftable-block.c b/t/unit-tests/u-reftable-block.c
index f4bded7d26..40274af5c0 100644
--- a/t/unit-tests/u-reftable-block.c
+++ b/t/unit-tests/u-reftable-block.c
@@ -456,3 +456,47 @@ void test_reftable_block__iterator(void)
 	block_writer_release(&writer);
 	reftable_buf_release(&data);
 }
+
+void test_reftable_block__corrupt_log_block_size(void)
+{
+	struct reftable_block_source source = { 0 };
+	struct block_writer writer = {
+		.last_key = REFTABLE_BUF_INIT,
+	};
+	struct reftable_record rec = {
+		.type = REFTABLE_BLOCK_TYPE_LOG,
+		.u.log = {
+			.refname = (char *) "refs/heads/main",
+			.update_index = 1,
+			.value_type = REFTABLE_LOG_UPDATE,
+		},
+	};
+	struct reftable_block block = { 0 };
+	struct reftable_buf data;
+
+	data.len = 1024;
+	REFTABLE_CALLOC_ARRAY(data.buf, data.len);
+	cl_assert(data.buf != NULL);
+
+	cl_must_pass(block_writer_init(&writer, REFTABLE_BLOCK_TYPE_LOG,
+				       (uint8_t *) data.buf, data.len,
+				       0, hash_size(REFTABLE_HASH_SHA1)));
+	cl_must_pass(block_writer_add(&writer, &rec));
+	cl_assert(block_writer_finish(&writer) > 0);
+
+	/*
+	 * Log blocks store their inflated size as a big-endian 24-bit integer
+	 * right after the one-byte block type. Rewrite it to claim a size that
+	 * is smaller than the block header.
+	 */
+	reftable_put_be24((uint8_t *) data.buf + 1, 1);
+
+	block_source_from_buf(&source, &data);
+	cl_assert_equal_i(reftable_block_init(&block, &source, 0, 0, data.len,
+					      REFTABLE_HASH_SIZE_SHA1, REFTABLE_BLOCK_TYPE_LOG),
+			  REFTABLE_FORMAT_ERROR);
+
+	reftable_block_release(&block);
+	block_writer_release(&writer);
+	reftable_buf_release(&data);
+}

-- 
2.55.0.rc1.745.g43192e7977.dirty


^ permalink raw reply related

* [PATCH 04/11] reftable/record: don't abort when decoding invalid ref value type
From: Patrick Steinhardt @ 2026-06-24  8:23 UTC (permalink / raw)
  To: git; +Cc: oxsignal
In-Reply-To: <20260624-pks-reftable-hardening-v1-0-66e4ce87c6b9@pks.im>

When decoding a ref record we read its value type from the block. In
case the type itself is invalid we call `abort()`. This is rather
heavy-handed though: the data we're reading is untrusted, so we should
treat the issue as a normal and not as a programming error.

Fix this by handling the error gracefully. Note that this also requires
us to set the value type later, as otherwise we might store an invalid
type in the record.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 reftable/record.c                |  6 +++---
 t/unit-tests/u-reftable-record.c | 24 ++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/reftable/record.c b/reftable/record.c
index fcd387ba5d..1fce441930 100644
--- a/reftable/record.c
+++ b/reftable/record.c
@@ -388,7 +388,6 @@ static int reftable_ref_record_decode(void *rec, struct reftable_buf key,
 	r->refname[key.len] = 0;
 
 	r->update_index = update_index;
-	r->value_type = val_type;
 	switch (val_type) {
 	case REFTABLE_REF_VAL1:
 		if (in.len < hash_size) {
@@ -426,9 +425,10 @@ static int reftable_ref_record_decode(void *rec, struct reftable_buf key,
 	case REFTABLE_REF_DELETION:
 		break;
 	default:
-		abort();
-		break;
+		err = REFTABLE_FORMAT_ERROR;
+		goto done;
 	}
+	r->value_type = val_type;
 
 	return start.len - in.len;
 
diff --git a/t/unit-tests/u-reftable-record.c b/t/unit-tests/u-reftable-record.c
index 1bf2e170dc..9c95083ef4 100644
--- a/t/unit-tests/u-reftable-record.c
+++ b/t/unit-tests/u-reftable-record.c
@@ -11,6 +11,7 @@
 #include "reftable/basics.h"
 #include "reftable/constants.h"
 #include "reftable/record.h"
+#include "reftable/reftable-error.h"
 
 static void t_copy(struct reftable_record *rec)
 {
@@ -202,6 +203,29 @@ void test_reftable_record__ref_record_roundtrip(void)
 	reftable_buf_release(&scratch);
 }
 
+void test_reftable_record__ref_record_decode_invalid_value_type(void)
+{
+	struct reftable_buf scratch = REFTABLE_BUF_INIT;
+	struct reftable_record out = {
+		.type = REFTABLE_BLOCK_TYPE_REF,
+	};
+	struct reftable_buf key = REFTABLE_BUF_INIT;
+	uint8_t buffer[1024] = { 0 };
+	struct string_view dest = {
+		.buf = buffer,
+		.len = sizeof(buffer),
+	};
+
+	cl_must_pass(reftable_buf_addstr(&key, "refs/heads/master"));
+	cl_assert_equal_i(reftable_record_decode(&out, key, REFTABLE_NR_REF_VALUETYPES,
+						 dest, REFTABLE_HASH_SIZE_SHA1, &scratch),
+			  REFTABLE_FORMAT_ERROR);
+
+	reftable_record_release(&out);
+	reftable_buf_release(&key);
+	reftable_buf_release(&scratch);
+}
+
 void test_reftable_record__log_record_comparison(void)
 {
 	struct reftable_record in[3] = {

-- 
2.55.0.rc1.745.g43192e7977.dirty


^ permalink raw reply related

* [PATCH 03/11] reftable/basics: fix OOB read on binary search of empty range
From: Patrick Steinhardt @ 2026-06-24  8:23 UTC (permalink / raw)
  To: git; +Cc: oxsignal
In-Reply-To: <20260624-pks-reftable-hardening-v1-0-66e4ce87c6b9@pks.im>

`binsearch()` performs a binary search over a range of `sz` elements by
repeatedly calling the comparison function with indices into that range.
When the range is empty though, there is no valid index to call the
comparison function with. We still end up executing the comparison
function though with an index of 0, which of course will cause an
out-of-bounds read.

Return early when the range is empty.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 reftable/basics.c                |  3 +++
 t/unit-tests/u-reftable-basics.c | 11 +++++++++++
 2 files changed, 14 insertions(+)

diff --git a/reftable/basics.c b/reftable/basics.c
index e969927b61..f0442a46cf 100644
--- a/reftable/basics.c
+++ b/reftable/basics.c
@@ -152,6 +152,9 @@ size_t binsearch(size_t sz, int (*f)(size_t k, void *args), void *args)
 	size_t lo = 0;
 	size_t hi = sz;
 
+	if (!sz)
+		return 0;
+
 	/* Invariants:
 	 *
 	 *  (hi == sz) || f(hi) == true
diff --git a/t/unit-tests/u-reftable-basics.c b/t/unit-tests/u-reftable-basics.c
index 73566ed0eb..c5d83b6714 100644
--- a/t/unit-tests/u-reftable-basics.c
+++ b/t/unit-tests/u-reftable-basics.c
@@ -60,6 +60,17 @@ void test_reftable_basics__binsearch(void)
 	}
 }
 
+static int unreachable_lesseq(size_t i UNUSED, void *args UNUSED)
+{
+	cl_fail("comparison function called for empty range");
+	return 0;
+}
+
+void test_reftable_basics__binsearch_empty(void)
+{
+	cl_assert_equal_i(binsearch(0, &unreachable_lesseq, NULL), 0);
+}
+
 void test_reftable_basics__names_length(void)
 {
 	const char *a[] = { "a", "b", NULL };

-- 
2.55.0.rc1.745.g43192e7977.dirty


^ permalink raw reply related

* [PATCH 02/11] oss-fuzz: add fuzzer for parsing reftables
From: Patrick Steinhardt @ 2026-06-24  8:23 UTC (permalink / raw)
  To: git; +Cc: oxsignal
In-Reply-To: <20260624-pks-reftable-hardening-v1-0-66e4ce87c6b9@pks.im>

Add a new fuzzer that exercises our parsing of reftables. Fallout from
this fuzzer will be fixed over subsequent commits.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 Makefile                            |  1 +
 ci/run-build-and-minimal-fuzzers.sh |  1 +
 oss-fuzz/.gitignore                 |  1 +
 oss-fuzz/fuzz-reftable.c            | 74 +++++++++++++++++++++++++++++++++++++
 oss-fuzz/meson.build                |  1 +
 5 files changed, 78 insertions(+)

diff --git a/Makefile b/Makefile
index 1cec251f43..89d3edd5ea 100644
--- a/Makefile
+++ b/Makefile
@@ -2599,6 +2599,7 @@ FUZZ_OBJS += oss-fuzz/fuzz-date.o
 FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o
 FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o
 FUZZ_OBJS += oss-fuzz/fuzz-parse-attr-line.o
+FUZZ_OBJS += oss-fuzz/fuzz-reftable.o
 FUZZ_OBJS += oss-fuzz/fuzz-url-decode-mem.o
 .PHONY: fuzz-objs
 fuzz-objs: $(FUZZ_OBJS)
diff --git a/ci/run-build-and-minimal-fuzzers.sh b/ci/run-build-and-minimal-fuzzers.sh
index e7b97952e7..37b24b092d 100755
--- a/ci/run-build-and-minimal-fuzzers.sh
+++ b/ci/run-build-and-minimal-fuzzers.sh
@@ -21,6 +21,7 @@ date
 pack-headers
 pack-idx
 parse-attr-line
+reftable
 url-decode-mem
 "
 
diff --git a/oss-fuzz/.gitignore b/oss-fuzz/.gitignore
index f2d74de457..dc7a127a62 100644
--- a/oss-fuzz/.gitignore
+++ b/oss-fuzz/.gitignore
@@ -5,4 +5,5 @@ fuzz-date
 fuzz-pack-headers
 fuzz-pack-idx
 fuzz-parse-attr-line
+fuzz-reftable
 fuzz-url-decode-mem
diff --git a/oss-fuzz/fuzz-reftable.c b/oss-fuzz/fuzz-reftable.c
new file mode 100644
index 0000000000..c46eac2c6b
--- /dev/null
+++ b/oss-fuzz/fuzz-reftable.c
@@ -0,0 +1,74 @@
+#include "git-compat-util.h"
+#include "reftable/basics.h"
+#include "reftable/blocksource.h"
+#include "reftable/reftable-blocksource.h"
+#include "reftable/reftable-error.h"
+#include "reftable/reftable-iterator.h"
+#include "reftable/reftable-record.h"
+#include "reftable/reftable-table.h"
+#include "reftable/reftable-writer.h"
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
+	struct reftable_block_source source = { 0 };
+	struct reftable_buf buf = REFTABLE_BUF_INIT;
+	struct reftable_table *table = NULL;
+	int err;
+
+	if (reftable_buf_add(&buf, (const char *)data, size) < 0)
+		goto out;
+	block_source_from_buf(&source, &buf);
+
+	err = reftable_table_new(&table, &source, "fuzz-input");
+	if (err < 0)
+		goto out;
+
+	/*
+	 * Exercise the ref, log and raw block iterators so that we cover as
+	 * much of the parsing code as possible.
+	 */
+	{
+		struct reftable_ref_record ref = { 0 };
+		struct reftable_iterator it = { 0 };
+
+		reftable_table_init_ref_iterator(table, &it);
+		if (!reftable_iterator_seek_ref(&it, ""))
+			while (!reftable_iterator_next_ref(&it, &ref))
+				;
+
+		reftable_ref_record_release(&ref);
+		reftable_iterator_destroy(&it);
+	}
+
+	{
+		struct reftable_log_record log = { 0 };
+		struct reftable_iterator it = { 0 };
+
+		reftable_table_init_log_iterator(table, &it);
+		if (!reftable_iterator_seek_log(&it, ""))
+			while (!reftable_iterator_next_log(&it, &log))
+				;
+
+		reftable_log_record_release(&log);
+		reftable_iterator_destroy(&it);
+	}
+
+	{
+		struct reftable_table_iterator it = { 0 };
+		const struct reftable_block *block;
+
+		if (!reftable_table_iterator_init(&it, table))
+			while (!reftable_table_iterator_next(&it, &block))
+				;
+
+		reftable_table_iterator_release(&it);
+	}
+
+out:
+	if (table)
+		reftable_table_decref(table);
+	reftable_buf_release(&buf);
+	return 0;
+}
diff --git a/oss-fuzz/meson.build b/oss-fuzz/meson.build
index 10bcac2f6d..5a3854256b 100644
--- a/oss-fuzz/meson.build
+++ b/oss-fuzz/meson.build
@@ -6,6 +6,7 @@ fuzz_programs = [
   'fuzz-pack-headers.c',
   'fuzz-pack-idx.c',
   'fuzz-parse-attr-line.c',
+  'fuzz-reftable.c',
   'fuzz-url-decode-mem.c',
 ]
 

-- 
2.55.0.rc1.745.g43192e7977.dirty


^ permalink raw reply related

* [PATCH 01/11] meson: support building fuzzers with libFuzzer
From: Patrick Steinhardt @ 2026-06-24  8:23 UTC (permalink / raw)
  To: git; +Cc: oxsignal
In-Reply-To: <20260624-pks-reftable-hardening-v1-0-66e4ce87c6b9@pks.im>

To support fuzzing via libFuzzer one has to pass a couple of compiler
options:

  - It is mandatory to enable the "fuzzer-no-link" sanitizer for
    coverage feedback.

  - It is recommended to enable at least one more sanitizer to catch
    issues, like the "address" sanitizer.

  - The fuzzing executables need to be linked with "-fsanitize=fuzzer"
    to wire up libFuzzer itself.

The first two items can already be achieved via the "-Db_sanitize="
option. But the last item cannot easily be achieved, as we can only
configure global link arguments.

Introduce a new "-Dfuzzers_link_args=" build option to plug this gap.
Add documentation so that users know how to set up libFuzzer.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 meson.build          | 15 +++++++++++++++
 meson_options.txt    |  2 ++
 oss-fuzz/meson.build |  1 +
 3 files changed, 18 insertions(+)

diff --git a/meson.build b/meson.build
index 3247697f74..9df6fbb0a5 100644
--- a/meson.build
+++ b/meson.build
@@ -161,6 +161,21 @@
 # These machine files can be passed to `meson setup` via the `--native-file`
 # option.
 #
+# Fuzzing
+# =======
+#
+# Meson supports building the fuzzing targets by setting `-Dfuzzers=true`. By
+# default, the targets will be built without libFuzzer and thus won't be usable
+# for fuzzing. You have to configure a couple of options to properly wire up
+# libFuzzer:
+#
+#   $ meson setup build-fuzzers \
+#       -Db_sanitize=address,fuzzer-no-link \
+#       -Dfuzzers=true \
+#       -Dfuzzers_link_args=-fsanitize=fuzzer
+#   $ meson compile -C build-fuzzers
+#   $ ./build-fuzzers/oss-fuzz/fuzz-config <args>
+#
 # Cross compilation
 # =================
 #
diff --git a/meson_options.txt b/meson_options.txt
index d936ada098..dc88f130d7 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -131,3 +131,5 @@ option('test_utf8_locale', type: 'string',
   description: 'Name of a UTF-8 locale used for testing.')
 option('fuzzers', type: 'boolean', value: false,
   description: 'Enable building fuzzers.')
+option('fuzzers_link_args', type: 'array', value: [],
+  description: 'Linker arguments used to link fuzzers. Use -fsanitize=fuzzer for fuzzing.')
diff --git a/oss-fuzz/meson.build b/oss-fuzz/meson.build
index 878afd8426..10bcac2f6d 100644
--- a/oss-fuzz/meson.build
+++ b/oss-fuzz/meson.build
@@ -16,5 +16,6 @@ foreach fuzz_program : fuzz_programs
       fuzz_program,
     ],
     dependencies: [libgit_commonmain],
+    link_args: get_option('fuzzers_link_args'),
   )
 endforeach

-- 
2.55.0.rc1.745.g43192e7977.dirty


^ permalink raw reply related

* [PATCH 00/11] reftable: harden against corrupted tables
From: Patrick Steinhardt @ 2026-06-24  8:23 UTC (permalink / raw)
  To: git; +Cc: oxsignal

Hi,

this patch series addresses a bunch of errors that may happen when
trying to read corrupted tables. These errors include out-of-bounds
writes, out-of-bounds reads and the ability to hit abort(3p) calls.

The out-of-bounds write was originally reported by awo on the security
mailing list. As we never transfer reftables over the protocol it would
require local disk access to create such corrupted reftables, so there
isn't really an easy way to exploit these.

In any case, I took that chance and wrote a fuzzer for parsing the
tables, which surfaced a bunch of issues. At the end of this series
though the fuzzer can now run for an extended amount of time (2hrs+)
without surfacing any new issues.

Thanks!

Patrick

---
Patrick Steinhardt (11):
      meson: support building fuzzers with libFuzzer
      oss-fuzz: add fuzzer for parsing reftables
      reftable/basics: fix OOB read on binary search of empty range
      reftable/record: don't abort when decoding invalid ref value type
      reftable/block: fix OOB write with bogus inflated log size
      reftable/block: fix OOB read with bogus block size
      reftable/block: fix OOB read with bogus restart count
      reftable/block: fix use of uninitialized memory when binsearch fails
      reftable/block: fix OOB read with bogus restart offset
      reftable/table: fix NULL pointer access when seeking to bogus offsets
      reftable/table: fix OOB read on truncated table

 Makefile                            |   1 +
 ci/run-build-and-minimal-fuzzers.sh |   1 +
 meson.build                         |  15 +++
 meson_options.txt                   |   2 +
 oss-fuzz/.gitignore                 |   1 +
 oss-fuzz/fuzz-reftable.c            |  74 ++++++++++++++
 oss-fuzz/meson.build                |   2 +
 reftable/basics.c                   |   3 +
 reftable/block.c                    |  39 +++++++-
 reftable/record.c                   |   6 +-
 reftable/table.c                    |   7 ++
 t/unit-tests/u-reftable-basics.c    |  11 +++
 t/unit-tests/u-reftable-block.c     | 186 ++++++++++++++++++++++++++++++++++++
 t/unit-tests/u-reftable-record.c    |  24 +++++
 t/unit-tests/u-reftable-table.c     |  91 ++++++++++++++++++
 15 files changed, 456 insertions(+), 7 deletions(-)


---
base-commit: ab776a62a78576513ee121424adb19597fbb7613
change-id: 20260623-pks-reftable-hardening-f54de69fea63


^ permalink raw reply

* Re: [PATCH v3 4/4] notes: support an external command to display notes
From: Johannes Sixt @ 2026-06-24  7:49 UTC (permalink / raw)
  To: Siddh Raman Pant
  Cc: Kristoffer Haugsbakk, Junio C Hamano, Patrick Steinhardt,
	Elijah Newren, brian m. carlson, Jeff King, Oswald Buddenhagen,
	git
In-Reply-To: <7284a8bccb6bfb5734adb09f05ae4b61a63da2df.1779532562.git.siddh.raman.pant@oracle.com>

Am 23.05.26 um 12:38 schrieb Siddh Raman Pant:
> git notes is a very very helpful feature to show user-supplied
> information about a commit alongside its message transparently.
> 
> For distributed teams working on large git repos (huge number of
> branches/refs, files, etc.) and using the notes feature to mark
> information on git commits, the problem is often not that two users
> update the same note object at the same time. It is that the local
> notes state used while reading history can be stale.
> 
> In kernel work, the same logical upstream fix can appear as different
> commit objects across many downstream branches, such as the stable
> branches and vendor-specific branches (based on which the released
> kernel is actually built). Different developers may be working on those
> branches in parallel, and a review decision recorded for one backport
> is useful context for the others.
> 
> Today, seeing that decision in ordinary history output requires first
> synchronizing the local notes ref, and then interpreting those notes
> for the branch being inspected. The latter step is workflow-specific
> and can be cheap, but keeping the local notes state fresh enough can be
> expensive in a large kernel repository with a large shared notes
> history (and if we are to extrapolate, a slow git server conn/ops can
> be a factor too).
> 
> This TOCTOU problem exacerbates on scale (rapid updates, more devs,
> larger repos, more git server traffic, etc).
> 
> One solution to this is to move the freshness policy out of git so that
> it is someone else's problem. We can have a realtime fetch or faster
> updation via external helper means. But unfortunately we lose the
> coherence in the display of information, and so the user would end up
> reinventing git log in his quest to have same workflow.

You are presenting one solution here. But a more obvious solution would
have been to make Git's notes implementation capable enough to keep up
with the volume of notes that are produced by your team.

Another solution would be to track the information outside of Git notes
entirely, similar to how pull requests, issues, reviews, and
conversations are tracked by Git hosters in databases outside of Git.

> Let's add support for notes.externalCommand, a protected-configuration
> command that git runs as a long-lived helper when displaying notes. git
> sends commit IDs to the helper and displays any returned text through
> the existing notes formatting path. This keeps presentation in git
> while letting the helper decide how fresh note text is obtained.

To my eyes, this looks like an overengineered solution that helps one
user of a niche feature of Git.

-- Hannes


^ permalink raw reply

* Re: [PATCH] bundle-uri: drain remaining response on invalid bundle-uri lines
From: Toon Claes @ 2026-06-24  7:49 UTC (permalink / raw)
  To: Justin Tobler, Patrick Steinhardt; +Cc: git
In-Reply-To: <adkOJLfxs8TNGRjr@denethor>

Hi,

My apologies for digging up this old thread, but it was suddenly brought
back to my attention. Anyhow:

Justin Tobler <jltobler@gmail.com> writes:

> I think it is questionable for a Git server to be sending clients
> malformed bundle-uri configuration.

I will not argue about that.

> Do other Git implementations on the server-side exhibit this same
> behavior? If so, or we reasonably think they could and just want to be
> safe, then I agree that adjusting clients first to ignore invalid
> bundle-uri configuration from the server is reasonable.
>
> Generally, I'm of the mindset that when a server is sending
> malformed/garbage data that the client doesn't expect, the client should
> should be more strict and error out. In this case though, since there
> are known affected Git versions and bundle-uri is an optional feature to
> begin with, it probably doesn't hurt to be more permissive.

Yeah, that's the point I was trying to make. The use of bundle-uri is
optional, and clone can continue without it. The code was intentionally
written to continue when something goes wrong with bundle-uris. But
because of some underlaying issue I was trying to fix with this patch,
the process does not continue.

> On 26/04/10 08:31AM, Patrick Steinhardt wrote:

>> That being said, I also think that we should fix the server side.
>> Whether that needs to be part of this patch series though is a different
>> question. Based on the proposed patch you posted it seems to be trivial
>> enough though, so maybe it's worth it to just add that in as a second
>> patch.
>
> Ya, my main concern was that a client-side fix would mask its root
> cause. As long as it gets addressed though it's fine. I think it would
> be worth adding to this series, but if not I'm happy to send a follow up
> patch to fix it too.

I do not fully agree. My fix doesn't make the issue go away silently,
the user gets a warning message. I think this would cause (at least
some) users to complain to the owner of the server (especially because
bundle-URI is an opt-in feature). But I realize now, this warning isn't
checked in the tests, adding that would have made that more clear.

I do agree though a server-side fix would be advised. But I have no idea
how to best address this. In a previous mail you wrote:

> Naively, I would assume the easiest way to fix the issue on the
> server-side would be the following:
> 
> --- >8 ---
> diff --git a/bundle-uri.c b/bundle-uri.c
> index 3b2e347288..96d38bb80f 100644
> --- a/bundle-uri.c
> +++ b/bundle-uri.c
> @@ -946,7 +946,7 @@ static int config_to_packet_line(const char *key, const char *value,
>  {
>         struct packet_reader *writer = data;
> 
> -       if (starts_with(key, "bundle."))
> +       if (starts_with(key, "bundle.") && value && *value)
>                 packet_write_fmt(writer->fd, "%s=%s", key, value);
> 
>         return 0;
> ---- >8 ---
>
> A quick check using the tests provided in this patch seems to show them
> passing with the above. If we want, we could also have the server print
> a warning on its end regarding the missing value too.

I don't like this fix, because it papers over the issue, silently. But
then again, what is the best way to inform the server admin there's
something wrong? Adding one line to the log files is easily to be
missed.

-- 
Cheers,
Toon



^ permalink raw reply

* [PATCH 4/6] odb/transaction: propagate commit errors
From: Justin Tobler @ 2026-06-24  4:19 UTC (permalink / raw)
  To: git; +Cc: ps, Justin Tobler
In-Reply-To: <20260624041920.2601961-1-jltobler@gmail.com>

When `odb_transaction_commit()` is invoked, the return value of the
backend commit callback is silently discarded. A backend has no way
to signal that committing failed, such as when the "files" backend
cannot migrate its temporary object directory into the permanent
ODB.

In a subsequent commit, git-receive-pack(1) starts using ODB transaction
to stage objects and consequently cares about such failures so it can
handle the error appropriately. Change the commit callback signature to
return an int error code and have `odb_transaction_commit()` forward it
accordingly.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
---
 odb/transaction.c | 13 ++++++++++---
 odb/transaction.h |  2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/odb/transaction.c b/odb/transaction.c
index d3de01db50..b20d6a16f8 100644
--- a/odb/transaction.c
+++ b/odb/transaction.c
@@ -18,19 +18,26 @@ int odb_transaction_begin(struct object_database *odb,
 	return ret;
 }
 
-void odb_transaction_commit(struct odb_transaction *transaction)
+int odb_transaction_commit(struct odb_transaction *transaction)
 {
+	int ret;
+
 	if (!transaction)
-		return;
+		return 0;
 
 	/*
 	 * Ensure the transaction ending matches the pending transaction.
 	 */
 	ASSERT(transaction == transaction->source->odb->transaction);
 
-	transaction->commit(transaction);
+	ret = transaction->commit(transaction);
+	if (ret)
+		return ret;
+
 	transaction->source->odb->transaction = NULL;
 	free(transaction);
+
+	return 0;
 }
 
 int odb_transaction_write_object_stream(struct odb_transaction *transaction,
diff --git a/odb/transaction.h b/odb/transaction.h
index cd6d50f2e5..7898770071 100644
--- a/odb/transaction.h
+++ b/odb/transaction.h
@@ -54,7 +54,7 @@ static inline void odb_transaction_begin_or_die(struct object_database *odb,
  * Commits an ODB transaction making the written objects visible. If the
  * specified transaction is NULL, the function is a no-op.
  */
-void odb_transaction_commit(struct odb_transaction *transaction);
+int odb_transaction_commit(struct odb_transaction *transaction);
 
 /*
  * Writes the object in the provided stream into the transaction. The resulting
-- 
2.54.0.105.g59ff4886a5


^ permalink raw reply related

* [PATCH 6/6] builtin/receive-pack: stage incoming objects via ODB transactions
From: Justin Tobler @ 2026-06-24  4:19 UTC (permalink / raw)
  To: git; +Cc: ps, Justin Tobler
In-Reply-To: <20260624041920.2601961-1-jltobler@gmail.com>

Objects received by git-receive-pack(1) are quarantined in a temporary
"incoming" directory and migrated into the object database prior to the
reference updates. The quarantine is currently managed through
`tmp_objdir` directly. In a pluggable ODB future, how exactly an object
gets written to a transaction may vary for a given ODB source. Refactor
git-receive-pack(1) to use the ODB transaction interfaces to manage the
object staging area in a more agnostic manner accordingly.

Note that the temporary directory created for git-receive-pack(1) is
eagerly created and uses a different prefix name. This behavior is
special cased in the "files" backend by having `odb_transaction_begin()`
callers that require this behavior provide an `ODB_TRANSACTION_RECEIVE`
flag.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
---
 builtin/add.c            |  2 +-
 builtin/receive-pack.c   | 46 ++++++++++++++++------------------------
 builtin/unpack-objects.c |  2 +-
 builtin/update-index.c   |  2 +-
 cache-tree.c             |  2 +-
 object-file.c            | 22 ++++++++++++++++---
 object-file.h            |  4 +++-
 odb/source-files.c       |  5 +++--
 odb/source-inmemory.c    |  3 ++-
 odb/source-loose.c       |  3 ++-
 odb/source.h             |  9 +++++---
 odb/transaction.c        |  5 +++--
 odb/transaction.h        | 13 ++++++++----
 read-cache.c             |  2 +-
 14 files changed, 70 insertions(+), 50 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index 3d5d9cfdb9..60ffbede2b 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -581,7 +581,7 @@ int cmd_add(int argc,
 		string_list_clear(&only_match_skip_worktree, 0);
 	}
 
-	odb_transaction_begin_or_die(repo->objects, &transaction);
+	odb_transaction_begin_or_die(repo->objects, &transaction, 0);
 
 	ps_matched = xcalloc(pathspec.nr, 1);
 	if (add_renormalize)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 19eb6a1b61..ee8e03e2ab 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -112,8 +112,6 @@ static enum {
 } use_keepalive;
 static int keepalive_in_sec = 5;
 
-static struct tmp_objdir *tmp_objdir;
-
 static struct proc_receive_ref {
 	unsigned int want_add:1,
 		     want_delete:1,
@@ -959,8 +957,8 @@ static int run_receive_hook(struct command *commands,
 		strvec_push(&opt.env, "GIT_PUSH_OPTION_COUNT");
 	}
 
-	if (tmp_objdir)
-		strvec_pushv(&opt.env, tmp_objdir_env(tmp_objdir));
+	if (the_repository->objects->transaction)
+		strvec_pushv(&opt.env, odb_transaction_env(the_repository->objects->transaction));
 
 	prepare_push_cert_sha1(&opt);
 
@@ -1363,7 +1361,7 @@ static int update_shallow_ref(struct command *cmd, struct shallow_info *si)
 		    !delayed_reachability_test(si, i))
 			oid_array_append(&extra, &si->shallow->oid[i]);
 
-	opt.env = tmp_objdir_env(tmp_objdir);
+	opt.env = odb_transaction_env(the_repository->objects->transaction);
 	setup_alternate_shallow(&shallow_lock, &opt.shallow_file, &extra);
 	if (check_connected(command_singleton_iterator, cmd, &opt)) {
 		rollback_shallow_file(the_repository, &shallow_lock);
@@ -1802,7 +1800,7 @@ static void set_connectivity_errors(struct command *commands,
 			/* to be checked in update_shallow_ref() */
 			continue;
 
-		opt.env = tmp_objdir_env(tmp_objdir);
+		opt.env = odb_transaction_env(the_repository->objects->transaction);
 		if (!check_connected(command_singleton_iterator, &singleton,
 				     &opt))
 			continue;
@@ -2057,7 +2055,7 @@ static void execute_commands(struct command *commands,
 		data.si = si;
 		opt.err_fd = err_fd;
 		opt.progress = err_fd && !quiet;
-		opt.env = tmp_objdir_env(tmp_objdir);
+		opt.env = odb_transaction_env(the_repository->objects->transaction);
 		opt.exclude_hidden_refs_section = "receive";
 
 		if (check_connected(iterate_receive_command_list, &data, &opt))
@@ -2106,14 +2104,13 @@ static void execute_commands(struct command *commands,
 	 * Now we'll start writing out refs, which means the objects need
 	 * to be in their final positions so that other processes can see them.
 	 */
-	if (tmp_objdir_migrate(tmp_objdir) < 0) {
+	if (odb_transaction_commit(the_repository->objects->transaction)) {
 		for (cmd = commands; cmd; cmd = cmd->next) {
 			if (!cmd->error_string)
 				cmd->error_string = "unable to migrate objects to permanent storage";
 		}
 		return;
 	}
-	tmp_objdir = NULL;
 
 	check_aliased_updates(commands);
 
@@ -2326,7 +2323,8 @@ static void push_header_arg(struct strvec *args, struct pack_header *hdr)
 		     ntohl(hdr->hdr_version), ntohl(hdr->hdr_entries));
 }
 
-static const char *unpack(int err_fd, struct shallow_info *si)
+static const char *unpack(int err_fd, struct shallow_info *si,
+			  struct odb_transaction *transaction)
 {
 	struct pack_header hdr;
 	const char *hdr_err;
@@ -2351,20 +2349,7 @@ static const char *unpack(int err_fd, struct shallow_info *si)
 		strvec_push(&child.args, alt_shallow_file);
 	}
 
-	tmp_objdir = tmp_objdir_create(the_repository, "incoming");
-	if (!tmp_objdir) {
-		if (err_fd > 0)
-			close(err_fd);
-		return "unable to create temporary object directory";
-	}
-	strvec_pushv(&child.env, tmp_objdir_env(tmp_objdir));
-
-	/*
-	 * Normally we just pass the tmp_objdir environment to the child
-	 * processes that do the heavy lifting, but we may need to see these
-	 * objects ourselves to set up shallow information.
-	 */
-	tmp_objdir_add_as_alternate(tmp_objdir);
+	strvec_pushv(&child.env, odb_transaction_env(transaction));
 
 	if (ntohl(hdr.hdr_entries) < unpack_limit) {
 		strvec_push(&child.args, "unpack-objects");
@@ -2431,13 +2416,14 @@ static const char *unpack(int err_fd, struct shallow_info *si)
 	return NULL;
 }
 
-static const char *unpack_with_sideband(struct shallow_info *si)
+static const char *unpack_with_sideband(struct shallow_info *si,
+					struct odb_transaction *transaction)
 {
 	struct async muxer;
 	const char *ret;
 
 	if (!use_sideband)
-		return unpack(0, si);
+		return unpack(0, si, transaction);
 
 	use_keepalive = KEEPALIVE_AFTER_NUL;
 	memset(&muxer, 0, sizeof(muxer));
@@ -2446,7 +2432,7 @@ static const char *unpack_with_sideband(struct shallow_info *si)
 	if (start_async(&muxer))
 		return NULL;
 
-	ret = unpack(muxer.in, si);
+	ret = unpack(muxer.in, si, transaction);
 
 	finish_async(&muxer);
 	return ret;
@@ -2623,6 +2609,7 @@ int cmd_receive_pack(int argc,
 	struct oid_array ref = OID_ARRAY_INIT;
 	struct shallow_info si;
 	struct packet_reader reader;
+	struct odb_transaction *transaction = NULL;
 
 	struct option options[] = {
 		OPT__QUIET(&quiet, N_("quiet")),
@@ -2707,7 +2694,10 @@ int cmd_receive_pack(int argc,
 		if (!si.nr_ours && !si.nr_theirs)
 			shallow_update = 0;
 		if (!delete_only(commands)) {
-			unpack_status = unpack_with_sideband(&si);
+			if (odb_transaction_begin(the_repository->objects, &transaction, ODB_TRANSACTION_RECEIVE))
+				unpack_status = "unable to start ODB transaction";
+			else
+				unpack_status = unpack_with_sideband(&si, transaction);
 			update_shallow_info(commands, &si, &ref);
 		}
 		use_keepalive = KEEPALIVE_ALWAYS;
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index d0136cdd99..c3d0fc7507 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -598,7 +598,7 @@ static void unpack_all(void)
 		progress = start_progress(the_repository,
 					  _("Unpacking objects"), nr_objects);
 	CALLOC_ARRAY(obj_list, nr_objects);
-	odb_transaction_begin_or_die(the_repository->objects, &transaction);
+	odb_transaction_begin_or_die(the_repository->objects, &transaction, 0);
 	for (i = 0; i < nr_objects; i++) {
 		unpack_one(i);
 		display_progress(progress, i + 1);
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 17f3ea284c..bf6ea60ef4 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -1124,7 +1124,7 @@ int cmd_update_index(int argc,
 	 * Allow the object layer to optimize adding multiple objects in
 	 * a batch.
 	 */
-	odb_transaction_begin_or_die(the_repository->objects, &transaction);
+	odb_transaction_begin_or_die(the_repository->objects, &transaction, 0);
 	while (ctx.argc) {
 		if (parseopt_state != PARSE_OPT_DONE)
 			parseopt_state = parse_options_step(&ctx, options,
diff --git a/cache-tree.c b/cache-tree.c
index 1a7dfed9cf..ed05acc4c7 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -490,7 +490,7 @@ int cache_tree_update(struct index_state *istate, int flags)
 
 	trace_performance_enter();
 	trace2_region_enter("cache_tree", "update", istate->repo);
-	odb_transaction_begin_or_die(the_repository->objects, &transaction);
+	odb_transaction_begin_or_die(the_repository->objects, &transaction, 0);
 	i = update_one(istate->cache_tree, istate->cache, istate->cache_nr,
 		       "", 0, &skip, flags);
 	odb_transaction_commit(transaction);
diff --git a/object-file.c b/object-file.c
index 14064d188a..e7958753ec 100644
--- a/object-file.c
+++ b/object-file.c
@@ -497,6 +497,7 @@ struct odb_transaction_files {
 
 	struct tmp_objdir *objdir;
 	struct transaction_packfile packfile;
+	const char *prefix;
 };
 
 static int odb_transaction_files_prepare(struct odb_transaction *base)
@@ -513,7 +514,7 @@ static int odb_transaction_files_prepare(struct odb_transaction *base)
 	if (!transaction || transaction->objdir)
 		return 0;
 
-	transaction->objdir = tmp_objdir_create(base->source->odb->repo, "bulk-fsync");
+	transaction->objdir = tmp_objdir_create(base->source->odb->repo, transaction->prefix);
 	if (!transaction->objdir)
 		return -1;
 
@@ -1391,7 +1392,7 @@ int index_fd(struct index_state *istate, struct object_id *oid,
 			struct object_database *odb = the_repository->objects;
 			struct odb_transaction *transaction;
 
-			odb_transaction_begin_or_die(odb, &transaction);
+			odb_transaction_begin_or_die(odb, &transaction, 0);
 			ret = odb_transaction_write_object_stream(odb->transaction,
 								  &stream,
 								  xsize_t(st->st_size),
@@ -1702,7 +1703,8 @@ static const char **odb_transaction_files_env(struct odb_transaction *base)
 }
 
 int odb_transaction_files_begin(struct odb_source *source,
-				struct odb_transaction **out)
+				struct odb_transaction **out,
+				enum odb_transaction_flags flags)
 {
 	struct odb_transaction_files *transaction;
 	struct object_database *odb = source->odb;
@@ -1717,6 +1719,20 @@ int odb_transaction_files_begin(struct odb_source *source,
 	transaction->base.commit = odb_transaction_files_commit;
 	transaction->base.write_object_stream = odb_transaction_files_write_object_stream;
 	transaction->base.env = odb_transaction_files_env;
+
+	transaction->prefix = "bulk-fsync";
+	if (flags & ODB_TRANSACTION_RECEIVE) {
+		/*
+		 * ODB transactions for git-receive-pack(1) eagerly create a
+		 * temporary directory and use a different prefix.
+		 */
+		transaction->prefix = "incoming";
+		if (odb_transaction_files_prepare(&transaction->base)) {
+			free(transaction);
+			return -1;
+		}
+	}
+
 	*out = &transaction->base;
 
 	return 0;
diff --git a/object-file.h b/object-file.h
index ac927fec07..fe098d54cb 100644
--- a/object-file.h
+++ b/object-file.h
@@ -5,6 +5,7 @@
 #include "object.h"
 #include "odb.h"
 #include "odb/source-loose.h"
+#include "odb/transaction.h"
 
 /* The maximum size for an object header. */
 #define MAX_HEADER_LEN 32
@@ -198,6 +199,7 @@ struct odb_transaction;
  * pending, out is set to NULL.
  */
 int odb_transaction_files_begin(struct odb_source *source,
-				struct odb_transaction **out);
+				struct odb_transaction **out,
+				enum odb_transaction_flags flags);
 
 #endif /* OBJECT_FILE_H */
diff --git a/odb/source-files.c b/odb/source-files.c
index 2545bd81d4..534f48aad9 100644
--- a/odb/source-files.c
+++ b/odb/source-files.c
@@ -180,9 +180,10 @@ static int odb_source_files_write_object_stream(struct odb_source *source,
 }
 
 static int odb_source_files_begin_transaction(struct odb_source *source,
-					      struct odb_transaction **out)
+					      struct odb_transaction **out,
+					      enum odb_transaction_flags flags)
 {
-	return odb_transaction_files_begin(source, out);
+	return odb_transaction_files_begin(source, out, flags);
 }
 
 static int odb_source_files_read_alternates(struct odb_source *source,
diff --git a/odb/source-inmemory.c b/odb/source-inmemory.c
index e004566d76..9644d9d474 100644
--- a/odb/source-inmemory.c
+++ b/odb/source-inmemory.c
@@ -304,7 +304,8 @@ static int odb_source_inmemory_freshen_object(struct odb_source *source,
 }
 
 static int odb_source_inmemory_begin_transaction(struct odb_source *source UNUSED,
-						 struct odb_transaction **out UNUSED)
+						 struct odb_transaction **out UNUSED,
+						 enum odb_transaction_flags flags UNUSED)
 {
 	return error("in-memory source does not support transactions");
 }
diff --git a/odb/source-loose.c b/odb/source-loose.c
index 66e6bb8d3f..57c91986b4 100644
--- a/odb/source-loose.c
+++ b/odb/source-loose.c
@@ -638,7 +638,8 @@ static int odb_source_loose_write_object_stream(struct odb_source *source,
 }
 
 static int odb_source_loose_begin_transaction(struct odb_source *source UNUSED,
-					      struct odb_transaction **out UNUSED)
+					      struct odb_transaction **out UNUSED,
+					      enum odb_transaction_flags flags UNUSED)
 {
 	/* TODO: this is a known omission that we'll want to address eventually. */
 	return error("loose source does not support transactions");
diff --git a/odb/source.h b/odb/source.h
index 2192a101b8..3790d03ff2 100644
--- a/odb/source.h
+++ b/odb/source.h
@@ -3,6 +3,7 @@
 
 #include "object.h"
 #include "odb.h"
+#include "odb/transaction.h"
 
 enum odb_source_type {
 	/*
@@ -228,7 +229,8 @@ struct odb_source {
 	 * negative error code otherwise.
 	 */
 	int (*begin_transaction)(struct odb_source *source,
-				 struct odb_transaction **out);
+				 struct odb_transaction **out,
+				 enum odb_transaction_flags flags);
 
 	/*
 	 * This callback is expected to read the list of alternate object
@@ -467,9 +469,10 @@ static inline int odb_source_write_alternate(struct odb_source *source,
  * Returns 0 on success, a negative error code otherwise.
  */
 static inline int odb_source_begin_transaction(struct odb_source *source,
-					       struct odb_transaction **out)
+					       struct odb_transaction **out,
+					       enum odb_transaction_flags flags)
 {
-	return source->begin_transaction(source, out);
+	return source->begin_transaction(source, out, flags);
 }
 
 #endif
diff --git a/odb/transaction.c b/odb/transaction.c
index 20d3f43f54..34c212020c 100644
--- a/odb/transaction.c
+++ b/odb/transaction.c
@@ -3,7 +3,8 @@
 #include "odb/transaction.h"
 
 int odb_transaction_begin(struct object_database *odb,
-			  struct odb_transaction **out)
+			  struct odb_transaction **out,
+			  enum odb_transaction_flags flags)
 {
 	int ret;
 
@@ -12,7 +13,7 @@ int odb_transaction_begin(struct object_database *odb,
 		return 0;
 	}
 
-	ret = odb_source_begin_transaction(odb->sources, out);
+	ret = odb_source_begin_transaction(odb->sources, out, flags);
 	odb->transaction = *out;
 
 	return ret;
diff --git a/odb/transaction.h b/odb/transaction.h
index 536458297b..78392ff13d 100644
--- a/odb/transaction.h
+++ b/odb/transaction.h
@@ -4,7 +4,6 @@
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "odb.h"
-#include "odb/source.h"
 
 /*
  * A transaction may be started for an object database prior to writing new
@@ -44,6 +43,10 @@ struct odb_transaction {
 	const char **(*env)(struct odb_transaction *transaction);
 };
 
+enum odb_transaction_flags {
+	ODB_TRANSACTION_RECEIVE = (1 << 0),
+};
+
 /*
  * Starts an ODB transaction and returns it via `out`. Subsequent objects are
  * written to the transaction and not committed until odb_transaction_commit()
@@ -51,12 +54,14 @@ struct odb_transaction {
  * error. If the ODB already has a pending transaction, `out` is set to NULL.
  */
 int odb_transaction_begin(struct object_database *odb,
-			  struct odb_transaction **out);
+			  struct odb_transaction **out,
+			  enum odb_transaction_flags flags);
 
 static inline void odb_transaction_begin_or_die(struct object_database *odb,
-						struct odb_transaction **out)
+						struct odb_transaction **out,
+						enum odb_transaction_flags flags)
 {
-	if (odb_transaction_begin(odb, out))
+	if (odb_transaction_begin(odb, out, flags))
 		die(_("failed to start ODB transaction"));
 }
 
diff --git a/read-cache.c b/read-cache.c
index db0bfa60fe..35bfb25576 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -4042,7 +4042,7 @@ int add_files_to_cache(struct repository *repo, const char *prefix,
 	 * This function is invoked from commands other than 'add', which
 	 * may not have their own transaction active.
 	 */
-	odb_transaction_begin_or_die(repo->objects, &transaction);
+	odb_transaction_begin_or_die(repo->objects, &transaction, 0);
 	run_diff_files(&rev, DIFF_RACY_IS_MODIFIED);
 	odb_transaction_commit(transaction);
 
-- 
2.54.0.105.g59ff4886a5


^ permalink raw reply related

* [PATCH 5/6] odb/transaction: add transaction env interface
From: Justin Tobler @ 2026-06-24  4:19 UTC (permalink / raw)
  To: git; +Cc: ps, Justin Tobler
In-Reply-To: <20260624041920.2601961-1-jltobler@gmail.com>

The ODB transaction backend is responsible for creating/managing its own
staging area for writing objects. Other child processes spawned by Git
may need to access to uncommitted objects or write new objects in the
staging area though.

Introduce `odb_transaction_env()` which is expected to provide the set
of environment variables needed by a child process to access the
transaction staging area.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
---
 object-file.c     | 11 +++++++++++
 odb/transaction.c |  8 ++++++++
 odb/transaction.h | 19 +++++++++++++++++++
 3 files changed, 38 insertions(+)

diff --git a/object-file.c b/object-file.c
index 696f05dc2d..14064d188a 100644
--- a/object-file.c
+++ b/object-file.c
@@ -1691,6 +1691,16 @@ static int odb_transaction_files_commit(struct odb_transaction *base)
 	return 0;
 }
 
+static const char **odb_transaction_files_env(struct odb_transaction *base)
+{
+	struct odb_transaction_files *transaction =
+		container_of(base, struct odb_transaction_files, base);
+
+	odb_transaction_files_prepare(&transaction->base);
+
+	return tmp_objdir_env(transaction->objdir);
+}
+
 int odb_transaction_files_begin(struct odb_source *source,
 				struct odb_transaction **out)
 {
@@ -1706,6 +1716,7 @@ int odb_transaction_files_begin(struct odb_source *source,
 	transaction->base.source = source;
 	transaction->base.commit = odb_transaction_files_commit;
 	transaction->base.write_object_stream = odb_transaction_files_write_object_stream;
+	transaction->base.env = odb_transaction_files_env;
 	*out = &transaction->base;
 
 	return 0;
diff --git a/odb/transaction.c b/odb/transaction.c
index b20d6a16f8..20d3f43f54 100644
--- a/odb/transaction.c
+++ b/odb/transaction.c
@@ -46,3 +46,11 @@ int odb_transaction_write_object_stream(struct odb_transaction *transaction,
 {
 	return transaction->write_object_stream(transaction, stream, len, oid);
 }
+
+const char **odb_transaction_env(struct odb_transaction *transaction)
+{
+	if (!transaction)
+		return NULL;
+
+	return transaction->env(transaction);
+}
diff --git a/odb/transaction.h b/odb/transaction.h
index 7898770071..536458297b 100644
--- a/odb/transaction.h
+++ b/odb/transaction.h
@@ -32,6 +32,16 @@ struct odb_transaction {
 	int (*write_object_stream)(struct odb_transaction *transaction,
 				   struct odb_write_stream *stream, size_t len,
 				   struct object_id *oid);
+
+	/*
+	 * This callback is expected to return a NULL-terminated array of
+	 * environment variables that a child process should inherit so
+	 * that its object writes participate in the transaction. The
+	 * returned array is owned by the backend and remains valid until
+	 * the transaction ends. May return NULL when the backend does not
+	 * need to expose any state to child processes.
+	 */
+	const char **(*env)(struct odb_transaction *transaction);
 };
 
 /*
@@ -65,4 +75,13 @@ int odb_transaction_write_object_stream(struct odb_transaction *transaction,
 					struct odb_write_stream *stream,
 					size_t len, struct object_id *oid);
 
+/*
+ * Returns a NULL-terminated array of environment variables that a child
+ * process should inherit so that its object writes participate in the
+ * transaction, suitable for passing via child_process.env. Returns NULL if
+ * the transaction is NULL or the backend does not expose any state to child
+ * processes.
+ */
+const char **odb_transaction_env(struct odb_transaction *transaction);
+
 #endif
-- 
2.54.0.105.g59ff4886a5


^ permalink raw reply related

* [PATCH 3/6] odb/transaction: propagate begin errors
From: Justin Tobler @ 2026-06-24  4:19 UTC (permalink / raw)
  To: git; +Cc: ps, Justin Tobler
In-Reply-To: <20260624041920.2601961-1-jltobler@gmail.com>

When `odb_transaction_begin()` is invoked, the function returns the
transaction pointer directly. There is no way for the backend to
signal that it failed to set up its state, such as when creating the
temporary object directory backing the transaction.

In a subsequent commit, git-receive-pack(1) starts using ODB
transactions and needs to be able to report such failures rather
than silently ignore them. Refactor `odb_transaction_begin()` to
return an int error code and write the resulting transaction into an
out parameter. Also introduce `odb_transaction_begin_or_die()` as a
convenience for callsites that do not need to handle errors
explicitly.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
---
 builtin/add.c            |  2 +-
 builtin/unpack-objects.c |  2 +-
 builtin/update-index.c   |  2 +-
 cache-tree.c             |  2 +-
 object-file.c            |  3 ++-
 odb/transaction.c        | 16 +++++++++++-----
 odb/transaction.h        | 19 +++++++++++++++----
 read-cache.c             |  2 +-
 8 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index c859f66519..3d5d9cfdb9 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -581,7 +581,7 @@ int cmd_add(int argc,
 		string_list_clear(&only_match_skip_worktree, 0);
 	}
 
-	transaction = odb_transaction_begin(repo->objects);
+	odb_transaction_begin_or_die(repo->objects, &transaction);
 
 	ps_matched = xcalloc(pathspec.nr, 1);
 	if (add_renormalize)
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index f3849bb654..d0136cdd99 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -598,7 +598,7 @@ static void unpack_all(void)
 		progress = start_progress(the_repository,
 					  _("Unpacking objects"), nr_objects);
 	CALLOC_ARRAY(obj_list, nr_objects);
-	transaction = odb_transaction_begin(the_repository->objects);
+	odb_transaction_begin_or_die(the_repository->objects, &transaction);
 	for (i = 0; i < nr_objects; i++) {
 		unpack_one(i);
 		display_progress(progress, i + 1);
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 3d6646c318..17f3ea284c 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -1124,7 +1124,7 @@ int cmd_update_index(int argc,
 	 * Allow the object layer to optimize adding multiple objects in
 	 * a batch.
 	 */
-	transaction = odb_transaction_begin(the_repository->objects);
+	odb_transaction_begin_or_die(the_repository->objects, &transaction);
 	while (ctx.argc) {
 		if (parseopt_state != PARSE_OPT_DONE)
 			parseopt_state = parse_options_step(&ctx, options,
diff --git a/cache-tree.c b/cache-tree.c
index 184f7e2635..1a7dfed9cf 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -490,7 +490,7 @@ int cache_tree_update(struct index_state *istate, int flags)
 
 	trace_performance_enter();
 	trace2_region_enter("cache_tree", "update", istate->repo);
-	transaction = odb_transaction_begin(the_repository->objects);
+	odb_transaction_begin_or_die(the_repository->objects, &transaction);
 	i = update_one(istate->cache_tree, istate->cache, istate->cache_nr,
 		       "", 0, &skip, flags);
 	odb_transaction_commit(transaction);
diff --git a/object-file.c b/object-file.c
index 18c2df75fb..696f05dc2d 100644
--- a/object-file.c
+++ b/object-file.c
@@ -1389,8 +1389,9 @@ int index_fd(struct index_state *istate, struct object_id *oid,
 
 		if (flags & INDEX_WRITE_OBJECT) {
 			struct object_database *odb = the_repository->objects;
-			struct odb_transaction *transaction = odb_transaction_begin(odb);
+			struct odb_transaction *transaction;
 
+			odb_transaction_begin_or_die(odb, &transaction);
 			ret = odb_transaction_write_object_stream(odb->transaction,
 								  &stream,
 								  xsize_t(st->st_size),
diff --git a/odb/transaction.c b/odb/transaction.c
index b16e07aebf..d3de01db50 100644
--- a/odb/transaction.c
+++ b/odb/transaction.c
@@ -2,14 +2,20 @@
 #include "odb/source.h"
 #include "odb/transaction.h"
 
-struct odb_transaction *odb_transaction_begin(struct object_database *odb)
+int odb_transaction_begin(struct object_database *odb,
+			  struct odb_transaction **out)
 {
-	if (odb->transaction)
-		return NULL;
+	int ret;
 
-	odb_source_begin_transaction(odb->sources, &odb->transaction);
+	if (odb->transaction) {
+		*out = NULL;
+		return 0;
+	}
 
-	return odb->transaction;
+	ret = odb_source_begin_transaction(odb->sources, out);
+	odb->transaction = *out;
+
+	return ret;
 }
 
 void odb_transaction_commit(struct odb_transaction *transaction)
diff --git a/odb/transaction.h b/odb/transaction.h
index f4c1ebfaaa..cd6d50f2e5 100644
--- a/odb/transaction.h
+++ b/odb/transaction.h
@@ -1,6 +1,8 @@
 #ifndef ODB_TRANSACTION_H
 #define ODB_TRANSACTION_H
 
+#include "git-compat-util.h"
+#include "gettext.h"
 #include "odb.h"
 #include "odb/source.h"
 
@@ -33,11 +35,20 @@ struct odb_transaction {
 };
 
 /*
- * Starts an ODB transaction. Subsequent objects are written to the transaction
- * and not committed until odb_transaction_commit() is invoked on the
- * transaction. If the ODB already has a pending transaction, NULL is returned.
+ * Starts an ODB transaction and returns it via `out`. Subsequent objects are
+ * written to the transaction and not committed until odb_transaction_commit()
+ * is invoked on the transaction. Returns 0 on success and a negative value on
+ * error. If the ODB already has a pending transaction, `out` is set to NULL.
  */
-struct odb_transaction *odb_transaction_begin(struct object_database *odb);
+int odb_transaction_begin(struct object_database *odb,
+			  struct odb_transaction **out);
+
+static inline void odb_transaction_begin_or_die(struct object_database *odb,
+						struct odb_transaction **out)
+{
+	if (odb_transaction_begin(odb, out))
+		die(_("failed to start ODB transaction"));
+}
 
 /*
  * Commits an ODB transaction making the written objects visible. If the
diff --git a/read-cache.c b/read-cache.c
index 21ca58beea..db0bfa60fe 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -4042,7 +4042,7 @@ int add_files_to_cache(struct repository *repo, const char *prefix,
 	 * This function is invoked from commands other than 'add', which
 	 * may not have their own transaction active.
 	 */
-	transaction = odb_transaction_begin(repo->objects);
+	odb_transaction_begin_or_die(repo->objects, &transaction);
 	run_diff_files(&rev, DIFF_RACY_IS_MODIFIED);
 	odb_transaction_commit(transaction);
 
-- 
2.54.0.105.g59ff4886a5


^ permalink raw reply related

* [PATCH 2/6] object-file: propagate files transaction errors
From: Justin Tobler @ 2026-06-24  4:19 UTC (permalink / raw)
  To: git; +Cc: ps, Justin Tobler
In-Reply-To: <20260624041920.2601961-1-jltobler@gmail.com>

The "files" transaction backend may encounter errors related to managing
the temporary directory used to stage objects, but silently ignores
these errors. Instead return errors encountered in the
`odb_transaction_files_{prepare,begin,commit}()` interfaces to allow
callers to handle as needed.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
---
 object-file.c      | 41 ++++++++++++++++++++++++++++-------------
 object-file.h      |  5 +++--
 odb/source-files.c |  6 +-----
 odb/transaction.h  |  2 +-
 4 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/object-file.c b/object-file.c
index a3eb8d71dd..18c2df75fb 100644
--- a/object-file.c
+++ b/object-file.c
@@ -499,7 +499,7 @@ struct odb_transaction_files {
 	struct transaction_packfile packfile;
 };
 
-static void odb_transaction_files_prepare(struct odb_transaction *base)
+static int odb_transaction_files_prepare(struct odb_transaction *base)
 {
 	struct odb_transaction_files *transaction =
 		container_of_or_null(base, struct odb_transaction_files, base);
@@ -511,11 +511,15 @@ static void odb_transaction_files_prepare(struct odb_transaction *base)
 	 * added at the time they call odb_transaction_files_begin.
 	 */
 	if (!transaction || transaction->objdir)
-		return;
+		return 0;
 
 	transaction->objdir = tmp_objdir_create(base->source->odb->repo, "bulk-fsync");
-	if (transaction->objdir)
-		tmp_objdir_replace_primary_odb(transaction->objdir, 0);
+	if (!transaction->objdir)
+		return -1;
+
+	tmp_objdir_replace_primary_odb(transaction->objdir, 0);
+
+	return 0;
 }
 
 static void fsync_loose_object_transaction(struct odb_transaction *base,
@@ -542,13 +546,13 @@ static void fsync_loose_object_transaction(struct odb_transaction *base,
 /*
  * Cleanup after batch-mode fsync_object_files.
  */
-static void flush_loose_object_transaction(struct odb_transaction_files *transaction)
+static int flush_loose_object_transaction(struct odb_transaction_files *transaction)
 {
 	struct strbuf temp_path = STRBUF_INIT;
 	struct tempfile *temp;
 
 	if (!transaction->objdir)
-		return;
+		return 0;
 
 	/*
 	 * Issue a full hardware flush against a temporary file to ensure
@@ -570,8 +574,12 @@ static void flush_loose_object_transaction(struct odb_transaction_files *transac
 	 * Make the object files visible in the primary ODB after their data is
 	 * fully durable.
 	 */
-	tmp_objdir_migrate(transaction->objdir);
+	if (tmp_objdir_migrate(transaction->objdir))
+		return -1;
+
 	transaction->objdir = NULL;
+
+	return 0;
 }
 
 /* Finalize a file on disk, and close it. */
@@ -1670,27 +1678,34 @@ int read_loose_object(struct repository *repo,
 	return ret;
 }
 
-static void odb_transaction_files_commit(struct odb_transaction *base)
+static int odb_transaction_files_commit(struct odb_transaction *base)
 {
 	struct odb_transaction_files *transaction =
 		container_of(base, struct odb_transaction_files, base);
 
-	flush_loose_object_transaction(transaction);
+	if (flush_loose_object_transaction(transaction))
+		return -1;
 	flush_packfile_transaction(transaction);
+
+	return 0;
 }
 
-struct odb_transaction *odb_transaction_files_begin(struct odb_source *source)
+int odb_transaction_files_begin(struct odb_source *source,
+				struct odb_transaction **out)
 {
 	struct odb_transaction_files *transaction;
 	struct object_database *odb = source->odb;
 
-	if (odb->transaction)
-		return NULL;
+	if (odb->transaction) {
+		*out = NULL;
+		return 0;
+	}
 
 	transaction = xcalloc(1, sizeof(*transaction));
 	transaction->base.source = source;
 	transaction->base.commit = odb_transaction_files_commit;
 	transaction->base.write_object_stream = odb_transaction_files_write_object_stream;
+	*out = &transaction->base;
 
-	return &transaction->base;
+	return 0;
 }
diff --git a/object-file.h b/object-file.h
index 528c4e6e69..ac927fec07 100644
--- a/object-file.h
+++ b/object-file.h
@@ -195,8 +195,9 @@ struct odb_transaction;
  * Tell the object database to optimize for adding
  * multiple objects. odb_transaction_files_commit must be called
  * to make new objects visible. If a transaction is already
- * pending, NULL is returned.
+ * pending, out is set to NULL.
  */
-struct odb_transaction *odb_transaction_files_begin(struct odb_source *source);
+int odb_transaction_files_begin(struct odb_source *source,
+				struct odb_transaction **out);
 
 #endif /* OBJECT_FILE_H */
diff --git a/odb/source-files.c b/odb/source-files.c
index 5bdd042922..2545bd81d4 100644
--- a/odb/source-files.c
+++ b/odb/source-files.c
@@ -182,11 +182,7 @@ static int odb_source_files_write_object_stream(struct odb_source *source,
 static int odb_source_files_begin_transaction(struct odb_source *source,
 					      struct odb_transaction **out)
 {
-	struct odb_transaction *tx = odb_transaction_files_begin(source);
-	if (!tx)
-		return -1;
-	*out = tx;
-	return 0;
+	return odb_transaction_files_begin(source, out);
 }
 
 static int odb_source_files_read_alternates(struct odb_source *source,
diff --git a/odb/transaction.h b/odb/transaction.h
index 854fda06f5..f4c1ebfaaa 100644
--- a/odb/transaction.h
+++ b/odb/transaction.h
@@ -17,7 +17,7 @@ struct odb_transaction {
 	struct odb_source *source;
 
 	/* The ODB source specific callback invoked to commit a transaction. */
-	void (*commit)(struct odb_transaction *transaction);
+	int (*commit)(struct odb_transaction *transaction);
 
 	/*
 	 * This callback is expected to write the given object stream into
-- 
2.54.0.105.g59ff4886a5


^ permalink raw reply related

* [PATCH 1/6] object-file: rename files transaction prepare function
From: Justin Tobler @ 2026-06-24  4:19 UTC (permalink / raw)
  To: git; +Cc: ps, Justin Tobler
In-Reply-To: <20260624041920.2601961-1-jltobler@gmail.com>

The "files" ODB transaction backend lazily creates a temporary object
directory when the first loose object is written to the transaction via
`prepare_loose_object_transaction()`. In a subsequent commit, the
temporary directory is used to also write packfiles to.

Rename the function to `odb_transaction_files_prepare()` accordingly.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
---
 object-file.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/object-file.c b/object-file.c
index e3d92bbda2..a3eb8d71dd 100644
--- a/object-file.c
+++ b/object-file.c
@@ -499,7 +499,7 @@ struct odb_transaction_files {
 	struct transaction_packfile packfile;
 };
 
-static void prepare_loose_object_transaction(struct odb_transaction *base)
+static void odb_transaction_files_prepare(struct odb_transaction *base)
 {
 	struct odb_transaction_files *transaction =
 		container_of_or_null(base, struct odb_transaction_files, base);
@@ -761,7 +761,7 @@ int write_loose_object(struct odb_source_loose *loose,
 	static struct strbuf filename = STRBUF_INIT;
 
 	if (batch_fsync_enabled(FSYNC_COMPONENT_LOOSE_OBJECT))
-		prepare_loose_object_transaction(loose->base.odb->transaction);
+		odb_transaction_files_prepare(loose->base.odb->transaction);
 
 	odb_loose_path(loose, &filename, oid);
 
@@ -825,7 +825,7 @@ int odb_source_loose_write_stream(struct odb_source_loose *loose,
 	int hdrlen;
 
 	if (batch_fsync_enabled(FSYNC_COMPONENT_LOOSE_OBJECT))
-		prepare_loose_object_transaction(loose->base.odb->transaction);
+		odb_transaction_files_prepare(loose->base.odb->transaction);
 
 	/* Since oid is not determined, save tmp file to odb path. */
 	strbuf_addf(&filename, "%s/", loose->base.path);
-- 
2.54.0.105.g59ff4886a5


^ permalink raw reply related

* [PATCH 0/6] receive-pack: use ODB transactions to stage object writes
From: Justin Tobler @ 2026-06-24  4:19 UTC (permalink / raw)
  To: git; +Cc: ps, Justin Tobler

Greetings,

This patch series replaces direct usage of the `tmp_objdir` interfaces
in git-receive-pack(1) to instead use the `odb_transaction` interfaces
to create/manage a staging area to write objects to. The purpose of this
change is to get git-receive-pack(1) one step closer to being ODB
backend agnostic. For now, the object writes themselves are still
"files" backend specific due to being handled by the git-index-pack(1)
and git-unpack-objects(1) child processes. This will be tackled in a
separate series though.

Thanks,
-Justin

Justin Tobler (6):
  object-file: rename files transaction prepare function
  object-file: propagate files transaction errors
  odb/transaction: propagate begin errors
  odb/transaction: propagate commit errors
  odb/transaction: add transaction env interface
  builtin/receive-pack: stage incoming objects via ODB transactions

 builtin/add.c            |  2 +-
 builtin/receive-pack.c   | 46 ++++++++++--------------
 builtin/unpack-objects.c |  2 +-
 builtin/update-index.c   |  2 +-
 cache-tree.c             |  2 +-
 object-file.c            | 77 +++++++++++++++++++++++++++++++---------
 object-file.h            |  7 ++--
 odb/source-files.c       |  9 ++---
 odb/source-inmemory.c    |  3 +-
 odb/source-loose.c       |  3 +-
 odb/source.h             |  9 +++--
 odb/transaction.c        | 38 +++++++++++++++-----
 odb/transaction.h        | 49 +++++++++++++++++++++----
 read-cache.c             |  2 +-
 14 files changed, 173 insertions(+), 78 deletions(-)


base-commit: ab776a62a78576513ee121424adb19597fbb7613
-- 
2.54.0.105.g59ff4886a5


^ permalink raw reply

* Re: [GSoC Patch v7 1/3] path: extract append_formatted_path() and use in rev-parse
From: K Jayatheerth @ 2026-06-24  3:49 UTC (permalink / raw)
  To: phillip.wood
  Cc: a3205153416, git, gitster, jltobler, kumarayushjha123,
	lucasseikioshiro, sandals
In-Reply-To: <084ad4d0-d872-4c7f-94a8-ec2383c7a8ca@gmail.com>

Hey Phillip,

On Tue, Jun 23, 2026 at 9:27 PM Phillip Wood <phillip.wood123@gmail.com> wrote:
>
> On 21/06/2026 06:55, K Jayatheerth wrote:
> > Path formatting logic in builtin/rev-parse.c writes directly to
> > stdout. Other builtins cannot reuse it.
> >
> > Extract this logic into append_formatted_path() in path.c and expose
> > a path_format enum in path.h.
> >
> > Convert rev-parse to use the new helper in the same step to validate
> > the API against existing tests and avoid introducing dead code.
>
> The new API looks good now, and so does the conversion of the existing
> code. I'm very happy with this version and don't have anything to add to
> Junio's comments
>
> Thanks
>
> Phillip
>

I have sent a v8 with Junio's feedback addressed.
I wouldn't have a problem with either of the versions getting merged.

Both of them are good in their own ways.

Thank you,
- K Jayatheerth

^ permalink raw reply

* [GSoC Patch v8 3/3] repo: add path.gitdir with absolute and relative suffix formatting
From: K Jayatheerth @ 2026-06-24  3:37 UTC (permalink / raw)
  To: jayatheerthkulkarni2005
  Cc: a3205153416, git, gitster, jltobler, kumarayushjha123,
	lucasseikioshiro, phillip.wood, sandals
In-Reply-To: <20260624033748.108281-1-jayatheerthkulkarni2005@gmail.com>

Scripts need a stable way to locate the git directory without
parsing rev-parse output or relying on its flag-driven path format
selection. There is no way to retrieve this path from git repo info
today.

Introduce path.gitdir.absolute and path.gitdir.relative keys,
consistent with the path.commondir keys added in the previous patch.
Reuse the test_repo_info_path helper introduced there to validate
both variants.

Mentored-by: Justin Tobler <jltobler@gmail.com>
Mentored-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
---
 Documentation/git-repo.adoc |  6 ++++++
 builtin/repo.c              | 24 ++++++++++++++++++++++++
 t/t1900-repo-info.sh        |  6 ++++++
 3 files changed, 36 insertions(+)

diff --git a/Documentation/git-repo.adoc b/Documentation/git-repo.adoc
index 890c34051d..ed7d80c690 100644
--- a/Documentation/git-repo.adoc
+++ b/Documentation/git-repo.adoc
@@ -113,6 +113,12 @@ values that they return:
 	The path to the Git repository's common directory relative to
 	the current working directory.
 
+`path.gitdir.absolute`::
+	The canonical absolute path to the Git repository directory (the `.git` directory).
+
+`path.gitdir.relative`::
+	The path to the Git repository directory relative to the current working directory.
+
 `references.format`::
 	The reference storage format. The valid values are:
 +
diff --git a/builtin/repo.c b/builtin/repo.c
index 4c3fbc26b9..27c8caff38 100644
--- a/builtin/repo.c
+++ b/builtin/repo.c
@@ -99,6 +99,28 @@ static int get_path_commondir_relative(struct repository *repo, struct strbuf *b
 	return 0;
 }
 
+static int get_path_gitdir_absolute(struct repository *repo, struct strbuf *buf)
+{
+	const char *git_dir = repo_get_git_dir(repo);
+
+	if (!git_dir)
+		return error(_("unable to get git directory"));
+
+	format_path(buf, git_dir, startup_info->prefix, PATH_FORMAT_CANONICAL);
+	return 0;
+}
+
+static int get_path_gitdir_relative(struct repository *repo, struct strbuf *buf)
+{
+	const char *git_dir = repo_get_git_dir(repo);
+
+	if (!git_dir)
+		return error(_("unable to get git directory"));
+
+	format_path(buf, git_dir, startup_info->prefix, PATH_FORMAT_RELATIVE);
+	return 0;
+}
+
 static int get_references_format(struct repository *repo, struct strbuf *buf)
 {
 	strbuf_addstr(buf,
@@ -113,6 +135,8 @@ static const struct repo_info_field repo_info_field[] = {
 	{ "object.format", get_object_format },
 	{ "path.commondir.absolute", get_path_commondir_absolute },
 	{ "path.commondir.relative", get_path_commondir_relative },
+	{ "path.gitdir.absolute", get_path_gitdir_absolute },
+	{ "path.gitdir.relative", get_path_gitdir_relative },
 	{ "references.format", get_references_format },
 };
 
diff --git a/t/t1900-repo-info.sh b/t/t1900-repo-info.sh
index 09158d29f9..ae8c22c817 100755
--- a/t/t1900-repo-info.sh
+++ b/t/t1900-repo-info.sh
@@ -207,4 +207,10 @@ test_repo_info_path 'commondir with only GIT_DIR' 'commondir' \
 	'.git' \
 	'GIT_DIR="../.git" && export GIT_DIR'
 
+test_repo_info_path 'gitdir standard' 'gitdir' '.git'
+
+test_repo_info_path 'gitdir with explicit GIT_DIR' 'gitdir' \
+	'.git' \
+	'GIT_DIR="../.git" && export GIT_DIR'
+
 test_done
-- 
2.55.0-rc1


^ permalink raw reply related

* [GSoC Patch v8 2/3] repo: add path.commondir with absolute and relative suffix formatting
From: K Jayatheerth @ 2026-06-24  3:37 UTC (permalink / raw)
  To: jayatheerthkulkarni2005
  Cc: a3205153416, git, gitster, jltobler, kumarayushjha123,
	lucasseikioshiro, phillip.wood, sandals
In-Reply-To: <20260624033748.108281-1-jayatheerthkulkarni2005@gmail.com>

Scripts working with worktree setups need a reliable way to discover
the common directory, which diverges from the git directory when
multiple worktrees are in use. There is no way to retrieve this path
from git repo info today.

Introduce path.commondir.absolute and path.commondir.relative keys.
Exposing explicit format variants rather than a single key with a
default avoids ambiguity for scripts that require predictable output.

Mentored-by: Justin Tobler <jltobler@gmail.com>
Mentored-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
---
 Documentation/git-repo.adoc |  9 +++++++
 builtin/repo.c              | 26 +++++++++++++++++++
 t/t1900-repo-info.sh        | 52 +++++++++++++++++++++++++++++++++++++
 3 files changed, 87 insertions(+)

diff --git a/Documentation/git-repo.adoc b/Documentation/git-repo.adoc
index 42262c1983..890c34051d 100644
--- a/Documentation/git-repo.adoc
+++ b/Documentation/git-repo.adoc
@@ -104,6 +104,15 @@ values that they return:
 `object.format`::
 	The object format (hash algorithm) used in the repository.
 
+`path.commondir.absolute`::
+	The canonical absolute path to the Git repository's common
+	directory (the shared `.git` directory containing objects,
+	refs, and global configuration).
+
+`path.commondir.relative`::
+	The path to the Git repository's common directory relative to
+	the current working directory.
+
 `references.format`::
 	The reference storage format. The valid values are:
 +
diff --git a/builtin/repo.c b/builtin/repo.c
index 71a5c1c29c..4c3fbc26b9 100644
--- a/builtin/repo.c
+++ b/builtin/repo.c
@@ -7,12 +7,14 @@
 #include "hex.h"
 #include "odb.h"
 #include "parse-options.h"
+#include "path.h"
 #include "path-walk.h"
 #include "progress.h"
 #include "quote.h"
 #include "ref-filter.h"
 #include "refs.h"
 #include "revision.h"
+#include "setup.h"
 #include "strbuf.h"
 #include "string-list.h"
 #include "shallow.h"
@@ -75,6 +77,28 @@ static int get_object_format(struct repository *repo, struct strbuf *buf)
 	return 0;
 }
 
+static int get_path_commondir_absolute(struct repository *repo, struct strbuf *buf)
+{
+	const char *common_dir = repo_get_common_dir(repo);
+
+	if (!common_dir)
+		return error(_("unable to get common directory"));
+
+	format_path(buf, common_dir, startup_info->prefix, PATH_FORMAT_CANONICAL);
+	return 0;
+}
+
+static int get_path_commondir_relative(struct repository *repo, struct strbuf *buf)
+{
+	const char *common_dir = repo_get_common_dir(repo);
+
+	if (!common_dir)
+		return error(_("unable to get common directory"));
+
+	format_path(buf, common_dir, startup_info->prefix, PATH_FORMAT_RELATIVE);
+	return 0;
+}
+
 static int get_references_format(struct repository *repo, struct strbuf *buf)
 {
 	strbuf_addstr(buf,
@@ -87,6 +111,8 @@ static const struct repo_info_field repo_info_field[] = {
 	{ "layout.bare", get_layout_bare },
 	{ "layout.shallow", get_layout_shallow },
 	{ "object.format", get_object_format },
+	{ "path.commondir.absolute", get_path_commondir_absolute },
+	{ "path.commondir.relative", get_path_commondir_relative },
 	{ "references.format", get_references_format },
 };
 
diff --git a/t/t1900-repo-info.sh b/t/t1900-repo-info.sh
index 39bb77dda0..09158d29f9 100755
--- a/t/t1900-repo-info.sh
+++ b/t/t1900-repo-info.sh
@@ -155,4 +155,56 @@ test_expect_success 'git repo info -h shows only repo info usage' '
 	test_grep ! "git repo structure" actual
 '
 
+# Helper function to test path keys in both absolute and relative formats.
+# $1: label for the test
+# $2: field_name (e.g., commondir)
+# $3: expected_dir (the directory name, e.g., .git or custom-common)
+# $4: init_command (extra setup like exporting env vars)
+test_repo_info_path () {
+	label=$1
+	field_name=$2
+	expected_dir=$3
+	init_command=$4
+
+	test_expect_success "absolute: $label" '
+		test_when_finished "rm -rf repo" &&
+		git init repo &&
+		(
+			mkdir -p repo/sub &&
+			cd repo/sub &&
+			ROOT="$(test-tool path-utils real_path ..)" && export ROOT &&
+			eval "$init_command" &&
+			echo "path.$field_name.absolute=$ROOT/$expected_dir" >expect &&
+			git repo info "path.$field_name.absolute" >actual &&
+			test_cmp expect actual
+		)
+	'
+
+	test_expect_success "relative: $label" '
+		test_when_finished "rm -rf repo" &&
+		git init repo &&
+		(
+			mkdir -p repo/sub &&
+			cd repo/sub &&
+			ROOT="$(test-tool path-utils real_path ..)" && export ROOT &&
+			eval "$init_command" &&
+			echo "path.$field_name.relative=../$expected_dir" >expect &&
+			git repo info "path.$field_name.relative" >actual &&
+			test_cmp expect actual
+		)
+	'
+}
+
+test_repo_info_path 'commondir standard' 'commondir' '.git'
+
+test_repo_info_path 'commondir with GIT_COMMON_DIR and GIT_DIR' 'commondir' \
+	'custom-common' \
+	'GIT_COMMON_DIR="$ROOT/custom-common" && export GIT_COMMON_DIR &&
+	 GIT_DIR="../.git" && export GIT_DIR &&
+	 git init --bare "$ROOT/custom-common"'
+
+test_repo_info_path 'commondir with only GIT_DIR' 'commondir' \
+	'.git' \
+	'GIT_DIR="../.git" && export GIT_DIR'
+
 test_done
-- 
2.55.0-rc1


^ permalink raw reply related

* [GSoC Patch v8 1/3] path: extract format_path() and use in rev-parse
From: K Jayatheerth @ 2026-06-24  3:37 UTC (permalink / raw)
  To: jayatheerthkulkarni2005
  Cc: a3205153416, git, gitster, jltobler, kumarayushjha123,
	lucasseikioshiro, phillip.wood, sandals
In-Reply-To: <20260624033748.108281-1-jayatheerthkulkarni2005@gmail.com>

Path formatting logic in builtin/rev-parse.c writes directly to
stdout. Other builtins cannot reuse it.

Extract this logic into format_path() in path.c and expose
a path_format enum in path.h.

Convert rev-parse to use the new helper in the same step to validate
the API against existing tests and avoid introducing dead code.

Mentored-by: Justin Tobler <jltobler@gmail.com>
Mentored-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
---
 builtin/rev-parse.c | 79 +++++++++++++++++++++------------------------
 path.c              | 69 +++++++++++++++++++++++++++++++++++++++
 path.h              | 30 +++++++++++++++++
 3 files changed, 135 insertions(+), 43 deletions(-)

diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index bb882678fe..7d6ac92038 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -653,53 +653,46 @@ enum default_type {
 	DEFAULT_UNMODIFIED,
 };
 
-static void print_path(const char *path, const char *prefix, enum format_type format, enum default_type def)
+static void print_path(const char *path, const char *prefix,
+		       enum format_type format, enum default_type def)
 {
-	char *cwd = NULL;
-	/*
-	 * We don't ever produce a relative path if prefix is NULL, so set the
-	 * prefix to the current directory so that we can produce a relative
-	 * path whenever possible.  If we're using RELATIVE_IF_SHARED mode, then
-	 * we want an absolute path unless the two share a common prefix, so don't
-	 * set it in that case, since doing so causes a relative path to always
-	 * be produced if possible.
-	 */
-	if (!prefix && (format != FORMAT_DEFAULT || def != DEFAULT_RELATIVE_IF_SHARED))
-		prefix = cwd = xgetcwd();
-	if (format == FORMAT_DEFAULT && def == DEFAULT_UNMODIFIED) {
-		puts(path);
-	} else if (format == FORMAT_RELATIVE ||
-		  (format == FORMAT_DEFAULT && def == DEFAULT_RELATIVE)) {
-		/*
-		 * In order for relative_path to work as expected, we need to
-		 * make sure that both paths are absolute paths.  If we don't,
-		 * we can end up with an unexpected absolute path that the user
-		 * didn't want.
-		 */
-		struct strbuf buf = STRBUF_INIT, realbuf = STRBUF_INIT, prefixbuf = STRBUF_INIT;
-		if (!is_absolute_path(path)) {
-			strbuf_realpath_forgiving(&realbuf, path,  1);
-			path = realbuf.buf;
-		}
-		if (!is_absolute_path(prefix)) {
-			strbuf_realpath_forgiving(&prefixbuf, prefix, 1);
-			prefix = prefixbuf.buf;
+	struct strbuf sb = STRBUF_INIT;
+	enum path_format fmt;
+
+	if (format == FORMAT_DEFAULT) {
+		switch (def) {
+		case DEFAULT_RELATIVE:
+			fmt = PATH_FORMAT_RELATIVE;
+			break;
+		case DEFAULT_RELATIVE_IF_SHARED:
+			fmt = PATH_FORMAT_RELATIVE_IF_SHARED;
+			break;
+		case DEFAULT_CANONICAL:
+			fmt = PATH_FORMAT_CANONICAL;
+			break;
+		case DEFAULT_UNMODIFIED:
+		default:
+			fmt = PATH_FORMAT_UNMODIFIED;
+			break;
 		}
-		puts(relative_path(path, prefix, &buf));
-		strbuf_release(&buf);
-		strbuf_release(&realbuf);
-		strbuf_release(&prefixbuf);
-	} else if (format == FORMAT_DEFAULT && def == DEFAULT_RELATIVE_IF_SHARED) {
-		struct strbuf buf = STRBUF_INIT;
-		puts(relative_path(path, prefix, &buf));
-		strbuf_release(&buf);
 	} else {
-		struct strbuf buf = STRBUF_INIT;
-		strbuf_realpath_forgiving(&buf, path, 1);
-		puts(buf.buf);
-		strbuf_release(&buf);
+		switch (format) {
+		case FORMAT_RELATIVE:
+			fmt = PATH_FORMAT_RELATIVE;
+			break;
+		case FORMAT_CANONICAL:
+			fmt = PATH_FORMAT_CANONICAL;
+			break;
+		default:
+			fmt = PATH_FORMAT_UNMODIFIED;
+			break;
+		}
 	}
-	free(cwd);
+
+	format_path(&sb, path, prefix, fmt);
+	puts(sb.buf);
+
+	strbuf_release(&sb);
 }
 
 int cmd_rev_parse(int argc,
diff --git a/path.c b/path.c
index d7e17bf174..c3a709a928 100644
--- a/path.c
+++ b/path.c
@@ -1579,6 +1579,75 @@ char *xdg_cache_home(const char *filename)
 	return NULL;
 }
 
+void format_path(struct strbuf *dest, const char *path,
+		 const char *prefix, enum path_format format)
+{
+	strbuf_reset(dest);
+
+	switch (format) {
+	case PATH_FORMAT_UNMODIFIED:
+		strbuf_addstr(dest, path);
+		break;
+
+	case PATH_FORMAT_RELATIVE: {
+		struct strbuf relative_buf = STRBUF_INIT;
+		struct strbuf real_path = STRBUF_INIT;
+		struct strbuf real_prefix = STRBUF_INIT;
+		char *cwd = NULL;
+
+		/*
+		 * We don't ever produce a relative path if prefix is NULL,
+		 * so set the prefix to the current directory so that we can
+		 * produce a relative path whenever possible.
+		 */
+		if (!prefix)
+			prefix = cwd = xgetcwd();
+
+		if (!is_absolute_path(path)) {
+			strbuf_realpath_forgiving(&real_path, path, 1);
+			path = real_path.buf;
+		}
+		if (!is_absolute_path(prefix)) {
+			strbuf_realpath_forgiving(&real_prefix, prefix, 1);
+			prefix = real_prefix.buf;
+		}
+
+		strbuf_addstr(dest, relative_path(path, prefix, &relative_buf));
+
+		strbuf_release(&relative_buf);
+		strbuf_release(&real_path);
+		strbuf_release(&real_prefix);
+		free(cwd);
+		break;
+	}
+
+	case PATH_FORMAT_RELATIVE_IF_SHARED: {
+		struct strbuf relative_buf = STRBUF_INIT;
+
+		/*
+		 * If we're using RELATIVE_IF_SHARED mode, then we want an
+		 * absolute path unless the two share a common prefix, so don't
+		 * default the prefix to the current working directory. Doing so
+		 * would cause a relative path to always be produced if possible.
+		 */
+		strbuf_addstr(dest, relative_path(path, prefix, &relative_buf));
+		strbuf_release(&relative_buf);
+		break;
+	}
+
+	case PATH_FORMAT_CANONICAL:
+		/*
+		 * strbuf_realpath_forgiving inherently resets the destination
+		 * buffer, safely aligning with our replace semantics.
+		 */
+		strbuf_realpath_forgiving(dest, path, 1);
+		break;
+
+	default:
+		BUG("unknown path_format value %d", format);
+	}
+}
+
 REPO_GIT_PATH_FUNC(squash_msg, "SQUASH_MSG")
 REPO_GIT_PATH_FUNC(merge_msg, "MERGE_MSG")
 REPO_GIT_PATH_FUNC(merge_rr, "MERGE_RR")
diff --git a/path.h b/path.h
index 4c2958a903..7e7408dd05 100644
--- a/path.h
+++ b/path.h
@@ -262,6 +262,36 @@ enum scld_error safe_create_leading_directories_no_share(char *path);
 int safe_create_file_with_leading_directories(struct repository *repo,
 					      const char *path);
 
+/**
+ * The formatting strategy to apply when writing a path into a buffer.
+ */
+enum path_format {
+	/* Output the path exactly as-is without any modifications. */
+	PATH_FORMAT_UNMODIFIED,
+
+	/* Output a path relative to the provided directory prefix. */
+	PATH_FORMAT_RELATIVE,
+
+	/* Output a relative path only if the path shares a root with the prefix. */
+	PATH_FORMAT_RELATIVE_IF_SHARED,
+
+	/* Output a fully resolved, absolute canonical path. */
+	PATH_FORMAT_CANONICAL
+};
+
+/**
+ * Format a path according to the specified formatting strategy and store
+ * the result in the given strbuf, replacing any existing contents.
+ *
+ * `dest`   : The string buffer to store the formatted path into.
+ * `path`   : The path string that needs to be formatted.
+ * `prefix` : The directory prefix to calculate relative offsets against.
+ * Pass NULL to default to the current working directory where applicable.
+ * `format` : The formatting behavior rule to execute.
+ */
+void format_path(struct strbuf *dest, const char *path,
+		 const char *prefix, enum path_format format);
+
 # ifdef USE_THE_REPOSITORY_VARIABLE
 #  include "strbuf.h"
 #  include "repository.h"
-- 
2.55.0-rc1


^ permalink raw reply related

* [GSoC Patch v8 0/3] teach git repo info to handle path keys
From: K Jayatheerth @ 2026-06-24  3:37 UTC (permalink / raw)
  To: jayatheerthkulkarni2005
  Cc: a3205153416, git, gitster, jltobler, kumarayushjha123,
	lucasseikioshiro, phillip.wood, sandals
In-Reply-To: <20260601151950.30686-1-jayatheerthkulkarni2005@gmail.com>

Hi!

This series teaches `git repo info` to handle `path.*`
keys, allowing scripts to reliably discover core
repository paths without resorting to `git rev-parse`.

The patches are structured as follows:

1. path: Extract the localized path-formatting logic
   out of `rev-parse` and expose it globally via
   `path.h` using clear append semantics.

2. repo: Introduce `path.commondir.absolute` and
   `path.commondir.relative` alongside a robust,
   isolated test helper.

3. repo: Introduce `path.gitdir.absolute` and
   `path.gitdir.relative` using the same standardized
   formatting rules.

   Changes since v7:

   * Renamed the helper to format_path() and changed semantics to replace/reset
     the destination buffer instead of appending (Junio).
   * Eliminated wasteful intermediate strbuf allocations (e.g., canonical_buf)
     by passing the destination buffer directly where safe (Junio).
   * Refactored the print_path() switch logic in rev-parse.c to evaluate
     FORMAT_DEFAULT first for better readability and future-proofing (Junio).

   Keeping the name as format_path() made sense to me. I understand we already
   had a discussion stating format_path() wasn't a good name back then because
   we were clearly appending to the buffer.

   I believe it is a good name now. Although, if there are any other name
   suggestions, I am happy to change it.

   P.S: I have thought of:
     replace_formatted_path
     strbuf_format_path
     populate_formatted_path

   In the end, I came to the conclusion that format_path() is simply better.

Tagging Justin Tobler, Lucas Seiki Oshiro, Junio,
Phillip Wood, brian m. carlson, and Ayush Jha.

Thanks for helping improve this series!

K Jayatheerth (3):
  path: extract format_path() and use in rev-parse
  repo: add path.commondir with absolute and relative suffix formatting
  repo: add path.gitdir with absolute and relative suffix formatting

 Documentation/git-repo.adoc | 15 +++++++
 builtin/repo.c              | 50 +++++++++++++++++++++++
 builtin/rev-parse.c         | 79 +++++++++++++++++--------------------
 path.c                      | 69 ++++++++++++++++++++++++++++++++
 path.h                      | 30 ++++++++++++++
 t/t1900-repo-info.sh        | 58 +++++++++++++++++++++++++++
 6 files changed, 258 insertions(+), 43 deletions(-)

Range-diff against v7:
1:  bb1d3fd06f ! 1:  287281935e path: extract append_formatted_path() and use in rev-parse
    @@ Metadata
     Author: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
     
      ## Commit message ##
    -    path: extract append_formatted_path() and use in rev-parse
    +    path: extract format_path() and use in rev-parse
     
         Path formatting logic in builtin/rev-parse.c writes directly to
         stdout. Other builtins cannot reuse it.
     
    -    Extract this logic into append_formatted_path() in path.c and expose
    +    Extract this logic into format_path() in path.c and expose
         a path_format enum in path.h.
     
         Convert rev-parse to use the new helper in the same step to validate
    @@ builtin/rev-parse.c: enum default_type {
     +	struct strbuf sb = STRBUF_INIT;
     +	enum path_format fmt;
     +
    -+	if (format == FORMAT_RELATIVE) {
    -+		fmt = PATH_FORMAT_RELATIVE;
    -+	} else if (format == FORMAT_CANONICAL) {
    -+		fmt = PATH_FORMAT_CANONICAL;
    -+	} else /* FORMAT_DEFAULT */ {
    ++	if (format == FORMAT_DEFAULT) {
     +		switch (def) {
     +		case DEFAULT_RELATIVE:
     +			fmt = PATH_FORMAT_RELATIVE;
    @@ builtin/rev-parse.c: enum default_type {
     -		struct strbuf buf = STRBUF_INIT;
     -		puts(relative_path(path, prefix, &buf));
     -		strbuf_release(&buf);
    --	} else {
    + 	} else {
     -		struct strbuf buf = STRBUF_INIT;
     -		strbuf_realpath_forgiving(&buf, path, 1);
     -		puts(buf.buf);
     -		strbuf_release(&buf);
    ++		switch (format) {
    ++		case FORMAT_RELATIVE:
    ++			fmt = PATH_FORMAT_RELATIVE;
    ++			break;
    ++		case FORMAT_CANONICAL:
    ++			fmt = PATH_FORMAT_CANONICAL;
    ++			break;
    ++		default:
    ++			fmt = PATH_FORMAT_UNMODIFIED;
    ++			break;
    ++		}
      	}
     -	free(cwd);
     +
    -+	append_formatted_path(&sb, path, prefix, fmt);
    ++	format_path(&sb, path, prefix, fmt);
     +	puts(sb.buf);
     +
     +	strbuf_release(&sb);
    @@ path.c: char *xdg_cache_home(const char *filename)
      	return NULL;
      }
      
    -+void append_formatted_path(struct strbuf *dest, const char *path,
    -+			   const char *prefix, enum path_format format)
    ++void format_path(struct strbuf *dest, const char *path,
    ++		 const char *prefix, enum path_format format)
     +{
    ++	strbuf_reset(dest);
    ++
     +	switch (format) {
     +	case PATH_FORMAT_UNMODIFIED:
     +		strbuf_addstr(dest, path);
    @@ path.c: char *xdg_cache_home(const char *filename)
     +		break;
     +	}
     +
    -+	case PATH_FORMAT_CANONICAL: {
    -+		struct strbuf canonical_buf = STRBUF_INIT;
    -+
    -+		strbuf_realpath_forgiving(&canonical_buf, path, 1);
    -+		strbuf_addbuf(dest, &canonical_buf);
    -+
    -+		strbuf_release(&canonical_buf);
    ++	case PATH_FORMAT_CANONICAL:
    ++		/*
    ++		 * strbuf_realpath_forgiving inherently resets the destination
    ++		 * buffer, safely aligning with our replace semantics.
    ++		 */
    ++		strbuf_realpath_forgiving(dest, path, 1);
     +		break;
    -+	}
     +
     +	default:
     +		BUG("unknown path_format value %d", format);
    @@ path.h: enum scld_error safe_create_leading_directories_no_share(char *path);
     +};
     +
     +/**
    -+ * Format a path according to the specified formatting strategy and append
    -+ * the result to the given strbuf.
    ++ * Format a path according to the specified formatting strategy and store
    ++ * the result in the given strbuf, replacing any existing contents.
     + *
    -+ * `dest`   : The string buffer to append the formatted path to.
    ++ * `dest`   : The string buffer to store the formatted path into.
     + * `path`   : The path string that needs to be formatted.
     + * `prefix` : The directory prefix to calculate relative offsets against.
     + * Pass NULL to default to the current working directory where applicable.
     + * `format` : The formatting behavior rule to execute.
     + */
    -+void append_formatted_path(struct strbuf *dest, const char *path,
    -+			   const char *prefix, enum path_format format);
    ++void format_path(struct strbuf *dest, const char *path,
    ++		 const char *prefix, enum path_format format);
     +
      # ifdef USE_THE_REPOSITORY_VARIABLE
      #  include "strbuf.h"
2:  d2414bee58 ! 2:  69517f1a08 repo: add path.commondir with absolute and relative suffix formatting
    @@ builtin/repo.c: static int get_object_format(struct repository *repo, struct str
     +	if (!common_dir)
     +		return error(_("unable to get common directory"));
     +
    -+	append_formatted_path(buf, common_dir, startup_info->prefix, PATH_FORMAT_CANONICAL);
    ++	format_path(buf, common_dir, startup_info->prefix, PATH_FORMAT_CANONICAL);
     +	return 0;
     +}
     +
    @@ builtin/repo.c: static int get_object_format(struct repository *repo, struct str
     +	if (!common_dir)
     +		return error(_("unable to get common directory"));
     +
    -+	append_formatted_path(buf, common_dir, startup_info->prefix, PATH_FORMAT_RELATIVE);
    ++	format_path(buf, common_dir, startup_info->prefix, PATH_FORMAT_RELATIVE);
     +	return 0;
     +}
     +
3:  9962c7d530 ! 3:  ce43453975 repo: add path.gitdir with absolute and relative suffix formatting
    @@ builtin/repo.c: static int get_path_commondir_relative(struct repository *repo,
     +	if (!git_dir)
     +		return error(_("unable to get git directory"));
     +
    -+	append_formatted_path(buf, git_dir, startup_info->prefix, PATH_FORMAT_CANONICAL);
    ++	format_path(buf, git_dir, startup_info->prefix, PATH_FORMAT_CANONICAL);
     +	return 0;
     +}
     +
    @@ builtin/repo.c: static int get_path_commondir_relative(struct repository *repo,
     +	if (!git_dir)
     +		return error(_("unable to get git directory"));
     +
    -+	append_formatted_path(buf, git_dir, startup_info->prefix, PATH_FORMAT_RELATIVE);
    ++	format_path(buf, git_dir, startup_info->prefix, PATH_FORMAT_RELATIVE);
     +	return 0;
     +}
     +
-- 
2.55.0-rc1

^ permalink raw reply

* Re: [PATCH v14 2/2] checkout: extend --track with a "fetch" mode to refresh start-point
From: Harald Nordgren @ 2026-06-23 17:47 UTC (permalink / raw)
  To: phillip.wood
  Cc: Harald Nordgren via GitGitGadget, git, Ramsay Jones,
	D. Ben Knoble, Kristoffer Haugsbakk, Marc Branchaud
In-Reply-To: <12998c3a-ff69-4a98-9ed6-18aa0224e75e@gmail.com>

Ok, let's focus on the need for the feature before talking code:

In an active project, forking from "origin/master" without refreshing
first often has consequences: you start work that has already been
done, or you build on an old version of the code which causes big
conflicts only later when you pull. The fix is simple ("git fetch
origin master && git checkout -b topic origin/master"), but it is
still a mouthful. Other tools exist because this is annoying enough
that people automate it.

Consider instead that the cost of a fetch is nothing.

When a new user types "git checkout -b topic origin/master", I assume
their mental model is already "start from the LATEST origin/master".
The fetch is implicit, automating it matches what they probably
already meant.


Harald

On Tue, Jun 23, 2026 at 3:49 PM Phillip Wood <phillip.wood123@gmail.com> wrote:
>
> Hi Harald
>
> On 18/06/2026 13:44, Harald Nordgren via GitGitGadget wrote:
> > From: Harald Nordgren <haraldnordgren@gmail.com>
> >
> > Add a "fetch" mode to the "--track" option of "git checkout" / "git
> > switch" that refreshes <start-point> before checking it out:
> >
> >      git checkout -b new_branch --track=fetch origin/some-branch
> >
> > is shorthand for
> >
> >      git fetch origin some-branch
> >      git checkout -b new_branch --track origin/some-branch
> >
> > Identify the remote whose configured fetch refspec maps to
> > <start-point> using find_tracking_remote_for_ref() (the same lookup
> > "--track" uses to pick which remote to record in
> > branch.<name>.remote), then run "git fetch <remote> <src-ref>" for
> > just that ref so other remote-tracking branches are left untouched.
> > When <start-point> is a bare <remote> (e.g. "origin"), follow
> > refs/remotes/<remote>/HEAD to learn which branch to refresh. If
> > "git fetch" fails but the remote-tracking ref already exists locally,
> > warn and proceed from the existing tip; otherwise abort.
>
> This describes the feature well, but does not really explain why it is
> convenient to have a shorthand for "git fetch ... && git checkout -b
> ...". For example if the reason is that in a fast-moving project you
> want to start your new work off the latest upstream changes to minimize
> the chance of merge conflicts or duplicated work it would be useful to
> say that. As Junio has said the implementation looks pretty solid I've
> left a few comments below, but the important thing to do first is to
> convince others that this is a useful feature and why it is worth
> blurring the separation between fetch and checkout. You can do that
> without sending a new version.
>
> > diff --git a/Documentation/git-checkout.adoc b/Documentation/git-checkout.adoc
> > index a8b3b8c2e2..20b6cae60e 100644
> > --- a/Documentation/git-checkout.adoc
> > +++ b/Documentation/git-checkout.adoc
> > @@ -158,11 +158,26 @@ of it").
> >       resets _<branch>_ to the start point instead of failing.
> >
> >   `-t`::
> > -`--track[=(direct|inherit)]`::
> > +`--track[=(direct|inherit|fetch)[,...]]`::
> >       When creating a new branch, set up "upstream" configuration. See
> >       `--track` in linkgit:git-branch[1] for details. As a convenience,
> >       --track without -b implies branch creation.
> >   +
> > +The argument is a comma-separated list. `direct` (the default) and
> > +`inherit` select the tracking mode and are mutually exclusive. Adding
> > +`fetch` requests that the remote be fetched before _<start-point>_ is
> > +resolved, so the new branch starts from a fresh tip: when
> > +_<start-point>_ is in _<remote>/<branch>_ form, only that branch is
> > +updated; when _<start-point>_ is a bare _<remote>_ (e.g. `origin`), the
> > +branch named by _<remote>/HEAD_ is updated, and the checkout fails
> > +with a hint to configure that symref if it is not set. The checkout
> > +also fails if no configured remote's fetch refspec maps to
> > +_<start-point>_, or if more than one does (in which case the `fetch`
> > +cannot be unambiguously routed). If the fetch itself fails and the
> > +corresponding remote-tracking ref already exists, a warning is printed
> > +and the checkout proceeds from the existing tip; otherwise the checkout
> > +is aborted.
>
> Nicely explained
>
> > +static void fetch_remote_for_start_point(const char *arg, int quiet)
> > +{
> > +     struct strbuf dst = STRBUF_INIT;
> > +     struct tracking tracking;
> > +     struct string_list tracking_srcs = STRING_LIST_INIT_DUP;
> > +     struct string_list ambiguous_remotes = STRING_LIST_INIT_DUP;
> > +     struct child_process cmd = CHILD_PROCESS_INIT;
> > +     struct object_id oid;
> > +     struct remote *named_remote;
> > +     int bare_ns;
> > +
> > +     strbuf_addf(&dst, "refs/remotes/%s", arg);
> > +     if (check_refname_format(dst.buf, 0))
> > +             die(_("cannot fetch start-point '%s': not a valid "
> > +                   "remote-tracking name"), arg);
> > +
> > +     named_remote = remote_get(arg);
> > +     bare_ns = !strchr(arg, '/') ||
> > +             (named_remote && remote_is_configured(named_remote, 1));
> > +     if (bare_ns) {
> > +             char *head_path = xstrfmt("refs/remotes/%s/HEAD", arg);
> > +             const char *head_target =
> > +                     refs_resolve_ref_unsafe(get_main_ref_store(the_repository),
> > +                                             head_path,
> > +                                             RESOLVE_REF_READING |
> > +                                             RESOLVE_REF_NO_RECURSE,
>
> Why do we use RESOLVE_REF_NO_RECURSE here? This should match whatever
> "git checkout -b <remote>" does.
>
> > +                                             &oid, NULL);
> > +             if (head_target &&
> > +                 starts_with(head_target, dst.buf) &&
> > +                 head_target[dst.len] == '/' &&
> > +                 !check_refname_format(head_target, 0)) {
>
> I don't think there is any need to call check_refname_format() here -
> you're using the result of reading a ref, not some untrusted input.
>
> > +                     strbuf_reset(&dst);
> > +                     strbuf_addstr(&dst, head_target);
> > +                     bare_ns = 0;
> > +             }
> > +             free(head_path);
> > +     }
> > +
> > +     memset(&tracking, 0, sizeof(tracking));
>
> When you want to zero initialize a stack variable it is easier, clearer
> and less error-prone to initialize it by adding "= {0};" where it is
> declared.
>
> > +     tracking.spec.dst = dst.buf;
> > +     tracking.srcs = &tracking_srcs;
> > +     find_tracking_remote_for_ref(&tracking, &ambiguous_remotes);
> > +
> > +     if (tracking.matches > 1) {
> > +             int status = die_message(_("cannot fetch start-point '%s': "
> > +                                        "fetch refspecs of multiple remotes "
> > +                                        "map to '%s'"), arg, dst.buf);
> > +             advise_ambiguous_fetch_refspec(dst.buf, &ambiguous_remotes);
> > +             exit(status);
> > +     }
> > +
> > +     if (!tracking.matches) {
> > +             if (bare_ns && named_remote &&
> > +                 remote_is_configured(named_remote, 1))
> > +                     die(_("cannot fetch start-point '%s': "
> > +                           "'refs/remotes/%s/HEAD' is not set; run "
> > +                           "'git remote set-head %s --auto' to set it")
>
> This is quite a long message for a single line - breaking the line and
> putting the suggested command on a separate line would make it clearer.
> Something like
>
> cannot fetch start-point 'origin' because 'refs/remotes/origin/HEAD'
> does not exist. To create it run
>
>      git remote set-head origin --auto
>
> > +                         arg, arg, arg);
> > +             die(_("cannot fetch start-point '%s': no configured remote's "
> > +                   "fetch refspec matches it"), arg);
> > +     }
> > +
> > +     strvec_push(&cmd.args, "fetch");
> > +     if (quiet)
> > +             strvec_push(&cmd.args, "--quiet");
> > +     strvec_pushl(&cmd.args, tracking.remote,
> > +                  tracking_srcs.items[0].string, NULL);
> > +     cmd.git_cmd = 1;
> > +     if (run_command(&cmd)) {
> > +             if (!refs_read_ref(get_main_ref_store(the_repository),
> > +                                dst.buf, &oid))
>
> You can use refs_ref_exists() to check a ref exists which avoids
> declaring "oid" which we're not interested in here.
>
> > +                     warning(_("failed to fetch start-point '%s'; "
> > +                               "using existing '%s'"), arg, dst.buf);
> > +             else
> > +                     die(_("failed to fetch start-point '%s'"), arg);
> > +     }
> > +
> > +     string_list_clear(&tracking_srcs, 0);
> > +     string_list_clear(&ambiguous_remotes, 0);
> > +     strbuf_release(&dst);
> > +}
> > +
> > +static int parse_opt_checkout_track(const struct option *opt,
> > +                                 const char *arg, int unset)
> > +{
> > +     struct checkout_opts *opts = opt->value;
> > +     struct string_list tokens = STRING_LIST_INIT_DUP;
> > +     struct string_list_item *item;
> > +     int saw_direct = 0;
> > +     int ret = 0;
> > +
> > +     opts->fetch = 0;
> > +     if (unset) {
> > +             opts->track = BRANCH_TRACK_NEVER;
> > +             return 0;
> > +     }
> > +     opts->track = BRANCH_TRACK_EXPLICIT;
> > +     if (!arg)
> > +             return 0;
> > +
> > +     string_list_split(&tokens, arg, ",", -1);
> > +     for_each_string_list_item(item, &tokens) {
> > +             if (!strcmp(item->string, "fetch"))
> > +                     opts->fetch = 1;
> > +             else if (!strcmp(item->string, "direct"))
> > +                     saw_direct = 1;
> > +             else if (!strcmp(item->string, "inherit"))
> > +                     opts->track = BRANCH_TRACK_INHERIT;
> > +             else {
> > +                     ret = error(_("option `%s' expects \"%s\", \"%s\", "
> > +                                   "or \"%s\""),
> > +                                 "--track", "direct", "inherit", "fetch");
> > +                     goto out;
> > +             }
> > +     }
> > +     if (saw_direct && opts->track == BRANCH_TRACK_INHERIT)
> > +             ret = error(_("option `%s' cannot combine \"%s\" and \"%s\""),
> > +                         "--track", "direct", "inherit");
>
> This parsing looks good
> > diff --git a/t/t7201-co.sh b/t/t7201-co.sh
> > index 7613b1d2a4..1e321b1512 100755
> > --- a/t/t7201-co.sh
> > +++ b/t/t7201-co.sh
> > @@ -870,4 +870,280 @@ test_expect_success 'tracking info copied with autoSetupMerge=inherit' '
> >       test_cmp_config "" --default "" branch.main2.merge
> >   '
>
> I've not read the tests in detail but there seem to be an awful lot of
> them. We only need to test each thing once so for example if we test
>
>      git checkout --track=fetch -b <remote-ref>
>
> with a fetch refspec, that maps refs/heads/*:refs/remotes/origin/xxx/*
> then we don't need to test it without that refspec. I notice you use
> "namespace" below with is confusing because it is not referring to the
> feature described in the gitnamespaces(7) man page.
>
> Try and avoid
>
>      test $a = $b
>
> as it makes it hard to debug failing tests. Instead I think you can use
> test_cmp_rev in this case.
>
> Thanks
>
> Phillip
>
> > +test_expect_success 'setup upstream for --track=fetch tests' '
> > +     git checkout main &&
> > +     git init fetch_upstream &&
> > +     test_commit -C fetch_upstream u_main &&
> > +     git remote add fetch_upstream fetch_upstream &&
> > +     git fetch fetch_upstream &&
> > +     git -C fetch_upstream checkout -b fetch_new &&
> > +     test_commit -C fetch_upstream u_new
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch -b picks up branch created upstream after clone' '
> > +     git checkout main &&
> > +     test_must_fail git rev-parse --verify refs/remotes/fetch_upstream/fetch_new &&
> > +     git checkout --track=fetch -b local_new fetch_upstream/fetch_new &&
> > +     test_cmp_rev refs/remotes/fetch_upstream/fetch_new HEAD &&
> > +     test_cmp_config fetch_upstream branch.local_new.remote &&
> > +     test_cmp_config refs/heads/fetch_new branch.local_new.merge
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch <remote>/<branch> leaves other tracking branches untouched' '
> > +     git checkout main &&
> > +     git -C fetch_upstream checkout -b fetch_target &&
> > +     test_commit -C fetch_upstream u_target_pre &&
> > +     git -C fetch_upstream checkout -b fetch_other &&
> > +     test_commit -C fetch_upstream u_other_pre &&
> > +     git fetch fetch_upstream &&
> > +     other_before=$(git rev-parse refs/remotes/fetch_upstream/fetch_other) &&
> > +     git -C fetch_upstream checkout fetch_target &&
> > +     test_commit -C fetch_upstream u_target_post &&
> > +     git -C fetch_upstream checkout fetch_other &&
> > +     test_commit -C fetch_upstream u_other_post &&
> > +     git checkout --track=fetch -b local_target fetch_upstream/fetch_target &&
> > +     test_cmp_rev refs/remotes/fetch_upstream/fetch_target HEAD &&
> > +     test "$(git rev-parse refs/remotes/fetch_upstream/fetch_other)" = "$other_before"
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch with bare remote name fetches only <remote>/HEAD target' '
> > +     git checkout main &&
> > +     git -C fetch_upstream checkout main &&
> > +     git remote set-head fetch_upstream main &&
> > +     git -C fetch_upstream checkout -b fetch_unrelated &&
> > +     test_commit -C fetch_upstream u_unrelated_pre &&
> > +     git fetch fetch_upstream fetch_unrelated &&
> > +     unrelated_before=$(git rev-parse refs/remotes/fetch_upstream/fetch_unrelated) &&
> > +     git -C fetch_upstream checkout main &&
> > +     test_commit -C fetch_upstream u_main_post &&
> > +     git -C fetch_upstream checkout fetch_unrelated &&
> > +     test_commit -C fetch_upstream u_unrelated_post &&
> > +     git checkout --track=fetch -b local_from_remote fetch_upstream &&
> > +     test_cmp_rev refs/remotes/fetch_upstream/main HEAD &&
> > +     test "$(git rev-parse refs/remotes/fetch_upstream/fetch_unrelated)" = "$unrelated_before"
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch aborts and does not create branch when no existing ref' '
> > +     git checkout main &&
> > +     test_might_fail git branch -D bogus &&
> > +     test_must_fail git checkout --track=fetch -b bogus fetch_upstream/does_not_exist &&
> > +     test_must_fail git rev-parse --verify refs/heads/bogus
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch warns and proceeds when fetch fails but ref exists' '
> > +     git checkout main &&
> > +     git -C fetch_upstream checkout -b fetch_offline &&
> > +     test_commit -C fetch_upstream u_offline &&
> > +     git fetch fetch_upstream fetch_offline &&
> > +     saved_url=$(git config remote.fetch_upstream.url) &&
> > +     test_when_finished "git config remote.fetch_upstream.url \"$saved_url\"" &&
> > +     git config remote.fetch_upstream.url ./does-not-exist &&
> > +     git checkout --track=fetch -b local_offline fetch_upstream/fetch_offline 2>err &&
> > +     test_grep "failed to fetch" err &&
> > +     test_cmp_rev refs/remotes/fetch_upstream/fetch_offline HEAD
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch resolves through configured fetch refspec' '
> > +     git checkout main &&
> > +     git remote add fetch_custom ./fetch_upstream &&
> > +     test_when_finished "git remote remove fetch_custom" &&
> > +     git config --replace-all remote.fetch_custom.fetch \
> > +             "+refs/heads/*:refs/remotes/custom-ns/*" &&
> > +     git -C fetch_upstream checkout -b fetch_refspec &&
> > +     test_commit -C fetch_upstream u_refspec &&
> > +     test_must_fail git rev-parse --verify refs/remotes/custom-ns/fetch_refspec &&
> > +     git checkout --track=fetch -b local_refspec custom-ns/fetch_refspec &&
> > +     test_cmp_rev refs/remotes/custom-ns/fetch_refspec HEAD
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch on namespace bare name follows <ns>/HEAD' '
> > +     git checkout main &&
> > +     git remote add fetch_ns ./fetch_upstream &&
> > +     test_when_finished "git remote remove fetch_ns" &&
> > +     test_when_finished "git update-ref -d refs/remotes/ns_alias/HEAD" &&
> > +     git config --replace-all remote.fetch_ns.fetch \
> > +             "+refs/heads/*:refs/remotes/ns_alias/*" &&
> > +     git fetch fetch_ns &&
> > +     git symbolic-ref refs/remotes/ns_alias/HEAD refs/remotes/ns_alias/main &&
> > +     git -C fetch_upstream checkout main &&
> > +     test_commit -C fetch_upstream u_ns_post &&
> > +     git checkout --track=fetch -b local_ns ns_alias &&
> > +     test_cmp_rev refs/remotes/ns_alias/main HEAD &&
> > +     test_cmp_config fetch_ns branch.local_ns.remote &&
> > +     test_cmp_config refs/heads/main branch.local_ns.merge
> > +'
> > +
> > +test_expect_success '--track=fetch on bare hierarchical remote name follows <ns>/HEAD' '
> > +     git checkout main &&
> > +     git remote add nested/bare ./fetch_upstream &&
> > +     test_when_finished "git remote remove nested/bare" &&
> > +     test_when_finished "git update-ref -d refs/remotes/nested/bare/HEAD" &&
> > +     git fetch nested/bare &&
> > +     git symbolic-ref refs/remotes/nested/bare/HEAD \
> > +             refs/remotes/nested/bare/main &&
> > +     git -C fetch_upstream checkout main &&
> > +     test_commit -C fetch_upstream u_nested_bare_post &&
> > +     git checkout --track=fetch -b local_nested_bare nested/bare &&
> > +     test_cmp_rev refs/remotes/nested/bare/main HEAD
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch handles hierarchical remote name' '
> > +     git checkout main &&
> > +     git remote add nested/remote ./fetch_upstream &&
> > +     test_when_finished "git remote remove nested/remote" &&
> > +     git -C fetch_upstream checkout -b fetch_hier &&
> > +     test_commit -C fetch_upstream u_hier &&
> > +     test_must_fail git rev-parse --verify refs/remotes/nested/remote/fetch_hier &&
> > +     git checkout --track=fetch -b local_hier nested/remote/fetch_hier &&
> > +     test_cmp_rev refs/remotes/nested/remote/fetch_hier HEAD
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch dies on bare remote name with no <ns>/HEAD' '
> > +     git checkout main &&
> > +     git remote add fetch_nohead ./fetch_upstream &&
> > +     test_when_finished "git remote remove fetch_nohead" &&
> > +     test_might_fail git symbolic-ref -d refs/remotes/fetch_nohead/HEAD &&
> > +     test_must_fail git checkout --track=fetch -b local_nohead fetch_nohead 2>err &&
> > +     test_grep "refs/remotes/fetch_nohead/HEAD" err &&
> > +     test_grep "git remote set-head fetch_nohead --auto" err &&
> > +     test_must_fail git rev-parse --verify refs/heads/local_nohead
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch on bare unknown name does not suggest set-head' '
> > +     git checkout main &&
> > +     test_must_fail git rev-parse --verify refs/remotes/no_such_ns/HEAD &&
> > +     test_must_fail git config --get remote.no_such_ns.url &&
> > +     test_must_fail git checkout --track=fetch -b local_unknown no_such_ns 2>err &&
> > +     test_grep "no configured remote" err &&
> > +     test_grep ! "set-head" err &&
> > +     test_must_fail git rev-parse --verify refs/heads/local_unknown
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch rejects <ns>/HEAD pointing outside namespace' '
> > +     git checkout main &&
> > +     git remote add fetch_crossns ./fetch_upstream &&
> > +     test_when_finished "git remote remove fetch_crossns" &&
> > +     test_when_finished "git update-ref -d refs/remotes/fetch_crossns/HEAD" &&
> > +     git fetch fetch_crossns &&
> > +     git symbolic-ref refs/remotes/fetch_crossns/HEAD \
> > +             refs/remotes/fetch_upstream/u_main &&
> > +     test_must_fail git checkout --track=fetch -b local_crossns fetch_crossns 2>err &&
> > +     test_grep "refs/remotes/fetch_crossns/HEAD" err &&
> > +     test_must_fail git rev-parse --verify refs/heads/local_crossns
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch dies on ambiguous fetch refspec match' '
> > +     git checkout main &&
> > +     git remote add fetch_ambig_a ./fetch_upstream &&
> > +     git remote add fetch_ambig_b ./fetch_upstream &&
> > +     test_when_finished "git remote remove fetch_ambig_a" &&
> > +     test_when_finished "git remote remove fetch_ambig_b" &&
> > +     git config --replace-all remote.fetch_ambig_a.fetch \
> > +             "+refs/heads/*:refs/remotes/ambig_ns/*" &&
> > +     git config --replace-all remote.fetch_ambig_b.fetch \
> > +             "+refs/heads/*:refs/remotes/ambig_ns/*" &&
> > +     git -C fetch_upstream checkout -b fetch_ambig &&
> > +     test_commit -C fetch_upstream u_ambig &&
> > +     test_must_fail git checkout --track=fetch -b local_ambig ambig_ns/fetch_ambig 2>err &&
> > +     test_grep "fetch_ambig_a" err &&
> > +     test_grep "fetch_ambig_b" err &&
> > +     test_grep "tracking namespaces" err &&
> > +     test_must_fail git rev-parse --verify refs/heads/local_ambig
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch rejects invalid refname components' '
> > +     git checkout main &&
> > +     test_must_fail git checkout --track=fetch -b local_invalid "foo..bar" 2>err &&
> > +     test_grep "valid" err &&
> > +     test_must_fail git rev-parse --verify refs/heads/local_invalid
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch,inherit rejects invalid refname components' '
> > +     git checkout main &&
> > +     test_must_fail git checkout --track=fetch,inherit -b local_invalid \
> > +             "foo..bar" 2>err &&
> > +     test_grep "valid" err &&
> > +     test_must_fail git rev-parse --verify refs/heads/local_invalid
> > +'
> > +
> > +test_expect_success 'checkout --track=inherit,direct is rejected' '
> > +     test_must_fail git checkout --track=inherit,direct -b bad fetch_upstream/fetch_new 2>err &&
> > +     test_grep "cannot combine" err
> > +'
> > +
> > +test_expect_success 'checkout --track=direct,inherit is rejected' '
> > +     test_must_fail git checkout --track=direct,inherit -b bad fetch_upstream/fetch_new 2>err &&
> > +     test_grep "cannot combine" err
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch then --track=direct drops fetch (last-one-wins)' '
> > +     git checkout main &&
> > +     git -C fetch_upstream checkout -b fetch_lastwin &&
> > +     test_commit -C fetch_upstream u_lastwin &&
> > +     test_must_fail git rev-parse --verify refs/remotes/fetch_upstream/fetch_lastwin &&
> > +     test_must_fail git checkout --track=fetch --track=direct \
> > +             -b local_lastwin fetch_upstream/fetch_lastwin &&
> > +     test_must_fail git rev-parse --verify refs/remotes/fetch_upstream/fetch_lastwin
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch then --no-track drops fetch' '
> > +     git checkout main &&
> > +     git -C fetch_upstream checkout -b fetch_notrack &&
> > +     test_commit -C fetch_upstream u_notrack &&
> > +     test_must_fail git rev-parse --verify refs/remotes/fetch_upstream/fetch_notrack &&
> > +     test_must_fail git checkout --track=fetch --no-track \
> > +             -b local_notrack fetch_upstream/fetch_notrack &&
> > +     test_must_fail git rev-parse --verify refs/remotes/fetch_upstream/fetch_notrack
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch,inherit fetches remote-tracking start-point' '
> > +     git checkout main &&
> > +     git -C fetch_upstream checkout -b fetch_inherit &&
> > +     test_commit -C fetch_upstream u_inherit &&
> > +     test_must_fail git rev-parse --verify refs/remotes/fetch_upstream/fetch_inherit &&
> > +     git checkout --track=fetch,inherit -b local_inherit \
> > +             fetch_upstream/fetch_inherit &&
> > +     test_cmp_rev refs/remotes/fetch_upstream/fetch_inherit HEAD
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch,inherit errors when start-point does not map to a remote' '
> > +     git checkout main &&
> > +     test_must_fail git checkout --track=fetch,inherit -b bad main 2>err &&
> > +     test_grep "no configured remote" err &&
> > +     test_must_fail git rev-parse --verify refs/heads/bad
> > +'
> > +
> > +test_expect_success 'checkout --track=fetch on local start-point errors' '
> > +     git checkout main &&
> > +     test_must_fail git checkout --track=fetch -b bad main 2>err &&
> > +     test_grep "no configured remote" err &&
> > +     test_must_fail git rev-parse --verify refs/heads/bad
> > +'
> > +
> > +test_expect_success 'checkout --track=bogus reports an error' '
> > +     git checkout main &&
> > +     test_must_fail git checkout --track=bogus -b bogus_branch fetch_upstream/fetch_new 2>err &&
> > +     test_grep "expects" err
> > +'
> > +
> > +test_expect_success 'checkout -q --track=fetch silences the fetch output' '
> > +     git checkout main &&
> > +     git -C fetch_upstream checkout -b fetch_quiet &&
> > +     test_commit -C fetch_upstream u_quiet &&
> > +     test_must_fail git rev-parse --verify refs/remotes/fetch_upstream/fetch_quiet &&
> > +     git checkout -q --track=fetch -b local_quiet \
> > +             fetch_upstream/fetch_quiet 2>err &&
> > +     test_grep ! "-> fetch_upstream/fetch_quiet" err &&
> > +     test_cmp_rev refs/remotes/fetch_upstream/fetch_quiet HEAD
> > +'
> > +
> > +test_expect_success 'switch --track=fetch -c picks up branch created upstream after clone' '
> > +     git checkout main &&
> > +     git -C fetch_upstream checkout -b fetch_switch &&
> > +     test_commit -C fetch_upstream u_switch &&
> > +     test_must_fail git rev-parse --verify refs/remotes/fetch_upstream/fetch_switch &&
> > +     git switch --track=fetch -c local_switch fetch_upstream/fetch_switch &&
> > +     test_cmp_rev refs/remotes/fetch_upstream/fetch_switch HEAD
> > +'
> > +
> >   test_done
>

^ permalink raw reply

* What's cooking in git.git (Jun 2026, #09)
From: Junio C Hamano @ 2026-06-23 16:56 UTC (permalink / raw)
  To: git

Here are the topics that have been cooking in my tree.  Commits
prefixed with '+' are in 'next' (being in 'next' is a sign that a
topic is stable enough to be used and is a candidate to be in a
future release).  Commits prefixed with '-' are only in 'seen', and
aren't considered "accepted" at all and may be annotated with a URL
to a message that raises issues but they are by no means exhaustive.
A topic without enough support may be discarded after a long period
of no activity (of course they can be resubmitted when new interests
arise).

Git 2.55-rc2 has been tagged.  The tree is in deep feature-freeze,
and remaining topics in 'next' will stay in "Will cook in 'next'"
instead of "Will merge to 'master'" state, until Git 2.55 final.

Copies of the source code to Git live in many repositories, and the
following is a list of the ones I push into or their mirrors.  Some
repositories have only a subset of branches.

With maint, master, next, seen, todo:

	git://git.kernel.org/pub/scm/git/git.git/
	git://repo.or.cz/alt-git.git/
	https://kernel.googlesource.com/pub/scm/git/git/
	https://github.com/git/git/
	https://gitlab.com/git-scm/git/

With all the integration branches and topics broken out:

	https://github.com/gitster/git/

Even though the preformatted documentation in HTML and man format
are not sources, they are published in these repositories for
convenience (replace "htmldocs" with "manpages" for the manual
pages):

	git://git.kernel.org/pub/scm/git/git-htmldocs.git/
	https://github.com/gitster/git-htmldocs.git/

Release tarballs are available at:

	https://www.kernel.org/pub/software/scm/git/

--------------------------------------------------
[Graduated to 'master']

* hn/macos-linker-warning (2026-06-19) 1 commit
  (merged to 'next' on 2026-06-22 at 0e7f024ab5)
 + config.mak.uname: avoid macOS dup-library warning

 Xcode 15 and later has a linker set to complain when the same library
 archive is listed twice on the command line.  Squelch the annoyance.
 cf. <ajjspU7lJ01GgrBw@pks.im>
 source: <pull.2314.v3.git.git.1781901127385.gitgitgadget@gmail.com>


* js/win32-localtime-r (2026-06-22) 1 commit
  (merged to 'next' on 2026-06-22 at 67d3fa726d)
 + win32: ensure that `localtime_r()` is declared even in i686 builds

 Build-fix for 32-bit Windows.
 source: <pull.2157.git.1782117847057.gitgitgadget@gmail.com>


* ps/gitlab-ci-windows (2026-06-15) 1 commit
  (merged to 'next' on 2026-06-22 at 6d177c61ea)
 + gitlab-ci: migrate Windows builds away from Chocolatey

 Wean the Windows builds in GitLab CI procedure away from
 (unfortunately unreliable) Chocolatey to install dependencies.
 cf. <ajP5owy3r_GyuLqk@denethor>
 source: <20260615-b4-pks-gitlab-ci-drop-chocolatey-v1-1-51a6e7d5e388@pks.im>

--------------------------------------------------
[Stalled]

* jt/config-lock-timeout (2026-05-17) 1 commit
 - config: retry acquiring config.lock, configurable via core.configLockTimeout

 Configuration file locking now retries for a short period, avoiding
 failures when multiple processes attempt to update the configuration
 simultaneously.

 Waiting for response(s) to review comment(s) for too long, stalled.
 cf. <agrIrGwSMFlKTx9x@pks.im>
 source: <20260517132111.1014901-1-joerg@thalheim.io>


* js/parseopt-subcommand-autocorrection (2026-04-27) 11 commits
 - SQUASH???
 - doc: document autocorrect API
 - parseopt: add tests for subcommand autocorrection
 - parseopt: enable subcommand autocorrection for git-remote and git-notes
 - parseopt: autocorrect mistyped subcommands
 - autocorrect: provide config resolution API
 - autocorrect: rename AUTOCORRECT_SHOW to AUTOCORRECT_HINT
 - autocorrect: use mode and delay instead of magic numbers
 - help: move tty check for autocorrection to autocorrect.c
 - help: make autocorrect handling reusable
 - parseopt: extract subcommand handling from parse_options_step()

 The parse-options library learned to auto-correct misspelled
 subcommand names.

 Waiting for response(s) to review comment(s) for too long, stalled.
 cf. <xmqq33yzd9yf.fsf@gitster.g>
 cf. <SY0P300MB0801E50FCB7EB2F45CD15208CE042@SY0P300MB0801.AUSP300.PROD.OUTLOOK.COM>
 source: <SY0P300MB0801677A2A1E0FD38D06A841CE2A2@SY0P300MB0801.AUSP300.PROD.OUTLOOK.COM>


* cl/conditional-config-on-worktree-path (2026-05-24) 2 commits
 - config: add "worktree" and "worktree/i" includeIf conditions
 - config: refactor include_by_gitdir() into include_by_path()

 The [includeIf "condition"] conditional inclusion facility for
 configuration files has learned to use the location of worktree
 in its condition.

 Waiting for response(s) to review comment(s) for too long, stalled.
 cf. <xmqq8q97et9b.fsf@gitster.g>
 source: <20260525-includeif-worktree-v5-0-1efe525d025a@black-desk.cn>

--------------------------------------------------
[Cooking]

* kk/merge-base-exhaustion (2026-06-20) 6 commits
 - Documentation/technical: add paint-down-to-common doc
 - t6099, t6600: add side-exhaustion regression tests
 - t6600: add test cases for side-exhaustion edge cases
 - commit-reach: terminate merge-base walk when one paint side is exhausted
 - commit-reach: introduce struct paint_queue with per-side counters
 - commit-reach: decouple ahead_behind from nonstale_queue

 The merge-base computation has been optimized by stopping the walk
 early when one side's exclusive commits in the queue are exhausted,
 yielding significant speedups for queries with one-sided histories.

 Expecting a reroll.
 cf. <CAL71e4Pcw-UUbHBw_j6PFx2bXmxZ93VLMWG+3Qap=RmCJa_ZgA@mail.gmail.com>
 source: <pull.2149.git.1781951820.gitgitgadget@gmail.com>


* dk/meson-enable-use-nsec-build (2026-06-20) 1 commit
 - meson: wire up USE_NSEC build knob

 The USE_NSEC build knob, which enables support for sub-second file
 timestamp resolution, has been wired up to the Meson build system.

 Waiting for response(s) to review comment(s).
 cf. <ajjuoS5Qc3K0nCRl@pks.im>
 source: <c4c5ade901ff95b0f95939ea818870e4f3d59da1.1781971201.git.ben.knoble+github@gmail.com>


* ps/connected-generic-promisor-checks (2026-06-22) 4 commits
 - connected: search promisor objects generically
 - odb/source-packed: support flags when iterating an object prefix
 - odb/source-packed: extract logic to skip certain packs
 - Merge branch 'ps/odb-source-packed' into ps/connected-generic-promisor-checks
 (this branch uses ps/odb-source-packed.)

 The connectivity check has been refactored to search for promisor
 objects in a generic way using the object database interface,
 rather than iterating packfiles directly. This allows connectivity
 checks to work properly in repositories that do not use packfiles.

 Waiting for response(s) to review comment(s).
 cf. <xmqq4iiu1mrt.fsf@gitster.g>
 source: <20260622-pks-connected-generic-promisor-checks-v1-0-25eba2698202@pks.im>


* ps/libgit-in-subdir (2026-06-22) 3 commits
 - Move libgit.a sources into separate "lib/" directory
 - t/helper: prepare "test-example-tap.c" for introduction of "lib/"
 - Merge branch 'ps/odb-source-packed' into ps/libgit-in-subdir
 (this branch uses ps/odb-source-packed.)

 The source files for libgit.a have been moved into a new "lib/"
 directory to clean up the top-level directory and clearly separate
 library code.

 Needs review.
 source: <20260622-pks-libgit-in-subdir-v2-0-cb946c51ee7b@pks.im>


* ps/odb-generalize-prepare (2026-06-22) 3 commits
 - odb: introduce `odb_prepare()`
 - odb/source: generalize `reprepare()` callback
 - Merge branch 'ps/odb-source-packed' into ps/odb-generalize-prepare
 (this branch uses ps/odb-source-packed.)

 The `reprepare()` callback for object database sources has been
 generalized into a `prepare()` callback with an optional flush cache
 flag, and a new `odb_prepare()` wrapper has been introduced to
 allow pre-opening object database sources.

 Needs review.
 source: <20260622-b4-pks-odb-generalize-prepare-v1-0-d2a5c5d13144@pks.im>


* jc/submittingpatches-design-critiques (2026-06-20) 1 commit
  (merged to 'next' on 2026-06-22 at 7495b5f9d6)
 + SubmittingPatches: address design critiques

 The documentation in SubmittingPatches has been updated to clarify how
 patch contributors should respond to design and viability critiques,
 and how the resolution of such critiques should be recorded in the
 final commit messages.

 Will cook in 'next'.
 cf. <ajjwYGWZ6hQWr600@pks.im>
 source: <xmqqeci0g4mz.fsf@gitster.g>


* wy/doc-clarify-review-replies (2026-06-21) 2 commits
 - doc: advise batching patch rerolls
 - doc: encourage review replies before rerolling

 Documentation on community contribution guidelines has been updated to
 encourage replying to review comments before rerolling, and to advise
 a default limit of at most one reroll per day to give reviewers across
 different time zones enough time to participate.

 Needs review.
 source: <cover.1782028813.git.wy@wyuan.org>


* ty/migrate-ignorecase (2026-06-19) 2 commits
 - config: use repo_ignore_case() to access core.ignorecase
 - environment: move ignore_case into repo_config_values

 The global configuration variable ignore_case (representing the
 core.ignorecase configuration) has been migrated into struct
 repo_config_values to tie it to a specific repository instance.

 Waiting for comments from Johannes.
 cf. <xmqqzf0mzc7j.fsf@gitster.g>
 source: <20260619155152.642760-1-cat@malon.dev>


* mm/line-log-limited-ops (2026-06-18) 7 commits
 - diffcore-pickaxe: scope -G to the -L tracked range
 - diff: support --check with -L line ranges
 - line-log: support diff stat formats with -L
 - diff: extract a line-range diff helper for reuse
 - diff: emit -L hunk headers via xdiff's formatter
 - diff: simplify the line-range filter by classifying removals immediately
 - diff: rename and group the line-range filter for clarity

 "git log -L<range>:<path>" learned to limit various "diff" operations
 like --stat, --check, -G, to the specified range:path.

 Waiting for response(s) to review comment(s).
 cf. <CAC2QwmKEHb+LL4ZkQwq+Rw8eyDXzdBp_nxa_d+Ecx0K1icNqQA@mail.gmail.com>
 source: <pull.2152.git.1781806593.gitgitgadget@gmail.com>


* hn/history-squash (2026-06-20) 4 commits
 - history: re-edit a squash with every message
 - history: add squash subcommand to fold a range
 - history: give commit_tree_ext a message template
 - history: extract helper for a commit's parent tree

 The experimental "git history" command has been taught a new
 "squash" subcommand to fold a range of commits into a single commit,
 replaying any descendants on top.

 Waiting for response(s) to review comment(s).
 cf. <ajkijomPo_kXSXul@pks.im>
 source: <pull.2337.v4.git.git.1782021195.gitgitgadget@gmail.com>


* ps/t4216-tap-fix (2026-06-19) 1 commit
 - t4216: fix no-op test that breaks TAP output

 TAP output breakage fix.

 Waiting for response(s) to review comment(s).
 cf. <xmqqa4sqlchz.fsf@gitster.g>
 cf. <ajjBmi39IFJW5p5V@pks.im>
 source: <20260619-pks-t4216-drop-unused-prereq-v1-1-2ce0d7bea088@pks.im>


* mh/fetch-follow-remote-head-config (2026-06-19) 8 commits
  (merged to 'next' on 2026-06-22 at 423079e1c8)
 + fetch: fixup a misaligned comment
 + fetch: add configuration variable fetch.followRemoteHEAD
 + fetch: refactor do_fetch handling of followRemoteHEAD
 + fetch: return 0 on known git_fetch_config
 + fetch: rename function report_set_head
 + t5510: cleanup remote in followRemoteHEAD dangling ref test
 + doc: explain fetchRemoteHEADWarn advice
 + fetch: fixup set_head advice for warn-if-not-branch

 The `fetch.followRemoteHEAD` configuration variable has been added to
 provide a default for the per-remote `remote.<name>.followRemoteHEAD`
 setting.

 Will cook in 'next'.
 cf. <xmqqcxxp1j2t.fsf@gitster.g>
 source: <20260619094751.2996804-1-m@lfurio.us>


* ps/refs-writing-subcommands (2026-06-17) 5 commits
 - builtin/refs: add "rename" subcommand
 - builtin/refs: add "create" subcommand
 - builtin/refs: add "update" subcommand
 - builtin/refs: add "delete" subcommand
 - builtin/refs: drop `the_repository`

 The "git refs" toolbox has been extended with new "create", "delete",
 "update", and "rename" subcommands to create, delete, update, and
 rename references, respectively.

 Needs review.
 source: <20260617-pks-refs-writing-subcommands-v2-0-07f3d18336f9@pks.im>


* po/hash-object-size-t (2026-06-16) 6 commits
  (merged to 'next' on 2026-06-21 at b780a276b9)
 + hash-object: add a >4GB/LLP64 test case using filtered input
 + hash-object: add another >4GB/LLP64 test case
 + hash-object --stdin: verify that it works with >4GB/LLP64
 + hash algorithms: use size_t for section lengths
 + object-file.c: use size_t for header lengths
 + hash-object: demonstrate a >4GB/LLP64 problem

 Support for hashing loose or packed objects larger than 4GB on Windows
 and other LLP64 platforms has been improved by converting object header
 buffers and data-handling functions from 'unsigned long' to 'size_t'.

 Will cook in 'next'.
 cf. <ajOQthRjhD3hRM9w@pks.im>
 source: <pull.2138.v2.git.1781621398.gitgitgadget@gmail.com>


* kh/submittingpatches-trailers (2026-06-18) 5 commits
  (merged to 'next' on 2026-06-22 at 2cd4a152c9)
 + SubmittingPatches: note that trailer order matters
 + SubmittingPatches: be consistent with trailer markup
 + SubmittingPatches: document Based-on-patch-by trailer
 + SubmittingPatches: discourage common Linux trailers
 + SubmittingPatches: encourage trailer use for substantial help

 The trailer sections in SubmittingPatches have been updated to
 encourage use of standard trailers.

 Will cook in 'next'.
 cf. <xmqq4ij0vo8f.fsf@gitster.g>
 source: <V3_CV_SubPatches_trailers.9ec@msgid.xyz>


* mv/log-follow-mergy (2026-06-21) 1 commit
  (merged to 'next' on 2026-06-22 at f7e984a003)
 + log: improve --follow following renames for non-linear history

 "git log --follow" has been updated to handle non-linear history, in
 which the path being tracked gets renamed differently in multiple
 history lines, better.

 Will cook in 'next'.
 source: <ajjU4w2B0NlZffw1@collabora.com>


* wy/doc-myfirstcontribution-trim-quotes (2026-06-11) 1 commit
 - MyFirstContribution: mention trimming quoted text in replies

 The contributor guide has been updated to advise new contributors to
 trim irrelevant quoted text when replying to review comments, matching
 the existing advice given to reviewers.

 Comments?
 cf. <xmqqcxxwljue.fsf@gitster.g>
 source: <080402ff0ac8127b654dccea59a1bf643df62a5c.1781186476.git.wy@wyuan.org>


* tb/midx-incremental-custom-base (2026-06-12) 3 commits
 - midx-write: include packs above custom incremental base
 - midx: pass custom '--base' through incremental writes
 - t5334: expose shared `nth_line()` helper

 The `git multi-pack-index write --incremental` command has been
 corrected to properly honor the `--base` option. Previously, the
 custom base was ignored by the normal write path, and the pack
 exclusion logic incorrectly skipped packs from layers above the
 selected base, breaking reachability closure for bitmaps.

 Needs review.
 source: <cover.1781294771.git.me@ttaylorr.com>


* mm/test-grep-lint (2026-06-12) 6 commits
 - t: add greplint to detect bare grep assertions
 - t: convert grep assertions to test_grep
 - t: fix Lexer line count for $() inside double-quoted strings
 - t: extract chainlint's parser into shared module
 - t: fix grep assertions missing file arguments
 - t/README: document test_grep helper

 Needs review.
 source: <pull.2135.v2.git.1781323575.gitgitgadget@gmail.com>


* rs/cat-file-default-format-optim (2026-06-14) 1 commit
  (merged to 'next' on 2026-06-17 at 43ed8b3969)
 + cat-file: speed up default format

 Will cook in 'next'.
 cf. <20260615165326.GA91269@coredump.intra.peff.net>
 source: <5a7ed929-6fe0-496c-83bd-65dee57c2241@web.de>


* kk/prio-queue-get-put-fusion (2026-06-08) 2 commits
 - prio-queue: fold lazy_queue into prio_queue for automatic get+put fusion
 - prio-queue: rename .nr to .nr_ and add accessor helpers

 The lazy priority queue optimization pattern (deferring actual removal
 in prio_queue_get() to allow get+put fusion) has been folded directly
 into prio_queue itself, speeding up commit traversal workflows and
 simplifying callers.

 On hold, waiting for kk/prio-queue-get-put-fusion to land first.
 cf. <CAL71e4MYNiScZjTwkApjDAjRh2LM0_SP59h5HCTywV-Pua03tw@mail.gmail.com>
 source: <pull.2140.v4.git.1780945851.gitgitgadget@gmail.com>


* td/ref-filter-memoize-contains (2026-06-12) 3 commits
 - commit-reach: die on contains walk errors
 - ref-filter: memoize --contains with generations
 - commit-reach: reject cycles in contains walk

 'git branch --contains' and 'git for-each-ref --contains' have
 been optimized to use the memoized commit traversal previously
 used only by 'git tag --contains', significantly speeding up
 connectivity checks across many candidate refs with shared
 history.

 Needs review.
 source: <20260612-ref-filter-memoized-contains-v4-0-5ed39fd001dd@gmail.com>


* tc/replay-linearize (2026-06-22) 3 commits
 - replay: offer an option to linearize the commit topology
 - replay: add helper to put entry into mapped_commits
 - replay: refactor enum replay_mode into a bool

 git replay learns --linearize option to drop merge commits and
 linearize the replayed history, mimicking git rebase
 --no-rebase-merges.

 Waiting for response(s) to review comment(s).
 cf. <xmqq7bnq37jm.fsf@gitster.g>
 source: <20260622-toon-git-replay-drop-merges-v4-0-ff257f534319@iotcl.com>


* ps/setup-drop-global-state (2026-06-10) 8 commits
  (merged to 'next' on 2026-06-15 at d9a8b88d47)
 + treewide: drop USE_THE_REPOSITORY_VARIABLE
 + environment: stop using `the_repository` in `is_bare_repository()`
 + environment: split up concerns of `is_bare_repository_cfg`
 + builtin/init: stop modifying `is_bare_repository_cfg`
 + setup: remove global `git_work_tree_cfg` variable
 + builtin/init: simplify logic to configure worktree
 + builtin/init: stop modifying global `git_work_tree_cfg` variable
 + Merge branch 'ps/setup-centralize-odb-creation' into ps/setup-drop-global-state

 Continuation of "setup.c" refactoring to drop remaining global state
 (`git_work_tree_cfg`, `is_bare_repository_cfg`). The most notable
 outcome is that `is_bare_repository()` has been updated to no longer
 implicitly rely on `the_repository`.

 Will cook in 'next'.
 cf. <airVOrTboNDDGBak@denethor>
 cf. <87ldckyygk.fsf@emacs.iotcl.com>
 source: <20260611-b4-pks-setup-drop-global-state-v2-0-a6f7269c841d@pks.im>


* ps/refs-avoid-chdir-notify-reparent (2026-06-22) 12 commits
 - refs: protect against chicken-and-egg recursion
 - refs/reftable: lazy-load configuration to fix chicken-and-egg
 - reftable: split up write options
 - refs/files: lazy-load configuration to fix chicken-and-egg
 - refs: move parsing of "core.logAllRefUpdates" back into ref stores
 - repository: free main reference database
 - chdir-notify: drop unused `chdir_notify_reparent()`
 - refs: unregister reference stores from "chdir_notify"
 - setup: don't apply "GIT_REFERENCE_BACKEND" without a repository
 - setup: stop applying repository format twice
 - setup: inline `check_and_apply_repository_format()`
 - Merge branch 'ps/setup-centralize-odb-creation' into ps/refs-avoid-chdir-notify-reparent

 The reference backends have been converted to always use absolute
 paths internally. This allows dropping the calls to
 `chdir_notify_reparent()` and fixes a memory leak in how the
 reference database is constructed with an "onbranch" condition.

 Needs review.
 source: <20260622-b4-pks-refs-avoid-chdir-notify-reparent-v5-0-018475013dbc@pks.im>


* ps/odb-source-packed (2026-06-16) 18 commits
  (merged to 'next' on 2026-06-19 at dcf0c084e4)
 + odb/source-packed: drop pointer to "files" parent source
 + midx: refactor interfaces to work on "packed" source
 + odb/source-packed: stub out remaining functions
 + odb/source-packed: wire up `freshen_object()` callback
 + odb/source-packed: wire up `find_abbrev_len()` callback
 + odb/source-packed: wire up `count_objects()` callback
 + odb/source-packed: wire up `for_each_object()` callback
 + odb/source-packed: wire up `read_object_stream()` callback
 + odb/source-packed: wire up `read_object_info()` callback
 + packfile: use higher-level interface to implement `has_object_pack()`
 + odb/source-packed: wire up `reprepare()` callback
 + odb/source-packed: wire up `close()` callback
 + odb/source-packed: start converting to a proper `struct odb_source`
 + odb/source-packed: store pointer to "files" instead of generic source
 + packfile: move packed source into "odb/" subsystem
 + packfile: split out packfile list logic
 + packfile: rename `struct packfile_store` to `odb_source_packed`
 + Merge branch 'ps/odb-source-loose' into ps/odb-source-packed
 (this branch is used by ps/connected-generic-promisor-checks, ps/libgit-in-subdir and ps/odb-generalize-prepare.)

 The packed object source has been refactored into a proper struct
 odb_source.

 Will cook in 'next'.
 cf. <ajK2QKdW-TdflfR0@denethor>
 source: <20260617-pks-odb-source-packed-v3-0-b5c7583cd795@pks.im>


* td/ref-filter-restore-prefix-iteration (2026-06-12) 1 commit
  (merged to 'next' on 2026-06-19 at a19dbb4193)
 + ref-filter: restore prefix-scoped iteration

 Commands that list branches and tags (like git branch and git tag)
 have been optimized to pass the namespace prefix when initializing
 their ref iterator, avoiding a loose-ref scaling regression in
 repositories with many unrelated loose references.

 Will cook in 'next'.
 cf. <xmqqik7fsv2m.fsf@gitster.g>
 source: <20260612-fix-git-branch-regression-v4-1-f150038c02f4@gmail.com>


* ty/move-protect-hfs-ntfs (2026-06-20) 2 commits
  (merged to 'next' on 2026-06-20 at d8ca0d5180)
 + environment: use 'repo->initialized' for repo_protect_hfs() and repo_protect_ntfs()
  (merged to 'next' on 2026-06-15 at c2a30ca954)
 + environment: move 'protect_hfs' and 'protect_ntfs' into 'repo_config_values'

 The global configuration variables protect_hfs and protect_ntfs have
 been migrated into struct repo_config_values to tie them to
 per-repository configuration state.

 Will cook in 'next'.
 cf. <CAP8UFD35Tiy1_fqpjq8P-z=ZhzR3MTiThqfCs977652umRoSEQ@mail.gmail.com>
 cf. <xmqqse6uwdnz.fsf@gitster.g>
 source: <20260610124353.149874-2-cat@malon.dev>
 source: <20260620140957.667820-1-cat@malon.dev>


* ps/cat-file-remote-object-info (2026-06-19) 12 commits
 - cat-file: make remote-object-info allow-list dynamic
 - cat-file: validate remote atoms with allow_list
 - cat-file: add remote-object-info to batch-command
 - transport: add client support for object-info
 - serve: advertise object-info feature
 - fetch-pack: move fetch initialization
 - connect: refactor packet writing
 - fetch-pack: move function to connect.c
 - t1006: split test utility functions into new "lib-cat-file.sh"
 - cat-file: declare loop counter inside for()
 - git-compat-util: add strtoul_ul() with error handling
 - transport-helper: fix memory leak of helper on disconnect

 The `remote-object-info` command has been added to `git cat-file
 --batch-command`, allowing clients to request object metadata
 (currently size) from a remote server via protocol v2 without
 downloading the entire object.

 The client dynamically filters format placeholders based on
 server-advertised capabilities and safely returns empty strings for
 inapplicable or unsupported fields.

 Waiting for response(s) to review comment(s).
 cf. <CAOLa=ZSvxXuf_bSzKMvViNQ5MuDAqxnQdo4asF9vfMhJaDQcVw@mail.gmail.com>
 source: <20260619-ps-eric-work-rebase-v13-0-3d4c7315d2f8@gmail.com>


* ap/http-redirect-wwwauth-fix (2026-06-02) 1 commit
 - http: preserve wwwauth_headers across redirects

 When cURL follows a redirect, the WWW-Authenticate headers from the
 redirect target were lost because credential_from_url() cleared the
 credential state. This has been fixed by preserving the collected
 headers across the redirect update.

 Expecting a reroll.
 cf. <5144a29d-a53f-4446-beff-e1f549345bf9@nvidia.com>
 source: <20260602161150.1527493-1-aplattner@nvidia.com>


* ps/doc-recommend-b4 (2026-06-15) 3 commits
  (merged to 'next' on 2026-06-17 at dd9a463369)
 + b4: introduce configuration for the Git project
 + MyFirstContribution: recommend the use of b4
 + MyFirstContribution: recommend shallow threading of cover letters

 Project-specific configuration for b4 has been introduced, and the
 documentation has been updated to recommend using it as a
 streamlined method for submitting patches.

 Will cook in 'next'.
 cf. <87eci7yomp.fsf@emacs.iotcl.com>
 source: <20260615-pks-b4-v4-0-22cfca8f19c5@pks.im>


* sn/rebase-update-refs-symrefs (2026-06-03) 1 commit
 - rebase: skip branch symref aliases

 "git rebase --update-refs" has been taught to resolve local branch
 symrefs to their referents before queuing updates. This correctly
 skips aliases of the current branch and avoids duplicate updates for
 underlying real branches, fixing failures when branch aliases (like a
 default branch rename) are present.

 Waiting for response(s) to review comment(s).
 cf. <f982c386-e329-4ab0-b695-e540bcb9de3d@gmail.com>
 source: <pull.2126.v2.git.1780482436865.gitgitgadget@gmail.com>


* mm/diff-process-hunks (2026-06-14) 6 commits
 - blame: consult diff process for no-hunk detection
 - diff: bypass diff process with --no-ext-diff and in format-patch
 - diff: add long-running diff process via diff.<driver>.process
 - sub-process: separate process lifecycle from hashmap management
 - userdiff: add diff.<driver>.process config
 - xdiff: support external hunks via xpparam_t

 A new `diff.<driver>.process` configuration has been introduced to
 allow a long-running external process to act as a hunk provider to
 allows external tools to control which lines Git considers changed
 while leaving all output formatting (word diff, color, blame, etc.) to
 Git's standard pipeline.

 Expecting a reroll.
 cf. <CAC2Qwm+P=fZOtpfMPeMiSXf3Afk6OLYpTP8Br78_PRA8WNL1Wg@mail.gmail.com>
 cf. <CAC2Qwm+P=fZOtpfMPeMiSXf3Afk6OLYpTP8Br78_PRA8WNL1Wg@mail.gmail.com>
 source: <pull.2120.v4.git.1781463564.gitgitgadget@gmail.com>


* tb/pack-path-walk-bitmap-delta-islands (2026-06-21) 5 commits
  (merged to 'next' on 2026-06-22 at 59cf1663e7)
 + pack-objects: support `--delta-islands` with `--path-walk`
 + pack-objects: extract `record_tree_depth()` helper
 + pack-objects: support reachability bitmaps with `--path-walk`
 + t/perf: drop p5311's lookup-table permutation
 + Merge branch 'ds/path-walk-filters' into tb/pack-path-walk-bitmap-delta-islands

 The pack-objects command now supports using reachability bitmaps and
 delta-islands concurrently with the `--path-walk` option, allowing
 faster packaging by falling back to path-walk when bitmaps cannot
 fully satisfy the request.

 Will cook in 'next'.
 cf. <xmqqwlvq1qyy.fsf@gitster.g>
 source: <cover.1782082975.git.me@ttaylorr.com>


* ty/migrate-trust-executable-bit (2026-06-19) 3 commits
 - environment: move trust_executable_bit into repo_config_values
 - read-cache: move 'ce_mode_from_stat()' to 'read-cache.c'
 - read-cache: remove redundant extern declarations

 The 'trust_executable_bit' (coming from 'core.filemode'
 configuration) has been migrated into 'repo_config_values' to tie it
 to a specific repository instance.

 Needs review.
 source: <20260619162105.648495-1-cat@malon.dev>


* kk/prio-queue-cascade-sift (2026-06-01) 1 commit
 - prio-queue: use cascade-down for faster extract-min

 prio_queue_get() has been optimized by using a cascade-down approach
 (promoting the smaller child at each level and sifting up the last
 element from the leaf vacancy), which halves the number of comparisons
 per extract-min operation in the common case.

 Expecting a reroll.
 cf. <CAL71e4Ob-B5MJ5DPY+_tzpj6nyrbQ5WutxED2T93SWJV6kJGPA@mail.gmail.com>
 cf. <CAL71e4MYNiScZjTwkApjDAjRh2LM0_SP59h5HCTywV-Pua03tw@mail.gmail.com>
 source: <pull.2132.v2.git.1780301856444.gitgitgadget@gmail.com>


* jk/repo-info-path-keys (2026-06-20) 3 commits
 - repo: add path.gitdir with absolute and relative suffix formatting
 - repo: add path.commondir with absolute and relative suffix formatting
 - path: extract append_formatted_path() and use in rev-parse

 The "git repo info" command has been taught new keys to output both
 absolute and relative paths for "gitdir" and "commondir", supported by
 a new path-formatting helper extracted from "git rev-parse".

 Expecting a reroll.
 cf. <CA+rGoLcahV9pPqkSAKvz9o3g2cw2PsYXxzzwAC8XoseFzMB5rA@mail.gmail.com>
 source: <20260621055534.46798-1-jayatheerthkulkarni2005@gmail.com>


* ps/history-drop (2026-06-15) 10 commits
 - builtin/history: implement "drop" subcommand
 - builtin/history: split handling of ref updates into two phases
 - reset: stop assuming that the caller passes in a clean index
 - reset: allow the caller to specify the current HEAD object
 - reset: introduce ability to skip updating HEAD
 - reset: introduce dry-run mode
 - reset: modernize flags passed to `reset_working_tree()`
 - reset: rename `reset_head()`
 - reset: drop `USE_THE_REPOSITORY_VARIABLE`
 - read-cache: split out function to drop unmerged entries to stage 0

 The experimental "git history" command has been taught a new "drop"
 subcommand to remove a commit and replay its descendants onto its
 parent.

 Needs review.
 source: <20260615-b4-pks-history-drop-v6-0-2e329e536d78@pks.im>


* jk/setup-gitfile-diag-fix (2026-06-16) 1 commit
  (merged to 'next' on 2026-06-18 at b63b3d1f25)
 + read_gitfile(): simplify NOT_A_REPO error message

 A regression in the error diagnosis code for invalid .git files has
 been fixed, avoiding a potential NULL-pointer crash when reporting
 that a .git file does not point to a valid repository.

 Will cook in 'next'.
 cf. <xmqqjyry4hax.fsf@gitster.g>
 source: <20260616123516.GA2301231@coredump.intra.peff.net>


* kh/doc-trailers (2026-06-10) 10 commits
 - doc: interpret-trailers: document comment line treatment
 - doc: interpret-trailers: commit to “trailer block” term
 - doc: interpret-trailers: join new-trailers again
 - doc: interpret-trailers: add key format example
 - doc: interpret-trailers: explain key format
 - doc: interpret-trailers: explain the format after the intro
 - doc: interpret-trailers: not just for commit messages
 - doc: interpret-trailers: use “metadata” in Name as well
 - doc: interpret-trailers: replace “lines” with “metadata”
 - doc: interpret-trailers: stop fixating on RFC 822

 Documentation updates.

 Expecting a reroll.
 cf. <729baf6b-53ea-4e8d-95ab-5935667e66c2@app.fastmail.com>
 source: <V3_CV_doc_int-tr_key_format.8a3@msgid.xyz>


* za/completion-hide-dotfiles (2026-06-20) 2 commits
 - completion: hide dotfiles by default for path completion
 - completion: hide dotfiles for selected path completion

 The path completion for commands like `git rm` and `git mv`, is being
 updated to hide dotfiles by default, unless the user explicitly starts
 the path with a dot, matching standard shell-completion behavior.

 Waiting for response(s) to review comment(s).
 cf. <xmqq1pe0g08t.fsf@gitster.g>
 source: <pull.2311.v3.git.git.1781978156.gitgitgadget@gmail.com>


* ec/commit-fixup-options (2026-05-26) 2 commits
 - commit: allow -c/-C for all kinds of --fixup
 - commit: allow -m/-F for all kinds of --fixup

 The -m/-F/-c/-C options to supply commit log message from outside the
 editor are now supported for all "git commit --fixup" variations.

 Needs review.
 source: <cover.1779792311.git.erik@cervined.in>


* kh/doc-replay-config (2026-06-05) 4 commits
 - doc: replay: move “default” to the right-hand side
 - doc: replay: use a nested description list
 - doc: replay: improve config description
 - doc: link to config for git-replay(1)

 Doc update for "git replay" to actually refer to its configuration
 variables.

 Needs review.
 source: <V3_CV_doc_replay_config.780@msgid.xyz>


* hn/status-pull-advice-qualified (2026-05-21) 1 commit
  (merged to 'next' on 2026-06-15 at 898a4df940)
 + remote: qualify "git pull" advice for non-upstream compareBranches

 Advice shown by "git status" when the local branch is behind or has
 diverged from its push branch has been updated to suggest "git pull
 <remote> <branch>".

 Will cook in 'next'.
 cf. <xmqq7bo6xuok.fsf@gitster.g>
 source: <pull.2301.v4.git.git.1779372367317.gitgitgadget@gmail.com>


* hn/branch-delete-merged (2026-06-22) 7 commits
 - branch: add --dry-run for --delete-merged
 - branch: add branch.<name>.deleteMerged opt-out
 - branch: add --delete-merged <branch>
 - branch: prepare delete_branches for a bulk caller
 - branch: let delete_branches skip unmerged branches on bulk refusal
 - branch: convert delete_branches() to a flags argument
 - branch: add --forked filter for --list mode

 "git branch" command learned "--delete-merged" option to remove
 local branches that have already been merged to the remote-tracking
 branches they track.

 Waiting for response(s) to review comment(s).
 cf. <cb6fcdfb-67b4-429d-b820-c4e623f28cfa@gmail.com>
 source: <pull.2285.v17.git.git.1782113388.gitgitgadget@gmail.com>


* cc/promisor-auto-config-url-more (2026-05-27) 8 commits
  (merged to 'next' on 2026-06-15 at d1c99e75cc)
 + doc: promisor: improve acceptFromServer entry
 + promisor-remote: auto-configure unknown remotes
 + promisor-remote: trust known remotes matching acceptFromServerUrl
 + promisor-remote: introduce promisor.acceptFromServerUrl
 + promisor-remote: add 'local_name' to 'struct promisor_info'
 + urlmatch: add url_normalize_pattern() helper
 + urlmatch: change 'allow_globs' arg to bool
 + t5710: simplify 'mkdir X' followed by 'git -C X init'

 The handling of promisor-remote protocol capability has been
 loosened to allow the other side to add to the list of promisor
 remotes via the promisor.acceptFromServerURL configuration
 variable.

 Will cook in 'next'.
 cf. <877bo7294j.fsf@emacs.iotcl.com>
 cf. <xmqqh5naxwfc.fsf@gitster.g>
 source: <20260527140820.1438165-1-christian.couder@gmail.com>


* hn/checkout-track-fetch (2026-06-18) 2 commits
 - checkout: extend --track with a "fetch" mode to refresh start-point
 - branch: expose helpers for finding the remote owning a tracking ref

 "git checkout --track=..." learned to optionally fetch the branch
 from the remote the new branch will work with.

 Waiting for response(s) to review comment(s).
 cf. <12998c3a-ff69-4a98-9ed6-18aa0224e75e@gmail.com>
 source: <pull.2281.v14.git.git.1781786652.gitgitgadget@gmail.com>


* en/ort-harden-against-corrupt-trees (2026-06-13) 5 commits
  (merged to 'next' on 2026-06-18 at e51bee59ca)
 + cache-tree: fix verify_cache() to catch non-adjacent D/F conflicts
 + merge-ort: abort merge when trees have duplicate entries
 + merge-ort: free diff pairs queue in clear_or_reinit_internal_opts()
 + merge-ort: drop unnecessary show_all_errors from collect_merge_info()
 + merge-ort: propagate callback errors from traverse_trees_wrapper()

 "ort" merge backend handles merging corrupt trees better by
 aborting when it should.

 Will cook in 'next'.
 cf. <xmqq5x3ldu4h.fsf@gitster.g>
 source: <pull.2096.v2.git.1781419047.gitgitgadget@gmail.com>


* pw/status-rebase-todo (2026-06-22) 2 commits
  (merged to 'next' on 2026-06-22 at a32de5bd17)
 + status: improve rebase todo list parsing
 + sequencer: factor out parsing of todo commands

 The display of the rebase todo list in "git status" has been
 improved to correctly abbreviate object IDs for more commands and
 avoid misinterpreting refs as object IDs.

 Will cook in 'next'.
 cf. <xmqqechy1o7p.fsf@gitster.g>
 source: <cover.1782117361.git.phillip.wood@dunelm.org.uk>


* ps/shift-root-in-graph (2026-06-20) 3 commits
 - graph: indent visual root in graph
 - revision: add peek functions for lookahead
 - lib-log-graph: move check_graph function

 "git log --graph" has been modified to visually distinguish
 parentless "root" commits (and commits that become roots due to
 history simplification) by indenting them, preventing them from
 appearing falsely related to unrelated commits rendered immediately
 above them.

 Waiting for response(s) to review comment(s).
 The peek-ahead approach may need to be scratched.
 cf. <CAN5EUNSj-2hkEBF7N_M6RLsuujDNFNUF3w53zR7SN1_5i2BRyg@mail.gmail.com>
 cf. <CAL71e4OQ_kGb+UwHgikHG236-8BVtc7P9OdpV4i4UzYRCoPczw@mail.gmail.com>
 source: <20260620-ps-pre-commit-indent-v6-0-cdc6d8fd5fbc@gmail.com>

^ permalink raw reply

* [ANNOUNCE] Git v2.55.0-rc2
From: Junio C Hamano @ 2026-06-23 16:46 UTC (permalink / raw)
  To: git; +Cc: Linux Kernel, git-packagers

A release candidate Git v2.55.0-rc2 is now available for testing at
the usual places.  It is comprised of 486 non-merge commits since
v2.54.0, contributed by 85 people, 30 of which are new faces [*].

The tarballs are found at:

    https://www.kernel.org/pub/software/scm/git/testing/

The following public repositories all have a copy of the
'v2.55.0-rc2' tag and the 'master' branch that the tag points at:

  url = https://git.kernel.org/pub/scm/git/git
  url = https://kernel.googlesource.com/pub/scm/git/git
  url = git://repo.or.cz/alt-git.git
  url = https://github.com/gitster/git

New contributors whose contributions weren't in v2.54.0 are as follows.
Welcome to the Git development community!

  Abhinav Gupta, Aliwoto, Arijit Banerjee, Brandon Chinn,
  Claude Sonnet 4.6, David Lin, Dominik Loidolt, Ethan Dickson,
  Hugo Osvaldo Barrera, Ivan Baluta, Jean-Christophe Manciot,
  Jonas Rebmann, Koutian Wu, Kristofer Karlsson, Kushal Das,
  Luke Martin, Luna Schwalbe, Matheus Afonso Martins Moreira,
  Michael Grossfeld, Owen Stephens, Rob McDonald, Saagar Jha, Scott
  Bauersfeld, Scott L. Burson, Sebastien Tardif, Shardul Natu,
  Siddh Raman Pant, slonkazoid, Tamir Duberstein, and Weijie Yuan.

Returning contributors who helped this release are as follows.
Thanks for your continued support.

  Adam Johnson, Adrian Ratiu, Ævar Arnfjörð Bjarmason, Alexander
  Monakov, Alyssa Ross, Andrew Kreimer, brian m. carlson,
  Christian Couder, D. Ben Knoble, Derrick Stolee, Elijah
  Newren, Emily Shaffer, Ezekiel Newren, Ghanshyam Thakkar, Greg
  Hurrell, Harald Nordgren, Jacob Keller, Jan Palus, Jayesh Daga,
  Jean-Noël Avila, Jeff King, Johannes Schindelin, Johannes Sixt,
  Jonatan Holmgren, Junio C Hamano, Justin Tobler, Karthik Nayak,
  Kristoffer Haugsbakk, LorenzoPegorari, Lucas Seiki Oshiro,
  Mark Levedahl, Matthew John Cheetham, Michael Montalbo, Mirko
  Faina, Olamide Caleb Bello, Pablo Sabater, Patrick Steinhardt,
  Paul Tarjan, Philippe Blain, Phillip Wood, Pushkar Singh,
  Ramsay Jones, René Scharfe, Samo Pogačnik, Shreyansh Paliwal,
  Siddharth Asthana, Siddharth Shrimali, SZEDER Gábor, Taylor
  Blau, Toon Claes, Torsten Bögershausen, Trieu Huynh, Tuomas
  Ahola, Usman Akinyemi, and Zakariyah Ali.

[*] We are counting not just the authorship contribution but issue
    reporting, mentoring, helping and reviewing that are recorded in
    the commit trailers.

----------------------------------------------------------------

Git v2.55 Release Notes (draft)
===============================

UI, Workflows & Features
------------------------

 * Hook scripts defined via the configuration system can now be
   configured to run in parallel.

 * The userdiff driver for the Scheme language has been extended to
   cover other Lisp dialects.

 * Terminal control sequences coming over the sideband while talking
   to a remote repository are mostly disabled by default, except for
   ANSI color escape sequences.

 * "ort" merge backend improvements.

 * "git checkout -m another-branch" was invented to deal with local
   changes to paths that are different between the current and the new
   branch, but it gave only one chance to resolve conflicts.  The command
   was taught to create a stash to save the local changes.

 * A new builtin "git format-rev" is introduced for pretty formatting
   one revision expression per line or commit object names found in
   running text.

 * "git history" learned "fixup" command.

 * The internal URL parsing logic has been made accessible via a new
   subcommand "git url-parse".

 * Misspelt proxy URL (e.g., httt://...) did not trigger any warning
   or failure, which has been corrected.

 * Document the fact that .git/info/exclude is shared across worktrees
   linked to the same repository.

 * The command line parser for "git diff" learned a few options take
   only non-negative integers.

 * The graph output from commands like "git log --graph" can now be
   limited to a specified number of lanes, preventing overly wide output
   in repositories with many branches.

 * The fsmonitor daemon has been implemented for Linux.

 * "git cat-file --batch" learns an in-line command "mailmap"
   that lets the user toggle use of mailmap.

 * The "git pack-objects --path-walk" traversal has been integrated
   with several object filters, including blobless and sparse filters.

 * "git push" learned to take a "remote group" name to push to, which
   causes pushes to multiple places, just like "git fetch" would do.

 * The 'git-jump' command (in contrib/) has been taught to automatically
   pick a mode (merge, diff, or ws) when invoked without arguments.

 * The documentation for `push.default = simple` has been clarified to
   better explain its behavior, making it clear that it pushes the
   current branch to a same-named branch on the remote, and detailing
   the upstream requirements for centralized workflows.

 * The documentation for "--word-diff" has been extended with a bit of
   implementation detail of where these different words come from.

 * "git config foo.bar=baz" is not likely to be a request to read the
   value of such a variable with '=' in its name; rather it is plausible
   that the user meant "git config set foo.bar baz".  Give advice when
   giving an error message.

 * "git rev-list" (and "git log" family of commands) learned a new "--max-count-oldest"
   that picks oldest N commits in the range instead of the usual newest.

 * Various AsciiDoc markup fixes in 'git config' documentation and
   related files to ensure lists and formatting are rendered correctly.


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------

 * Promisor remote handling has been refactored and fixed in
   preparation for auto-configuration of advertised remotes.

 * Rust support is enabled by default (but still allows opting out) in
   some future version of Git.

 * Preparation of the xdiff/ codebase to work with Rust.

 * Use a larger buffer size in the code paths to ingest pack stream.

 * Refactor service routines in the ref subsystem backends.

 * Shrink wasted memory in Myers diff that does not account for common
   prefix and suffix removal.

 * Enable expensive tests to catch topics that may cause breakages on
   integration branches closer to their origin in the contributor PR
   builds.

 * "git merge-base" optimization.

 * The limit_list() function that is one of the core part of the
   revision traversal infrastructure has been optimized by replacing
   its use of linear list with priority queue.

 * In a lazy clone, "git cherry" and "git grep" often fetch necessary
   blob objects one by one from promisor remotes.  It has been corrected
   to collect necessary object names and fetch them in bulk to gain
   reasonable performance.

 * The logic to determine that branches in an octopus merge are
   independent has been optimized.

 * The consistency checks for the files reference backend have been updated
   to skip lock files earlier, avoiding unnecessary parsing of
   intermediate files.

 * The negotiation tip options in "git fetch" have been reworked to
   allow requiring certain refs to be sent as "have" lines, and to
   restrict negotiation to a specific set of refs.

 * The repacking code has been refactored and compaction of MIDX layers
   have been implemented, and incremental strategy that does not require
   all-into-one repacking has been introduced.

 * ODB transaction interface is being reworked to explicitly handle
   object writes.

 * Add a new odb "in-memory" source that is meant to only hold
   tentative objects (like the virtual blob object that represents the
   working tree file used by "git blame").

 * Many uses of the_repository has been updated to use a more
   appropriate struct repository instance in setup.c codepath.

 * Revision traversal optimization.

 * Build update.

 * The logic to lazy-load trees from the commit-graph has been made
   more robust by falling back to reading the commit object when
   the commit-graph is no longer available.

 * The "name" argument in git_connect() and related functions has been
   converted to a "service" enum to improve type safety and clarify its
   purpose.

 * 'git restore --staged' has been optimized to avoid unnecessarily expanding
   the sparse index when operating on paths within the sparse checkout
   definition, by handling sparse directory entries at the tree level.

 * "git stash -p" has been optimized by reusing cached index
   entries in its temporary index, avoiding unnecessary lstat()
   calls on unchanged files.

 * The check for non-stale commits in the priority queue used by
   `paint_down_to_common` and `ahead_behind` has been optimized by
   replacing an O(N) scan with an O(1) counter, yielding performance
   improvements in repositories with wide histories.

 * Reachability bitmap generation has been significantly optimized. By
   reordering tree traversal, caching object positions, and refining how
   pseudo-merge bitmaps are constructed, the performance of "git repack
   --write-midx-bitmaps" is improved, especially for large repositories
   and when using pseudo-merges.

 * Adding a decimal integer with strbuf_addf("%u") appears commonly;
   they have been optimized by using a custom formatter.

 * Formatting object name in full hexadecimal form has been optimized
   by using a new strbuf_add_oid_hex() helper function.

 * Encourage original authors to monitor the CI status.

 * The `git log -L` implementation has been refactored to use the
   standard diff output pipeline, enabling pickaxe and diff-filter to
   work as expected. Additionally, metadata-only diff formats like
   --raw and --name-only are now supported with -L.

 * The loose object source has been refactored into a proper `struct
   odb_source`.

 * Guidelines on how to write a cover letter for a multi-patch series
   have been added to SubmittingPatches, which also got a new marker
   to separate the section for typofixes.

 * The setup logic to discover and configure repositories has been
   refactored, and the initialization of the object database has been
   centralized.

 * Many core configuration variables have been migrated from global
   variables into 'repo_config_values' to tie them to a specific
   repository instance, avoiding cross-repository state leakage.

 * Streaming revision walks have been optimized by using a priority queue
   for date-sorting commits, speeding up walks repositories with many
   merges.

 * A recent regression in t7527 that broke TAP output has been fixed,
   some other test noise that also broke TAP output has been silenced,
   and 'prove' is now configured to fail on invalid TAP output to
   prevent future regressions.

 * A handful of inappropriate uses of the_repository have been
   rewritten to use the right repository structure instance in the
   unpack-trees.c codepath.

 * "git index-pack" has been optimized by retaining child bases in the
   delta cache instead of immediately freeing them, letting the existing
   cache limit policy decide eviction.

 * `git ls-files --modified` and `git ls-files --deleted` have been
   optimized to filter with pathspec before calling lstat() when there is
   only a single pathspec item, avoiding unnecessary filesystem access
   for entries that will not be shown.

 * The UNUSED macro in 'compat/posix.h' has been updated to use a
   newly introduced GIT_CLANG_PREREQ macro for compiler version
   checks, and the existing GIT_GNUC_PREREQ macro has been modernized
   to use explicit major/minor comparisons rather than bit-shifting.

 * Wean the Windows builds in GitLab CI procedure away from
   (unfortunately unreliable) Chocolatey to install dependencies.
   (merge 0e7b51fed2 ps/gitlab-ci-windows later to maint).

 * Build-fix for 32-bit Windows.

 * Xcode 15 and later has a linker set to complain when the same library
   archive is listed twice on the command line.  Squelch the annoyance.


Fixes since v2.54
-----------------

 * Code clean-up to use the right instance of a repository instance in
   calls inside refs subsystem.
   (merge 57c590feb9 sp/refs-reduce-the-repository later to maint).

 * The check that implements the logic to see if an in-core cache-tree
   is fully ready to write out a tree object was broken, which has
   been corrected.
   (merge 521731213c dl/cache-tree-fully-valid-fix later to maint).

 * The test suite harness and many individual test scripts have been
   updated to work correctly when 'set -e' is in effect, which helps
   detect misspelled test commands.
   (merge ffe8005b9d ps/test-set-e-clean later to maint).

 * Revert a recent change that introduced a regression to help mksh users.

 * Update various GitHub Actions versions.

 * Avoid hitting the pathname limit for socks proxy socket during the
   test..

 * To help Windows 10 installations, avoid removing files whose
   contents are still mmap()'ed.

 * The 'git backfill' command now rejects revision-limiting options that
   are incompatible with its operation, uses standard documentation for
   revision ranges, and includes blobs from boundary commits by default
   to improve performance of subsequent operations.
   (merge a1ad4a0fca en/backfill-fixes-and-edges later to maint).

 * "git grep" update.
   (merge 9ff4b5ab1b rs/grep-column-only-match-fix later to maint).

 * Headers from glibc 2.43 when used with clang does not allow
   disabling C11 language features, causing build failures..

 * The 'http.emptyAuth=auto' configuration now correctly attempts
   Negotiate authentication before falling back to manual credentials.
   This allows seamless Kerberos ticket-based authentication without
   requiring users to explicitly set 'http.emptyAuth=true'.
   (merge 4919938d28 mc/http-emptyauth-negotiate-fix later to maint).

 * Ramifications of turning off commit-graph has been documented a bit
   more clearly.
   (merge 48c855bb8f kh/doc-commit-graph later to maint).

 * "git rebase --update-refs", when used with an rebase.instructionFormat
   with "%d" (describe) in it, tried to update local branch HEAD by
   mistake, which has been corrected.
   (merge 106b6885c7 ag/rebase-update-refs-limit-to-branches later to maint).

 * Tweak the way how sideband messages from remote are printed while
   we talk with a remote repository to avoid tickling terminal
   emulator glitches.
   (merge 31e8fcabd8 rs/sideband-clear-line-before-print later to maint).

 * The configuration variable submodule.fetchJobs was not read correctly,
   which has been corrected.
   (merge aa45a5902f sj/submodule-update-clone-config-fix later to maint).

 * Update code paths that assumed "unsigned long" was long enough for
   "size_t".
   (merge 7a094d68a2 js/objects-larger-than-4gb-on-windows later to maint).

 * Stop using unmaintained custom allocator in Windows build which was
   the last user of the code.

 * The computation to shorten the filenames shown in diffstat measured
   width of individual UTF-8 characters to add up, but forgot to take
   into account error cases (e.g., an invalid UTF-8 sequence, or a
   control character).
   (merge 09d86a3b98 en/diffstat-utf8-truncation-fix later to maint).

 * Some tests assume that bare repository accesses are by default
   allowed; rewrite some of them to avoid the assumption, rewrite
   others to explicitly set safe.bareRepository to allow them.
   (merge 985b38ca6c js/adjust-tests-to-explicitly-access-bare-repo later to maint).

 * Signing commit with custom encoding was passing the data to be
   signed at a wrong stage in the pipeline, which has been corrected.
   (merge 7735d7eee3 bc/sign-commit-with-custom-encoding later to maint).

 * Further update to the i18n alias support to avoid regressions.

 * "git fetch --deepen=<n>" in a full clone truncated the history to <n>
   commits deep, which has been corrected to be a no-op instead.
   (merge 2431f5e0e5 sp/shallow-deepen-on-non-shallow-repo-fix later to maint).

 * "git maintenance" that goes background did not use the lockfile to
   prevent multiple maintenance processes from running at the same
   time, which has been corrected.
   (merge 29364f1624 ps/maintenance-daemonize-lockfix later to maint).

 * Remove ineffective strbuf presizing that would have computed an
   allocation that would not have fit in the available memory anyway,
   or too small due to integer wraparound to cause immediate automatic
   growing.
   (merge a9ce8526dc jk/pretty-no-strbuf-presizing later to maint).

 * The HTTP walker misinterpreted the alternates file that gives an
   absolute path when the server URL does not have the final slash
   (i.e., "https://example.com" not "https://example.com/").
   (merge b92387cd55 jk/dumb-http-alternate-fix later to maint).

 * "git bisect" now uses the selected terms (e.g., old/new) more
   consistently in its output.
   (merge cb55991825 jr/bisect-custom-terms-in-output later to maint).

 * Update GitLab CI jobs that exercise macOS.
   (merge 62319b49bb ps/gitlab-ci-macOS-improvements later to maint).

 * "Friday noon" asked in the morning on Sunday was parsed to be one
   day before the specified time, which has been corrected.
   (merge b809304101 ta/approxidate-noon-fix later to maint).

 * The GIT_WORK_TREE variable prepared to invoke the push-to-checkout
   hook was leaking into the environment even when there was no hook
   used and broke the default push-to-deploy (i.e., let "git checkout"
   update the working tree only when the working tree is clean).
   (merge 44d04e4426 ar/receive-pack-worktree-env later to maint).

 * A batch of documentation pages has been updated to use the modern
   synopsis style.
   (merge 2ef248ae45 ja/doc-synopsis-style-again later to maint).

 * The "promisor.quiet" configuration variable was not used from
   relevant submodules when commands like "grep --recurse-submodules"
   triggered a lazy fetch, which has been corrected.
   (merge fa1468a1f7 th/promisor-quiet-per-repo later to maint).

 * Correct use of sockaddr API in "git daemon".
   (merge 422a5bf575 st/daemon-sockaddr-fixes later to maint).

 * A memory leak in `fetch_and_setup_pack_index()` when verification of
   the downloaded pack index fails has been plugged. Also an obsolete
   `unlink()` call on parse failure has been cleaned up.

 * In t3070-wildmatch, "via ls-files" test variants with patterns
   containing backslash escapes are now skipped on Windows, avoiding 36
   test failures caused by pathspec separator conversion.
   (merge 8c84e6802c kk/wildmatch-windows-ls-files-prereq later to maint).

 * A linker warning on macOS when building with Xcode 16.3 or newer has
   been avoided by passing -fno-common to the compiler when a
   sufficiently new linker is detected.
   (merge 5cd4d0d850 hn/macos-linker-warning later to maint).

 * Documentation and tests have been added to clarify that Git's internal
   raw timestamp format requires a `@` prefix for values less than
   100,000,000 to prevent ambiguity with other formats like YYYYMMDD.
   (merge 4018dc29ee ls/doc-raw-timestamp-prefix later to maint).

 * Wording used in "format-patch --subject-prefix" documentation
   has been improved.
   (merge 4a1eb9304a lo/doc-format-patch-subject-prefix later to maint).

 * Advanced emulation of kill() used on Windows in GfW has been
   upstreamed to improve the symptoms like left-behind .lock files and
   that fails to let the child clean-up itself when it gets killed.
   (merge 363f1d8b3a js/win-kill-child-more-gently later to maint).

 * The 'git describe --contains --all' command has been fixed to
   properly honor the '--match' and '--exclude' options by passing
   them down to 'git name-rev' with the appropriate reference
   prefixes.
   (merge 1891707d1b jk/describe-contains-all-match-fix later to maint).

 * Various typos, grammatical errors, and duplicated words in both
   documentation and code comments have been corrected.
   (merge dc6068df67 wy/docs-typofixes later to maint).

 * The subprocess handshake during startup has been made gentler by using
   packet_read_line_gently() instead of packet_read_line() to prevent the
   parent Git process from dying abruptly when a configured subprocess
   (e.g., a clean/smudge filter) fails to start.
   (merge 061a68e443 mm/subprocess-handshake-fix later to maint).

 * The TSAN race in transfer_debug() within transport-helper.c has been
   resolved by initializing the debug flag early in
   bidirectional_transfer_loop() before spawning worker threads, allowing
   the removal of a TSAN suppression.
   (merge 85704eda18 ps/transport-helper-tsan-fix later to maint).

 * 'git describe' has been taught to pass the 'refs/tags/' prefix down to
   the ref iterator when '--all' is not requested, avoiding unnecessary
   iteration over non-tag refs.
   (merge 55088ac8a4 td/describe-tag-iteration later to maint).

 * compute_reachable_generation_numbers() in commit-graph used a 32-bit
   integer to accumulate parent generations, which is OK for generation
   number v1 (topological levels), but with generation number v2
   (adjusted committer timestamps), it truncated timestamps beyond
   2106.  Fixed by widening the accumulator to timestamp_t.
   (merge fbcc5408fc en/commit-graph-timestamp-fix later to maint).

 * Other code cleanup, docfix, build fix, etc.
   (merge 80f4b802e9 ja/doc-difftool-synopsis-style later to maint).
   (merge b96490241e jc/doc-timestamps-in-stat later to maint).
   (merge ef85286e51 ss/t7004-unhide-git-failures later to maint).
   (merge 7584d10bc2 mf/format-patch-cover-letter-format-docfix later to maint).
   (merge 8547908eb3 pw/rename-to-get-current-worktree later to maint).
   (merge 890229b3f3 sg/t6112-unwanted-tilde-expansion-fix later to maint).
   (merge ab9753e7bc kh/doc-restore-double-underscores-fix later to maint).
   (merge 4a9e097228 za/t2000-modernise-more later to maint).
   (merge b635fd0725 kh/doc-log-decorate-list later to maint).
   (merge 65ea197dca jk/commit-sign-overflow-fix later to maint).
   (merge 3ccb16052a jk/apply-leakfix later to maint).
   (merge 5e6e8dc786 tb/pseudo-merge-bugfixes later to maint).
   (merge 6d09e798bc pb/doc-diff-format-updates later to maint).
   (merge 34a891a2d3 rs/trailer-fold-optim later to maint).
   (merge 499f9048e0 ps/t3903-cover-stash-include-untracked later to maint).
   (merge b56ab270aa jk/sq-dequote-cleanup later to maint).
   (merge 29d9fdcf10 rs/use-builtin-add-overflow-explicitly-on-clang later to maint).
   (merge d9982e8290 ed/check-connected-close-err-fd-2.53 later to maint).
   (merge 1740cc35d0 ed/check-connected-close-err-fd later to maint).
   (merge f4d7eb3d1c sp/doc-range-diff-takes-notes later to maint).
   (merge 83e7f3bd2b kh/free-commit-list later to maint).
   (merge d1b72b29e9 am/doc-tech-hash-typofix later to maint).
   (merge 014c454799 ak/typofixes later to maint).
   (merge 522ea8ef7d js/osxkeychain-build-wo-rust later to maint).
   (merge e8f12e0e95 jc/t1400-fifo-cleanup later to maint).
   (merge 0bf506efd4 kw/gitattributes-typofix later to maint).

----------------------------------------------------------------

Changes since v2.54.0 are as follows:

Abhinav Gupta (2):
      rebase: ignore non-branch update-refs
      sequencer: remove todo_add_branch_context.commit

Adam Johnson (1):
      stash: reuse cached index entries in --patch temporary index

Adrian Ratiu (9):
      repository: fix repo_init() memleak due to missing _clear()
      config: add a repo_config_get_uint() helper
      hook: parse the hook.jobs config
      hook: allow pre-push parallel execution
      hook: add per-event jobs config
      hook: warn when hook.<friendly-name>.jobs is set
      hook: move is_known_hook() to hook.c for wider use
      hook: add hook.<event>.enabled switch
      hook: allow hook.jobs=-1 to use all available CPU cores

Alexander Monakov (1):
      doc: fix typo in GIT_ALTERNATE_OBJECT_DIRECTORIES

Aliwoto (1):
      http: reject unsupported proxy URL schemes

Alyssa Ross (1):
      receive-pack: fix updateInstead with core.worktree

Andrew Kreimer (1):
      doc: fix typos via codespell

Arijit Banerjee (1):
      index-pack: retain child bases in delta cache

Christian Couder (10):
      promisor-remote: try accepted remotes before others in get_direct()
      promisor-remote: pass config entry to all_fields_match() directly
      promisor-remote: clarify that a remote is ignored
      promisor-remote: reject empty name or URL in advertised remote
      promisor-remote: refactor should_accept_remote() control flow
      promisor-remote: refactor has_control_char()
      promisor-remote: refactor accept_from_server()
      promisor-remote: keep accepted promisor_info structs alive
      promisor-remote: remove the 'accepted' strvec
      t5710: use proper file:// URIs for absolute paths

D. Ben Knoble (1):
      ignore: note info/exclude lives in GIT_COMMON_DIR, not GIT_DIR

David Lin (1):
      cache-tree: fix inverted object existence check in cache_tree_fully_valid

Derrick Stolee (20):
      t5516: fix test order flakiness
      fetch: add --negotiation-restrict option
      transport: rename negotiation_tips
      remote: add remote.*.negotiationRestrict config
      negotiator: add have_sent() interface
      fetch: add --negotiation-include option for negotiation
      remote: add remote.*.negotiationInclude config
      send-pack: pass negotiation config in push
      t5620: make test work with path-walk var
      pack-objects: pass --objects with --path-walk
      t/perf: add pack-objects filter and path-walk benchmark
      path-walk: always emit directly-requested objects
      path-walk: support blobless filter
      backfill: die on incompatible filter options
      path-walk: support blob size limit filter
      path-walk: add pl_sparse_trees to control tree pruning
      pack-objects: support sparse:oid filter with path-walk
      t6601: tag otherwise-unreachable trees
      t1092: test 'git restore' with sparse index
      restore: avoid sparse index expansion

Dominik Loidolt (3):
      compat/posix.h: enable UNUSED warning messages for Clang
      compat/posix.h: clean up GIT_GNUC_PREREQ() and UNUSED
      compat/posix.h: simplify GIT_GNUC_PREREQ() comparison

Elijah Newren (10):
      backfill: reject rev-list arguments that do not make sense
      backfill: document acceptance of revision-range in more standard manner
      backfill: default to grabbing edge blobs too
      diff: fix out-of-bounds reads and NULL deref in diffstat UTF-8 truncation
      merge-ort: handle cached rename & trivial resolution interaction better
      promisor-remote: document caller filtering contract
      patch-ids.h: add missing trailing parenthesis in documentation comment
      builtin/log: prefetch necessary blobs for `git cherry`
      grep: prefetch necessary blobs
      commit-graph: use timestamp_t for max parent generation accumulator

Emily Shaffer (3):
      hook: allow parallel hook execution
      hook: mark non-parallelizable hooks
      hook: add -j/--jobs option to git hook run

Ethan Dickson (1):
      connected: close err_fd in promisor fast-path

Ezekiel Newren (6):
      xdiff/xdl_cleanup_records: delete local recs pointer
      xdiff: use unambiguous types in xdl_bogo_sqrt()
      xdiff/xdl_cleanup_records: use unambiguous types
      xdiff/xdl_cleanup_records: make limits more clear
      xdiff/xdl_cleanup_records: make setting action easier to follow
      xdiff/xdl_cleanup_records: make execution of action easier to follow

Greg Hurrell (1):
      git-jump: pick a mode automatically when invoked without arguments

Harald Nordgren (10):
      stash: add --label-ours, --label-theirs, --label-base for apply
      sequencer: allow create_autostash to run silently
      sequencer: teach autostash apply to take optional conflict marker labels
      checkout: rollback lock on early returns in merge_working_tree
      checkout -m: autostash when switching branches
      config.mak.uname: avoid macOS linker warning on Xcode 16.3+
      config: add git_config_key_is_valid() for quiet validation
      config: improve diagnostic for "set" with missing value
      git-gui: silence install recipes under "make -s"
      config.mak.uname: avoid macOS dup-library warning

Ivan Baluta (1):
      doc: clarify push.default=simple behavior

Jacob Keller (1):
      describe: fix --exclude, --match with --contains and --all

Jayesh Daga (1):
      unpack-trees: use repository from index instead of global

Jean-Noël Avila (10):
      doc: convert git-difftool manual page to synopsis style
      doc: convert git-range-diff manual page to synopsis style
      doc: convert git-shortlog manual page to synopsis style
      doc: convert git-describe manual page to synopsis style
      doc: convert git-bisect to synopsis style
      doc: git bisect: clarify the usage of the synopsis vs actual command
      doc: convert git-grep synopsis and options to new style
      doc: convert git-am synopsis and options to new style
      doc: convert git-apply synopsis and options to new style
      doc: convert git-imap-send synopsis and options to new style

Jeff King (12):
      t1800: test SIGPIPE with parallel hooks
      Revert "transport-helper, connect: use clean_on_exit to reap children on abnormal exit"
      pretty: drop strbuf pre-sizing from add_rfc2047()
      http: handle absolute-path alternates from server root
      apply: plug leak on "patch too large" error
      commit: handle large commit messages in utf8 verification
      quote.h: bump strvec forward declaration to the top
      quote: drop sq_dequote_to_argv()
      quote: simplify internals of dequoting
      connect: use "service" enum for "name" argument
      commit: fall back to full read when maybe_tree is NULL
      transport-helper: fix typo in BUG() message

Johannes Schindelin (48):
      sideband: mask control characters
      sideband: introduce an "escape hatch" to allow control characters
      sideband: do allow ANSI color sequences by default
      sideband: add options to allow more control sequences to be passed through
      sideband: offer to configure sanitizing on a per-URL basis
      test-lib: allow bare repository access when breaking changes are enabled
      t7900: do not let `$HOME/.gitconfig` interfere with XDG tests
      t1300: remove global config settings injected by test-lib.sh
      t1305: use `--git-dir=.` for bare repo in include cycle test
      t5601: restore `.gitconfig` after includeIf test
      ls-files tests: filter `.gitconfig` from `--others` output
      status tests: filter `.gitconfig` from status output
      safe.bareRepository: default to "explicit" with WITH_BREAKING_CHANGES
      t5564: use a short path for the SOCKS proxy socket
      ci: bump microsoft/setup-msbuild from v2 to v3
      ci: bump actions/{upload,download}-artifact to v7 and v8
      ci: bump actions/github-script from v8 to v9
      ci: bump actions/checkout from v5 to v6
      ci: bump git-for-windows/setup-git-for-windows-sdk from v1 to v2
      l10n: bump mshick/add-pr-comment from v2 to v3
      mingw: optionally use legacy (non-POSIX) delete semantics
      maintenance(geometric): do release the `.idx` files before repacking
      mingw: stop using nedmalloc
      mingw: drop the build-system plumbing for nedmalloc
      mingw: remove the vendored compat/nedmalloc/ subtree
      index-pack, unpack-objects: use size_t for object size
      git-zlib: handle data streams larger than 4GB
      odb, packfile: use size_t for streaming object sizes
      delta, packfile: use size_t for delta header sizes
      test-tool: add a helper to synthesize large packfiles
      t5608: add regression test for >4GB object clone
      test-tool synthesize: use the unsafe hash for speed
      test-tool synthesize: precompute pack for 4 GiB + 1
      test-tool synthesize: add precomputed SHA-256 pack for 4 GiB + 1
      t5608: mark >4GB tests as EXPENSIVE
      ci: run expensive tests on push builds to integration branches
      mingw: kill child processes in a gentler way
      mingw: really handle SIGINT
      compat/msvc: use _chsize_s for ftruncate
      patch-delta: use size_t for sizes
      pack-objects(check_pack_inflate()): use size_t instead of unsigned long
      packfile: widen unpack_entry()'s size out-parameter to size_t
      pack-objects: use size_t for in-core object sizes
      packfile,delta: drop the `cast_size_t_to_ulong()` wrappers
      odb: use size_t for object_info.sizep and the size APIs
      osxkeychain: fix build with Rust
      zlib: properly clamp to uLong
      win32: ensure that `localtime_r()` is declared even in i686 builds

Johannes Sixt (2):
      userdiff: tighten word-diff test case of the scheme driver
      git-gui: remove unnecessary 'cd $_gitworktree' from do_gitk

Jonas Rebmann (3):
      bisect: use selected alternate terms in status output
      bisect: print bisect terms in single quotes
      rev-parse: use selected alternate terms to look up refs

Jonatan Holmgren (1):
      alias: restore support for simple dotted aliases

Junio C Hamano (29):
      sideband: drop 'default' configuration
      CodingGuidelines: st_mtimespec vs st_mtim vs st_mtime
      t5551: "GIT_TEST_LONG=Yes make test" is broken
      ci: enable EXPENSIVE for contributor builds
      Start 2.55 cycle
      The second batch
      The 3rd batch
      The 4th batch
      The 5th batch
      The 6th batch
      Start preparing for 2.54.1
      The 7th batch
      The 8th batch
      SubmittingPatches: proactively monitor GHCI pages
      The 9th batch
      The 10th batch
      The 11th batch
      SubmittingPatches: separate typofixes section
      SubmittingPatches: describe cover letter
      The 12th batch
      The 13th batch
      Git 2.55-rc0
      t1400: have fifo test clean after itself
      topic flush before -rc1 (batch 1)
      topic flush before -rc1 (batch 2)
      Git 2.55-rc1
      Hopefully final batch before -rc2
      A few more topics before -rc2
      Git 2.55-rc2

Justin Tobler (7):
      odb: split `struct odb_transaction` into separate header
      odb/transaction: use pluggable `begin_transaction()`
      odb: update `struct odb_write_stream` read() callback
      object-file: remove flags from transaction packfile writes
      object-file: avoid fd seekback by checking object size upfront
      object-file: generalize packfile writes to use odb_write_stream
      odb/transaction: make `write_object_stream()` pluggable

Karthik Nayak (10):
      refs: remove unused typedef 'ref_transaction_commit_fn'
      refs: introduce `ref_store_init_options`
      refs: extract out reflog config to generic layer
      refs: return `ref_transaction_error` from `ref_transaction_update()`
      update-ref: move `print_rejected_refs()` up
      update-ref: handle rejections while adding updates
      refs: move object parsing to the generic layer
      refs: add peeled object ID to the `ref_update` struct
      refs: use peeled tag values in reference backends
      refs/files: skip lock files during consistency checks

Koutian Wu (1):
      gitattributes: fix eol attribute for Perl scripts

Kristofer Karlsson (13):
      commit-reach: introduce merge_base_flags enum
      commit-reach: early exit paint_down_to_common for single merge-base
      merge: use repo_in_merge_bases for octopus up-to-date check
      revision: use priority queue in limit_list()
      commit-reach: use object flags for tips_reachable_from_bases()
      t6600: add tests for duplicate tips in tips_reachable_from_bases()
      object.h: fix stale entries in object flag allocation table
      commit-reach: deduplicate queue entries in paint_down_to_common
      commit-reach: replace queue_has_nonstale() scan with O(1) tracking
      pack-objects: call release_revisions() after cruft traversal
      revision: introduce rev_walk_mode to clarify get_revision_1()
      revision: use priority queue for non-limited streaming walks
      t3070: skip ls-files tests with backslash patterns on Windows

Kristoffer Haugsbakk (15):
      doc: log: fix --decorate description list
      doc: log: use the same delimiter in description list
      doc: restore: remove double underscore
      doc: add caveat about turning off commit-graph
      name-rev: wrap both blocks in braces
      name-rev: run clang-format before factoring code
      name-rev: factor code for sharing with a new command
      name-rev: make dedicated --annotate-stdin --name-only test
      format-rev: introduce builtin for on-demand pretty formatting
      doc: hook: remove stray backtick
      doc: hook: consistently capitalize Git
      doc: config: include existing git-hook(1) section
      doc: hook: don’t self-link via config include
      *: replace deprecated free_commit_list
      commit: remove deprecated functions

LorenzoPegorari (2):
      http: cleanup function fetch_and_setup_pack_index()
      http: fix memory leak in fetch_and_setup_pack_index()

Lucas Seiki Oshiro (1):
      Documentation: remove redundant 'instead' in --subject-prefix

Luna Schwalbe (1):
      doc: document and test `@` prefix for raw timestamps

Mark Levedahl (11):
      git-gui: use HEAD as current branch when detached
      git-gui: guard set/unset of GIT_DIR and GIT_WORK_TREE
      git-gui: do not change global vars in choose_repository::pick
      git-gui: use --absolute-git-dir
      git-gui: use rev-parse exclusively to find a repository
      git-gui: use git rev-parse for worktree discovery
      git-gui: simplify [is_bare] to report if a worktree is known
      git-gui: try harder to find worktree from gitdir
      git-gui: allow specifying path '.' to the browser
      git-gui: check browser/blame arguments carefully
      git-gui: add gui and pick as explicit subcommands

Matheus Afonso Martins Moreira (8):
      connect: rename enum protocol to url_scheme
      url: move url_is_local_not_ssh to url.h
      url: move scheme detection to URL header/source
      url: return URL_SCHEME_UNKNOWN instead of dying
      urlmatch: define url_parse function
      builtin: create url-parse command
      doc: describe the url-parse builtin
      t9904: add tests for the new url-parse builtin

Matthew John Cheetham (4):
      http: extract http_reauth_prepare() from retry paths
      http: attempt Negotiate auth in http.emptyAuth=auto mode
      t5563: add tests for http.emptyAuth with Negotiate
      doc: clarify http.emptyAuth values

Michael Montalbo (9):
      diff: reject negative values for --inter-hunk-context
      diff: reject negative values for -U/--unified
      xdiff: guard against negative context lengths
      parse-options: clarify what "negated" means for PARSE_OPT_NONEG
      doc: clarify that --word-diff operates on line-level hunks
      revision: move -L setup before output_format-to-diff derivation
      line-log: integrate -L output with the standard log-tree pipeline
      line-log: allow non-patch diff formats with -L
      sub-process: use gentle handshake to avoid die() on startup failure

Mirko Faina (3):
      Fix docs for format.commitListFormat
      revision.c: implement --max-count-oldest
      bash-completions: add --max-count-oldest

Olamide Caleb Bello (8):
      environment: move "trust_ctime" into `struct repo_config_values`
      environment: move "check_stat" into `struct repo_config_values`
      environment: move `zlib_compression_level` into `struct repo_config_values`
      environment: move "pack_compression_level" into `struct repo_config_values`
      environment: move "precomposed_unicode" into `struct repo_config_values`
      environment: move "core_sparse_checkout_cone" into `struct repo_config_values`
      environment: move "sparse_expect_files_outside_of_patterns" into `struct repo_config_values`
      environment: move "warn_on_object_refname_ambiguity" into `struct repo_config_values`

Pablo Sabater (3):
      graph: limit the graph width to a hard-coded max
      graph: add --graph-lane-limit option
      graph: add truncation mark to capped lanes

Patrick Steinhardt (90):
      t: prepare `test_match_signal ()` calls for `set -e`
      t: prepare `test_must_fail ()` for `set -e`
      t: prepare `stop_git_daemon ()` for `set -e`
      t: prepare `git config --unset` calls for `set -e`
      t: prepare conditional test execution for `set -e`
      t: prepare execution of potentially failing commands for `set -e`
      t: prepare `test_when_finished ()`/`test_atexit()` for `set -e`
      t0008: silence error in subshell when using `grep -v`
      t1301: don't fail in case setfacl(1) doesn't exist or fails
      t6002: fix use of `expr` with `set -e`
      t9902: fix use of `read` with `set -e`
      t: detect errors outside of test cases
      replay: allow callers to control what happens with empty commits
      builtin/history: generalize function to commit trees
      builtin/history: introduce "fixup" subcommand
      build: tolerate use of _Generic from glibc 2.43 with Clang
      builtin/maintenance: fix locking with "--detach"
      run-command: honor "gc.auto" for auto-maintenance
      odb: introduce "in-memory" source
      odb/source-inmemory: implement `free()` callback
      odb: fix unnecessary call to `find_cached_object()`
      odb/source-inmemory: implement `read_object_info()` callback
      odb/source-inmemory: implement `read_object_stream()` callback
      odb/source-inmemory: implement `write_object()` callback
      odb/source-inmemory: implement `write_object_stream()` callback
      cbtree: allow using arbitrary wrapper structures for nodes
      oidtree: add ability to store data
      odb/source-inmemory: convert to use oidtree
      odb/source-inmemory: implement `for_each_object()` callback
      odb/source-inmemory: implement `find_abbrev_len()` callback
      odb/source-inmemory: implement `count_objects()` callback
      odb/source-inmemory: implement `freshen_object()` callback
      odb/source-inmemory: stub out remaining functions
      odb: generic in-memory source
      t/unit-tests: add tests for the in-memory object source
      setup: replace use of `the_repository` in static functions
      setup: stop using `the_repository` in `is_inside_git_dir()`
      setup: stop using `the_repository` in `is_inside_work_tree()`
      setup: stop using `the_repository` in `prefix_path()`
      setup: stop using `the_repository` in `path_inside_repo()`
      setup: stop using `the_repository` in `verify_filename()`
      setup: stop using `the_repository` in `verify_non_filename()`
      setup: stop using `the_repository` in `enter_repo()`
      setup: stop using `the_repository` in `setup_work_tree()`
      setup: stop using `the_repository` in `set_git_work_tree()`
      setup: stop using `the_repository` in `setup_git_env()`
      setup: stop using `the_repository` in `setup_git_directory_gently()`
      setup: stop using `the_repository` in `setup_git_directory()`
      setup: stop using `the_repository` in `upgrade_repository_format()`
      setup: stop using `the_repository` in `check_repository_format()`
      setup: stop using `the_repository` in `initialize_repository_version()`
      setup: stop using `the_repository` in `create_reference_database()`
      setup: stop using `the_repository` in `init_db()`
      gitlab-ci: upgrade macOS runners
      gitlab-ci: update macOS image
      odb/source-loose: move loose source into "odb/" subsystem
      odb/source-loose: store pointer to "files" instead of generic source
      odb/source-loose: start converting to a proper `struct odb_source`
      odb/source-loose: wire up `reprepare()` callback
      odb/source-loose: wire up `close()` callback
      odb/source-loose: wire up `read_object_info()` callback
      odb/source-loose: wire up `read_object_stream()` callback
      odb/source-loose: wire up `for_each_object()` callback
      odb/source-loose: wire up `find_abbrev_len()` callback
      odb/source-loose: wire up `count_objects()` callback
      odb/source-loose: drop `odb_source_loose_has_object()`
      odb/source-loose: wire up `freshen_object()` callback
      loose: refactor object map to operate on `struct odb_source_loose`
      odb/source-loose: wire up `write_object()` callback
      object-file: refactor writing objects to use loose source
      odb/source-loose: wire up `write_object_stream()` callback
      odb/source-loose: stub out remaining callbacks
      odb/source-loose: drop pointer to the "files" source
      gitlab-ci: rearrange Linux jobs to match GitHub's order
      gitlab-ci: add missing Linux jobs
      ci: unify Linux images across GitLab and GitHub
      t7527: fix broken TAP output
      t7810: turn MB_REGEX check into a lazy prereq
      t/test-lib: silence EBUSY errors on Windows during test cleanup
      t/lib-git-p4: silence output when killing p4d and its watchdog
      t: let prove fail when parsing invalid TAP output
      t0001: plug test gaps for git-init(1) with GIT_OBJECT_DIRECTORY
      setup: drop `setup_git_env()`
      setup: deduplicate logic to apply repository format
      repository: stop initializing the object database in `repo_set_gitdir()`
      setup: stop creating the object database in `setup_git_env()`
      setup: stop initializing object database without repository
      repository: stop reading loose object map twice on repo init
      setup: construct object database in `apply_repository_format()`
      gitlab-ci: migrate Windows builds away from Chocolatey

Paul Tarjan (13):
      t9210, t9211: disable GIT_TEST_SPLIT_INDEX for scalar clone tests
      fsmonitor: fix khash memory leak in do_handle_client
      fsmonitor: fix hashmap memory leak in fsmonitor_run_daemon
      compat/win32: add pthread_cond_timedwait
      fsmonitor: use pthread_cond_timedwait for cookie wait
      fsmonitor: rename fsm-ipc-darwin.c to fsm-ipc-unix.c
      fsmonitor: rename fsm-settings-darwin.c to fsm-settings-unix.c
      fsmonitor: implement filesystem change listener for Linux
      run-command: add close_fd_above_stderr option
      fsmonitor: close inherited file descriptors and detach in daemon
      fsmonitor: add timeout to daemon stop command
      fsmonitor: add tests for Linux
      fsmonitor: convert shown khash to strset in do_handle_client

Philippe Blain (3):
      diff-format.adoc: remove mention of diff-tree specific output
      diff-format.adoc: 'git diff-files' prints two lines for unmerged files
      diff-format.adoc: mode and hash are 0* for unmerged paths from index only

Phillip Wood (5):
      worktree: rename get_worktree_from_repository()
      xdiff: reduce size of action arrays
      xdiff: cleanup xdl_clean_mmatch()
      xprepare: simplify error handling
      xdiff: reduce the size of array

Pushkar Singh (2):
      stash: add coverage for show --include-untracked
      transport-helper: fix TSAN race in transfer_debug()

René Scharfe (10):
      grep: fix --column --only-match for 2nd and later matches
      sideband: clear full line when printing remote messages
      strbuf: add strbuf_add_uint()
      cat-file: use strbuf_add_uint()
      ls-files: use strbuf_add_uint()
      ls-tree: use strbuf_add_uint()
      hex: add and use strbuf_add_oid_hex()
      trailer: change strbuf in-place in unfold_value()
      strbuf: use st_add3() in strbuf_grow()
      use __builtin_add_overflow() in st_add() with Clang

Rob McDonald (1):
      gitk: add horizontal scrollbar to the commit list pane

SZEDER Gábor (1):
      t6112: avoid tilde expansion

Saagar Jha (1):
      submodule-config: fix reading submodule.fetchJobs

Samo Pogačnik (1):
      shallow: fix relative deepen on non-shallow repositories

Scott Bauersfeld (1):
      index-pack, unpack-objects: increase input buffer from 4 KiB to 128 KiB

Scott L. Burson (1):
      userdiff: extend Scheme support to cover other Lisp dialects

Sebastien Tardif (3):
      daemon: fix IPv6 address corruption in lookup_hostname()
      daemon: fix IPv6 address truncation in ip2str()
      daemon: guard NULL REMOTE_PORT in execute() logging

Shreyansh Paliwal (3):
      refs: add struct repository parameter in get_files_ref_lock_timeout_ms()
      refs: remove the_hash_algo global state
      refs/reftable-backend: drop uses of the_repository

Siddh Raman Pant (1):
      Documentation/git-range-diff: add missing notes options in synopsis

Siddharth Asthana (1):
      cat-file: add mailmap subcommand to --batch-command

Siddharth Shrimali (3):
      t7004: drop hardcoded tag count for state verification
      t7004: dynamically grab expected state in tests
      t7004: avoid subshells to capture git exit codes

Tamir Duberstein (2):
      describe: limit default ref iteration to tags
      ls-files: filter pathspec before lstat

Taylor Blau (36):
      t/helper: add 'test-tool bitmap write' subcommand
      t5333: demonstrate various pseudo-merge bugs
      pack-bitmap-write: sort pseudo-merge commit lookup table in pack order
      pack-bitmap: fix inverted binary search in `pseudo_merge_at()`
      pack-bitmap: fix pseudo-merge lookup for shared commits
      pack-bitmap: parse commits in `find_pseudo_merge_group_for_ref()`
      pack-bitmap: reject pseudo-merge "sampleRate" of 0
      Documentation: fix broken `sampleRate` in gitpacking(7)
      pack-bitmap: prevent pattern leak on pseudo-merge re-assignment
      midx-write: handle noop writes when converting incremental chains
      midx: use `strset` for retained MIDX files
      midx: build `keep_hashes` array in order
      midx: use `strvec` for `keep_hashes`
      midx: introduce `--no-write-chain-file` for incremental MIDX writes
      midx: support custom `--base` for incremental MIDX writes
      repack: track the ODB source via existing_packs
      midx: expose `midx_layer_contains_pack()`
      repack-midx: factor out `repack_prepare_midx_command()`
      repack-midx: extract `repack_fill_midx_stdin_packs()`
      repack-geometry: prepare for incremental MIDX repacking
      builtin/repack.c: convert `--write-midx` to an `OPT_CALLBACK`
      packfile: ensure `close_pack_revindex()` frees in-memory revindex
      repack: implement incremental MIDX repacking
      repack: introduce `--write-midx=incremental`
      repack: allow `--write-midx=incremental` without `--geometric`
      path-walk: support `tree:0` filter
      path-walk: support `object:type` filter
      path-walk: support `combine` filter
      pack-bitmap: pass object position to `fill_bitmap_tree()`
      pack-bitmap: check subtree bits before recursing
      pack-bitmap: reuse stored selected bitmaps
      pack-bitmap: consolidate `find_object_pos()` success path
      pack-bitmap: cache object positions during fill
      pack-bitmap: sort bitmaps before XORing
      pack-bitmap: remember pseudo-merge parents
      pack-bitmap: build pseudo-merge bitmaps after regular bitmaps

Toon Claes (1):
      generate-configlist: collapse depfile for older Ninja

Trieu Huynh (1):
      promisor-remote: fix promisor.quiet to use the correct repository

Tuomas Ahola (8):
      approxidate: make "today" wrap to midnight
      t0006: add support for approxidate test date adjustment
      approxidate: make "specials" respect fixed day-of-month
      approxidate: use deferred mday adjustments for "specials"
      docs: fix typos
      doc: config: terminate runaway lists
      doc: config/sideband: fix description list delimiter
      doc: git-config: escape erroneous highlight markup

Usman Akinyemi (3):
      remote: fix sign-compare warnings in push_cas_option
      remote: move remote group resolution to remote.c
      push: support pushing to a remote group

Weijie Yuan (1):
      docs: fix typos and grammar

Zakariyah Ali (1):
      t2000: consolidate second scenario into a single test block

brian m. carlson (6):
      docs: update version with default Rust support
      ci: install cargo on Alpine
      Linux: link against libdl
      Enable Rust by default
      commit: name UTF-8 function appropriately
      commit: sign commit after mutating buffer


^ permalink raw reply

* Re: [PATCH v3 0/2] Silence po catalog output under "make -s"
From: Johannes Sixt @ 2026-06-23 16:23 UTC (permalink / raw)
  To: Harald Nordgren; +Cc: git, Harald Nordgren via GitGitGadget
In-Reply-To: <pull.2339.v3.git.git.1782053803.gitgitgadget@gmail.com>

Am 21.06.26 um 16:56 schrieb Harald Nordgren via GitGitGadget:
>  * gitk: gate the quiet helpers on -s in MAKEFLAGS and give the catalog rule
>    a QUIET_MSGFMT prefix, so a silent build emits no MSGFMT/GEN lines

I've picked up this one.

>  * git-gui: replace the QUIET_MSGFMT0/QUIET_MSGFMT1 pair with a single
>    QUIET_MSGFMT, since with --statistics gone there is no output left to
>    reformat

But this one, I skipped, because I already have all of it in
https://github.com/j6t/git-gui/commits/hn/silence-make-s/

Thanks!
-- Hannes


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox