<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/object-file.h, branch main</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=main</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2026-04-01T03:43:13Z</updated>
<entry>
<title>odb: use enum for `odb_write_object` flags</title>
<updated>2026-04-01T03:43:13Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-31T23:57:49Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=b2d421ece6a8e095394e76930e6929ee036571ef'/>
<id>urn:sha1:b2d421ece6a8e095394e76930e6929ee036571ef</id>
<content type='text'>
We've got a couple of functions that accept `odb_write_object()` flags,
but all of them accept the flags as an `unsigned` integer. In fact, we
don't even have an `enum` for the flags field.

Introduce this `enum` and adapt functions accordingly according to our
coding style.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object-name: move logic to compute loose abbreviation length</title>
<updated>2026-03-20T20:16:42Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-20T07:07:38Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=ab3ab1038dd38d2be62e3bacf39a3248929a7a98'/>
<id>urn:sha1:ab3ab1038dd38d2be62e3bacf39a3248929a7a98</id>
<content type='text'>
The function `repo_find_unique_abbrev_r()` takes as input an object ID
as well as a minimum object ID length and returns the minimum required
prefix to make the object ID unique.

The logic that computes the abbreviation length for loose objects is
deeply tied to the loose object storage format. As such, it would fail
in case a different object storage format was used.

Prepare for making this logic generic to the backend by moving the logic
into a new `odb_source_loose_find_abbrev_len()` function that is part of
"object-file.c".

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object-name: move logic to iterate through loose prefixed objects</title>
<updated>2026-03-20T20:16:42Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-20T07:07:30Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=284b7862be735bb47276ac288ace153ae3d06938'/>
<id>urn:sha1:284b7862be735bb47276ac288ace153ae3d06938</id>
<content type='text'>
The logic to iterate through loose objects that have a certain prefix is
currently hosted in "object-name.c". This logic reaches into specifics
of the loose object source, so it breaks once a different backend is
used for the object storage.

Move the logic to iterate through loose objects with a prefix into
"object-file.c". This is done by extending the for-each-object options
to support an optional prefix that is then honored by the loose source.
Naturally, we'll also have this support in the packfile store. This is
done in the next commit.

Furthermore, there are no users of the loose cache outside of
"object-file.c" anymore. As such, convert `odb_source_loose_cache()` to
have file scope.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>odb: introduce `struct odb_for_each_object_options`</title>
<updated>2026-03-20T20:16:41Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-20T07:07:29Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=cfd575f0a9730712107e4ee6799a37665bcd8204'/>
<id>urn:sha1:cfd575f0a9730712107e4ee6799a37665bcd8204</id>
<content type='text'>
The `odb_for_each_object()` function only accepts a bitset of flags. In
a subsequent commit we'll want to change object iteration to also
support iterating over only those objects that have a specific prefix.
While we could of course add the prefix to the function signature, or
alternatively introduce a new function, both of these options don't
really seem to be that sensible.

Instead, introduce a new `struct odb_for_each_object_options` that can
be passed to a new `odb_for_each_object_ext()` function. Splice through
the options structure into the respective object database sources.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object-file: generalize counting objects</title>
<updated>2026-03-12T15:38:42Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-12T08:42:59Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=2b24db1110150138ac1e09bc60d9ae5245909625'/>
<id>urn:sha1:2b24db1110150138ac1e09bc60d9ae5245909625</id>
<content type='text'>
Generalize the function introduced in the preceding commit to not only
be able to approximate the number of loose objects, but to also provide
an accurate count. The behaviour can be toggled via a new flag.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object-file: extract logic to approximate object count</title>
<updated>2026-03-12T15:38:42Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-12T08:42:58Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=222fddeaa44b633eea345996735b4f7893eb71ec'/>
<id>urn:sha1:222fddeaa44b633eea345996735b4f7893eb71ec</id>
<content type='text'>
In "builtin/gc.c" we have some logic that checks whether we need to
repack objects. This is done by counting the number of objects that we
have and checking whether it exceeds a certain threshold. We don't
really need an accurate object count though, which is why we only
open a single object directory shard and then extrapolate from there.

