<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/odb.h, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2026-04-01T03:43:14Z</updated>
<entry>
<title>odb: drop unneeded headers and forward decls</title>
<updated>2026-04-01T03:43:14Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-31T23:57:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=109bcb7d1d2f0d2f0514beec15779190c0b89575'/>
<id>urn:sha1:109bcb7d1d2f0d2f0514beec15779190c0b89575</id>
<content type='text'>
There's a couple of unneeded forward declarations and headers in
"odb.h". Drop these.

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: rename `odb_has_object()` flags</title>
<updated>2026-04-01T03:43:14Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-31T23:57:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c63911b052dc286de5daddba8d4a20fd59348cee'/>
<id>urn:sha1:c63911b052dc286de5daddba8d4a20fd59348cee</id>
<content type='text'>
Rename `odb_has_object()` flags to be properly prefixed with the
function name.

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: 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='https://git.shady.money/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>odb: rename `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:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ff2e9d85d61f2f51793acbdb4bad68d48cc8bb85'/>
<id>urn:sha1:ff2e9d85d61f2f51793acbdb4bad68d48cc8bb85</id>
<content type='text'>
Rename `odb_write_object()` flags to be properly prefixed with the
function name.

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>treewide: use enum for `odb_for_each_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:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=75c702624d9a5f60a78c2d4d5e8de83468c9c5ec'/>
<id>urn:sha1:75c702624d9a5f60a78c2d4d5e8de83468c9c5ec</id>
<content type='text'>
We've got a couple of callsites where we pass `odb_for_each_object()`
flags, but accept an `unsigned` flags field instead of the corresponding
enum. Adapt these to accept the enum type instead.

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 generic `odb_find_abbrev_len()`</title>
<updated>2026-03-20T20:16:42Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-20T07:07:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=83869e15fa9ef3b0ea2adbfe2fe68a309f95b856'/>
<id>urn:sha1:83869e15fa9ef3b0ea2adbfe2fe68a309f95b856</id>
<content type='text'>
Introduce a new generic `odb_find_abbrev_len()` function as well as
source-specific callback functions. This makes the logic to compute the
required prefix length to make a given object unique fully pluggable.

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='https://git.shady.money/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='https://git.shady.money/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>odb: introduce generic object counting</title>
<updated>2026-03-12T15:38:43Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-12T08:43:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6801ffd37df8420917e1feaf03b5f7c175798bff'/>
<id>urn:sha1:6801ffd37df8420917e1feaf03b5f7c175798bff</id>
<content type='text'>
Similar to the preceding commit, introduce counting of objects on the
object database level, replacing the logic that we have in
`repo_approximate_object_count()`.

Note that the function knows to cache the object count. It's unclear
whether this cache is really required as we shouldn't have that many
cases where we count objects repeatedly. But to be on the safe side the
caching mechanism is retained, with the only excepting being that we
also have to use the passed flags as caching key.

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='https://git.shady.money/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>
</feed>
