Subject: Re: [PATCH v3 00/14] odb: introduce `odb_for_each_object()`

From: Junio C Hamano <[email-masked]>
Date: Thu, 22 Jan 2026 09:02:51 -0800

Taylor Blau <[email-masked]> writes:

> On Wed, Jan 21, 2026 at 01:50:16PM +0100, Patrick Steinhardt wrote:
>> The patch series is built on top of 8745eae506 (The 17th batch,
>> 2026-01-11) with the following two series merged into it:
>>
>>   - ps/read-object-info-improvements at a282a8f163 (packfile: move MIDX
>>     into packfile store, 2026-01-09).
>>
>>   - ps/packfile-store-in-odb-source at 12d3b58b55 (packfile: drop
>>     repository parameter from `packed_object_info()`, 2026-01-12) .
>
> I was having a little bit of trouble constructing a base to apply these
> patches. a282a8f163 merges cleanly into 8745eae506, but 12d3b58b55 does
> not merge cleanly into that, nor do they apply as a single octopus
> merge.
>
> Looking at the base-commit identified below from your fork[1], there is
> some conflict resolution required to merge in the latter series. I'm
> including the --remerge-diff results below in case others are interested
> in applying this locally.

Thanks for independently validating the conflict resolution I did.
A quick glance of your remerge-diff matches what I had been using
for the past week:

$ git log --oneline --first-parent master..ps/odb-for-each-object
...
ec16dde5c8 Merge branch 'ps/packfile-store-in-odb-source' into ps/odb-for-each-object
c8e1706e8d Merge branch 'ps/read-object-info-improvements' into ps/odb-for-each-object

$ git log -2 --oneline --remerge-diff -p ec16dde5c8
ec16dde5c8 Merge branch 'ps/packfile-store-in-odb-source' into ps/odb-for-each-object
diff --git a/packfile.c b/packfile.c
remerge CONFLICT (content): Merge conflict in packfile.c
index d951de73d1..402c3b5dc7 100644
--- a/packfile.c
+++ b/packfile.c
@@ -2164,16 +2164,8 @@ int packfile_store_read_object_info(struct packfile_store *store,
 	if (!oi)
 		return 0;
 
-<<<<<<< c8e1706e8d (Merge branch 'ps/read-object-info-improvements' into ps/odb-for-each-object)
 	ret = packed_object_info(e.p, e.offset, oi);
 	if (ret < 0) {
-||||||| merged common ancestors
-	rtype = packed_object_info(store->odb->repo, e.p, e.offset, oi);
-	if (rtype < 0) {
-=======
-	rtype = packed_object_info(store->source->odb->repo, e.p, e.offset, oi);
-	if (rtype < 0) {
->>>>>>> a282a8f163 (packfile: move MIDX into packfile store)
 		mark_bad_packed_object(e.p, oid);
 		return -1;
 	}
@@ -2574,17 +2566,9 @@ int packfile_store_read_object_stream(struct odb_read_stream **out,
 	oi.sizep = &size;
 
 	if (packfile_store_read_object_info(store, oid, &oi, 0) ||
-<<<<<<< c8e1706e8d (Merge branch 'ps/read-object-info-improvements' into ps/odb-for-each-object)
 	    oi.u.packed.type == PACKED_OBJECT_TYPE_REF_DELTA ||
 	    oi.u.packed.type == PACKED_OBJECT_TYPE_OFS_DELTA ||
-	    repo_settings_get_big_file_threshold(store->odb->repo) >= size)
-||||||| merged common ancestors
-	    oi.u.packed.is_delta ||
-	    repo_settings_get_big_file_threshold(store->odb->repo) >= size)
-=======
-	    oi.u.packed.is_delta ||
 	    repo_settings_get_big_file_threshold(store->source->odb->repo) >= size)
->>>>>>> a282a8f163 (packfile: move MIDX into packfile store)
 		return -1;
 
 	in_pack_type = unpack_object_header(oi.u.packed.pack,
c8e1706e8d Merge branch 'ps/read-object-info-improvements' into ps/odb-for-each-object

>
> --- 8< ---
> diff --git a/packfile.c b/packfile.c
> remerge CONFLICT (content): Merge conflict in packfile.c
> index 4cc9d8c07e6..402c3b5dc73 100644
> --- a/packfile.c
> +++ b/packfile.c
> @@ -2164,16 +2164,8 @@ int packfile_store_read_object_info(struct packfile_store *store,
>  	if (!oi)
>  		return 0;
>
> -<<<<<<< b7f649ca936 (Merge remote-tracking branch 'junio/ps/read-object-info-improvements' into HEAD)
>  	ret = packed_object_info(e.p, e.offset, oi);
>  	if (ret < 0) {
> -||||||| merged common ancestors
> -	rtype = packed_object_info(store->odb->repo, e.p, e.offset, oi);
> -	if (rtype < 0) {
> -=======
> -	rtype = packed_object_info(store->source->odb->repo, e.p, e.offset, oi);
> -	if (rtype < 0) {
> ->>>>>>> a282a8f163f (packfile: move MIDX into packfile store)
>  		mark_bad_packed_object(e.p, oid);
>  		return -1;
>  	}
> @@ -2574,17 +2566,9 @@ int packfile_store_read_object_stream(struct odb_read_stream **out,
>  	oi.sizep = &size;
>
>  	if (packfile_store_read_object_info(store, oid, &oi, 0) ||
> -<<<<<<< b7f649ca936 (Merge remote-tracking branch 'junio/ps/read-object-info-improvements' into HEAD)
>  	    oi.u.packed.type == PACKED_OBJECT_TYPE_REF_DELTA ||
>  	    oi.u.packed.type == PACKED_OBJECT_TYPE_OFS_DELTA ||
> -	    repo_settings_get_big_file_threshold(store->odb->repo) >= size)
> -||||||| merged common ancestors
> -	    oi.u.packed.is_delta ||
> -	    repo_settings_get_big_file_threshold(store->odb->repo) >= size)
> -=======
> -	    oi.u.packed.is_delta ||
>  	    repo_settings_get_big_file_threshold(store->source->odb->repo) >= size)
> ->>>>>>> a282a8f163f (packfile: move MIDX into packfile store)
>  		return -1;
>
>  	in_pack_type = unpack_object_header(oi.u.packed.pack,
> --- >8 ---
>
> Thanks,
> Taylor
>
> [1]: https://gitlab.com/pks-gitlab/git.git/