<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/object-store.h, branch v2.50.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.50.0</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.50.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-05-27T20:59:08Z</updated>
<entry>
<title>Merge branch 'jk/no-funny-object-types'</title>
<updated>2025-05-27T20:59:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-05-27T20:59:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=17d9dbd3c270aaa33487f6a03d128c47aea6b309'/>
<id>urn:sha1:17d9dbd3c270aaa33487f6a03d128c47aea6b309</id>
<content type='text'>
Support to create a loose object file with unknown object type has
been dropped.

* jk/no-funny-object-types:
  object-file: drop support for writing objects with unknown types
  hash-object: handle --literally with OPT_NEGBIT
  hash-object: merge HASH_* and INDEX_* flags
  hash-object: stop allowing unknown types
  t: add lib-loose.sh
  t/helper: add zlib test-tool
  oid_object_info(): drop type_name strbuf
  fsck: stop using object_info-&gt;type_name strbuf
  oid_object_info_convert(): stop using string for object type
  cat-file: use type enum instead of buffer for -t option
  object-file: drop OBJECT_INFO_ALLOW_UNKNOWN_TYPE flag
  cat-file: make --allow-unknown-type a noop
  object-file.h: fix typo in variable declaration
</content>
</entry>
<entry>
<title>Merge branch 'jk/oidmap-cleanup'</title>
<updated>2025-05-19T23:02:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-05-19T23:02:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a9dcacbf2a74537916f61dd8c5f2dd2c1b4eb58a'/>
<id>urn:sha1:a9dcacbf2a74537916f61dd8c5f2dd2c1b4eb58a</id>
<content type='text'>
Code cleanup.

* jk/oidmap-cleanup:
  raw_object_store: drop extra pointer to replace_map
  oidmap: add size function
  oidmap: rename oidmap_free() to oidmap_clear()
</content>
</entry>
<entry>
<title>oid_object_info(): drop type_name strbuf</title>
<updated>2025-05-16T16:43:10Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2025-05-16T04:49:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d2956385a9319155928e2d7bc5f9d90eeac5d0a5'/>
<id>urn:sha1:d2956385a9319155928e2d7bc5f9d90eeac5d0a5</id>
<content type='text'>
We provide a mechanism for callers to get the object type as a raw
string, rather than an object_type enum. This was in theory useful for
returning types that are not representable in the enum, but we consider
any such type to be an error, and there are no callers that use the
strbuf anymore.

Let's drop support to simplify the code a bit.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object-file: drop OBJECT_INFO_ALLOW_UNKNOWN_TYPE flag</title>
<updated>2025-05-16T16:43:10Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2025-05-16T04:49:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ae24b032a04ccd1565cb1ce13317b56daa77ce7f'/>
<id>urn:sha1:ae24b032a04ccd1565cb1ce13317b56daa77ce7f</id>
<content type='text'>
Since cat-file dropped its "--allow-unknown-type" option in the previous
commit, there are no more uses of the internal flag that implemented it.
Let's drop it.

That in turn lets us drop the strbuf parameter of unpack_loose_header(),
which now is always NULL. And without that, we can drop all of the
additional code to inflate larger headers into the strbuf.

Arguably we could drop ULHR_TOO_LONG, as no callers really care about
the distinction from ULHR_BAD. But it's easy enough to retain, and it
does let us produce a slightly more specific message in one instance.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>raw_object_store: drop extra pointer to replace_map</title>
<updated>2025-05-12T20:06:27Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2025-05-12T18:52:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4b63963f5d729cb9eb997c8912b7d500ffc53297'/>
<id>urn:sha1:4b63963f5d729cb9eb997c8912b7d500ffc53297</id>
<content type='text'>
We store the replacement data in an oidmap, which is itself a pointer in
the raw_object_store struct. But there's no need for an extra pointer
indirection here. It is always allocated and initialized along with the
containing struct, and we never check it for NULL-ness.

Let's embed the map directly in the struct, which is simpler and avoids
extra pointer chasing.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object-store: drop `repo_has_object_file()`</title>
<updated>2025-04-29T17:08:13Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-29T07:52:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8a9e27be8213ab90ac761d56ac36229ee52c443f'/>
<id>urn:sha1:8a9e27be8213ab90ac761d56ac36229ee52c443f</id>
<content type='text'>
In the preceding commits we have converted all users of
`repo_has_object_file()` and its `_with_flags()` variant to instead use
`has_object()`. Drop these functions.

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-store: allow fetching objects via `has_object()`</title>
<updated>2025-04-29T17:08:13Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-29T07:52:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f8fc4cacd37afa254a8822258f76de53ae2dfbb2'/>
<id>urn:sha1:f8fc4cacd37afa254a8822258f76de53ae2dfbb2</id>
<content type='text'>
We're about to fully remove `repo_has_object_file()` in favor of
`has_object()`. The latter function does not yet have a way to fetch
missing objects via a promisor remote though, which means that it cannot
fully replace all usecases of `repo_has_object_file()`.

Introduce a new flag `HAS_OBJECT_FETCH_PROMISOR` that causes the
function to optionally fetch missing objects which are part of a
promisor pack. This flag will be used in the subsequent commit.

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-store: move function declarations to their respective subsystems</title>
<updated>2025-04-29T17:08:12Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-29T07:52:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a793261c53507f7c46f748cc76378a9c5bb05cf'/>
<id>urn:sha1:1a793261c53507f7c46f748cc76378a9c5bb05cf</id>
<content type='text'>
We carry declarations for a couple of functions in "object-store.h" that
are not defined in "object-store.c", but in a different subsystem. Move
these declarations to the respective headers whose matching code files
carry the corresponding definition.

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-store: move and rename `odb_pack_keep()`</title>
<updated>2025-04-29T17:08:12Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-29T07:52:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0b8ed25b66aedc9f4fe44d1a5cab2719290b22a9'/>
<id>urn:sha1:0b8ed25b66aedc9f4fe44d1a5cab2719290b22a9</id>
<content type='text'>
The function `odb_pack_keep()` creates a file at the passed-in path. If
this fails, then the function re-tries by first creating any potentially
missing leading directories and then trying to create the file once
again. As such, this function doesn't host any kind of logic that is
specific to the object store, but is rather a generic helper function.

Rename the function to `safe_create_file_with_leading_directories()` and
move it into "path.c". While at it, refactor it so that it loses its
dependency on `the_repository`.

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-store: drop `loose_object_path()`</title>
<updated>2025-04-29T17:08:12Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-29T07:52:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=56ef85e82ffa39ac86db39bc0ac11c67451d0e5b'/>
<id>urn:sha1:56ef85e82ffa39ac86db39bc0ac11c67451d0e5b</id>
<content type='text'>
The function `loose_object_path()` is a trivial wrapper around
`odb_loose_path()`, with the only exception that it always uses the
primary object database of the given repository. This doesn't really add
a ton of value though, so let's drop the function and inline it at every
callsite.

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