<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/odb.c, 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: 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>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>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>odb/source: make `write_alternate()` function pluggable</title>
<updated>2026-03-05T19:45:17Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-05T14:19:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eb9635d83b7ef16df527db3e84def9d0c772344d'/>
<id>urn:sha1:eb9635d83b7ef16df527db3e84def9d0c772344d</id>
<content type='text'>
Introduce a new callback function in `struct odb_source` to make the
function 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>odb/source: make `read_alternates()` function pluggable</title>
<updated>2026-03-05T19:45:16Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-05T14:19:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7ae23630c3ed012180edc88f0a9615a0d570a77c'/>
<id>urn:sha1:7ae23630c3ed012180edc88f0a9615a0d570a77c</id>
<content type='text'>
Introduce a new callback function in `struct odb_source` to make the
function 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>odb/source: make `write_object_stream()` function pluggable</title>
<updated>2026-03-05T19:45:16Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-05T14:19:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fc7fb0ef3575091bbc00d6bf8345c2da0c386052'/>
<id>urn:sha1:fc7fb0ef3575091bbc00d6bf8345c2da0c386052</id>
<content type='text'>
Introduce a new callback function in `struct odb_source` to make the
function 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>odb/source: make `write_object()` function pluggable</title>
<updated>2026-03-05T19:45:16Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-05T14:19:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6e76c3ab69f9b30530d50550a2feb7d8bda935db'/>
<id>urn:sha1:6e76c3ab69f9b30530d50550a2feb7d8bda935db</id>
<content type='text'>
Introduce a new callback function in `struct odb_source` to make the
function pluggable.

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