Extract this logic into a new function that is owned by the loose object
database source. This is done to prepare for a subsequent change, where
we'll introduce object counting on the object database source level.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ps/fsck-stream-from-the-right-object-instance'</title>
<updated>2026-03-05T18:04:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-05T18:04:49Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=d93be9cbcaf80f4d1ff56a3d7aa5d722236b6eac'/>
<id>urn:sha1:d93be9cbcaf80f4d1ff56a3d7aa5d722236b6eac</id>
<content type='text'>
"fsck" iterates over packfiles and its access to pack data caused
the list to be permuted, which caused it to loop forever; the code
to access pack data by "fsck" has been updated to avoid this.

* ps/fsck-stream-from-the-right-object-instance:
  pack-check: fix verification of large objects
  packfile: expose function to read object stream for an offset
  object-file: adapt `stream_object_signature()` to take a stream
  t/helper: improve "genrandom" test helper
</content>
</entry>
<entry>
<title>Merge branch 'ps/object-info-bits-cleanup'</title>
<updated>2026-03-03T01:06:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-03T01:06:52Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=10dd04a3feef385358d66bf3d653325f64c20d3c'/>
<id>urn:sha1:10dd04a3feef385358d66bf3d653325f64c20d3c</id>
<content type='text'>
A couple of bugs in use of flag bits around odb API has been
corrected, and the flag bits reordered.

* ps/object-info-bits-cleanup:
  odb: convert `odb_has_object()` flags into an enum
  odb: convert object info flags into an enum
  odb: drop gaps in object info flag values
  builtin/fsck: fix flags passed to `odb_has_object()`
  builtin/backfill: fix flags passed to `odb_has_object()`
</content>
</entry>
<entry>
<title>Merge branch 'ps/odb-for-each-object'</title>
<updated>2026-03-03T01:06:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-03T01:06:50Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=9eb5b3b999cb89d4a09dcf1012784e74154026de'/>
<id>urn:sha1:9eb5b3b999cb89d4a09dcf1012784e74154026de</id>
<content type='text'>
Revamp object enumeration API around odb.

* ps/odb-for-each-object:
  odb: drop unused `for_each_{loose,packed}_object()` functions
  reachable: convert to use `odb_for_each_object()`
  builtin/pack-objects: use `packfile_store_for_each_object()`
  odb: introduce mtime fields for object info requests
  treewide: drop uses of `for_each_{loose,packed}_object()`
  treewide: enumerate promisor objects via `odb_for_each_object()`
  builtin/fsck: refactor to use `odb_for_each_object()`
  odb: introduce `odb_for_each_object()`
  packfile: introduce function to iterate through objects
  packfile: extract function to iterate through objects of a store
  object-file: introduce function to iterate through objects
  object-file: extract function to read object info from path
  odb: fix flags parameter to be unsigned
  odb: rename `FOR_EACH_OBJECT_*` flags
</content>
</entry>
<entry>
<title>object-file: adapt `stream_object_signature()` to take a stream</title>
<updated>2026-02-23T21:19:00Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-02-23T16:00:07Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=10a6762719f612bb5edc554e62239a744bbc4283'/>
<id>urn:sha1:10a6762719f612bb5edc554e62239a744bbc4283</id>
<content type='text'>
The function `stream_object_signature()` is responsible for verifying
whether the given object ID matches the actual hash of the object's
contents. In contrast to `check_object_signature()` it does so in a
streaming fashion so that we don't have to load the full object into
memory.

In a subsequent commit we'll want to adapt one of its callsites to pass
a preconstructed stream. Prepare for this by accepting a stream as input
that the caller needs to assemble.

While at it, improve the error reporting in `parse_object_with_flags()`
to tell apart the two failure modes.

Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
