<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pack-bitmap.c, branch v2.51.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.51.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.51.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-08-04T01:44:27Z</updated>
<entry>
<title>Merge branch 'ps/object-store-midx'</title>
<updated>2025-08-04T01:44:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-08-04T01:44:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=733b640d5099df783f28ddf8ce35749b8c53f206'/>
<id>urn:sha1:733b640d5099df783f28ddf8ce35749b8c53f206</id>
<content type='text'>
Redefine where the multi-pack-index sits in the object subsystem,
which recently was restructured to allow multiple backends that
support a single object source that belongs to one repository.  A
midx does span mulitple "object sources".

* ps/object-store-midx:
  midx: remove now-unused linked list of multi-pack indices
  packfile: stop using linked MIDX list in `get_all_packs()`
  packfile: stop using linked MIDX list in `find_pack_entry()`
  packfile: refactor `get_multi_pack_index()` to work on sources
  midx: stop using linked list when closing MIDX
  packfile: refactor `prepare_packed_git_one()` to work on sources
  midx: start tracking per object database source
</content>
</entry>
<entry>
<title>Merge branch 'ly/load-bitmap-leakfix'</title>
<updated>2025-07-15T22:18:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-07-15T22:18:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f31d155266130c0d9c7c7258dfe8f5e6d6b0eca8'/>
<id>urn:sha1:f31d155266130c0d9c7c7258dfe8f5e6d6b0eca8</id>
<content type='text'>
Leakfix with a new and a bit invasive test.

* ly/load-bitmap-leakfix:
  pack-bitmap: add load corrupt bitmap test
  pack-bitmap: reword comments in test_bitmap_commits()
  pack-bitmap: fix memory leak if load_bitmap() failed
</content>
</entry>
<entry>
<title>Merge branch 'ps/object-store'</title>
<updated>2025-07-15T22:18:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-07-15T22:18:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=51b50c55a93205e8cf427a9c5f9c489c6b468542'/>
<id>urn:sha1:51b50c55a93205e8cf427a9c5f9c489c6b468542</id>
<content type='text'>
Code clean-up around object access API.

* ps/object-store:
  odb: rename `read_object_with_reference()`
  odb: rename `pretend_object_file()`
  odb: rename `has_object()`
  odb: rename `repo_read_object_file()`
  odb: rename `oid_object_info()`
  odb: trivial refactorings to get rid of `the_repository`
  odb: get rid of `the_repository` when handling submodule sources
  odb: get rid of `the_repository` when handling the primary source
  odb: get rid of `the_repository` in `for_each()` functions
  odb: get rid of `the_repository` when handling alternates
  odb: get rid of `the_repository` in `odb_mkstemp()`
  odb: get rid of `the_repository` in `assert_oid_type()`
  odb: get rid of `the_repository` in `find_odb()`
  odb: introduce parent pointers
  object-store: rename files to "odb.{c,h}"
  object-store: rename `object_directory` to `odb_source`
  object-store: rename `raw_object_store` to `object_database`
</content>
</entry>
<entry>
<title>packfile: refactor `get_multi_pack_index()` to work on sources</title>
<updated>2025-07-15T19:07:29Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-07-15T11:29:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=736bb725ebcd37d567455db2ac50524dea11223c'/>
<id>urn:sha1:736bb725ebcd37d567455db2ac50524dea11223c</id>
<content type='text'>
The function `get_multi_pack_index()` loads multi-pack indices via
`prepare_packed_git()` and then returns the linked list of multi-pack
indices that is stored in `struct object_database`. That list is in the
process of being removed though in favor of storing the MIDX as part of
the object database source it belongs to.

Refactor `get_multi_pack_index()` so that it returns the multi-pack
index for a single object source. Callers are now expected to call this
function for each source they are interested in. This requires them to
iterate through alternates, so we have to prepare alternate object
sources before doing so.

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/object-store' into ps/object-store-midx</title>
<updated>2025-07-09T15:29:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-07-09T15:29:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=db0583b3fd18596b8e360b0fd1554ac3e5c15793'/>
<id>urn:sha1:db0583b3fd18596b8e360b0fd1554ac3e5c15793</id>
<content type='text'>
* ps/object-store:
  odb: rename `read_object_with_reference()`
  odb: rename `pretend_object_file()`
  odb: rename `has_object()`
  odb: rename `repo_read_object_file()`
  odb: rename `oid_object_info()`
  odb: trivial refactorings to get rid of `the_repository`
  odb: get rid of `the_repository` when handling submodule sources
  odb: get rid of `the_repository` when handling the primary source
  odb: get rid of `the_repository` in `for_each()` functions
  odb: get rid of `the_repository` when handling alternates
  odb: get rid of `the_repository` in `odb_mkstemp()`
  odb: get rid of `the_repository` in `assert_oid_type()`
  odb: get rid of `the_repository` in `find_odb()`
  odb: introduce parent pointers
  object-store: rename files to "odb.{c,h}"
  object-store: rename `object_directory` to `odb_source`
  object-store: rename `raw_object_store` to `object_database`
</content>
</entry>
<entry>
<title>odb: rename `oid_object_info()`</title>
<updated>2025-07-01T21:46:37Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-07-01T12:22:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e989dd96b8aa9b20b0e23d3fa845d0baba1b454a'/>
<id>urn:sha1:e989dd96b8aa9b20b0e23d3fa845d0baba1b454a</id>
<content type='text'>
Rename `oid_object_info()` to `odb_read_object_info()` as well as their
`_extended()` variant to match other functions related to the object
database and our modern coding guidelines.

Introduce compatibility wrappers so that any in-flight topics will
continue to compile.

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: rename files to "odb.{c,h}"</title>
<updated>2025-07-01T21:46:34Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-07-01T12:22:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8f49151763cb81adf4bcec53c1ae67057081b02d'/>
<id>urn:sha1:8f49151763cb81adf4bcec53c1ae67057081b02d</id>
<content type='text'>
In the preceding commits we have renamed the structures contained in
"object-store.h" to `struct object_database` and `struct odb_backend`.
As such, the code files "object-store.{c,h}" are confusingly named now.
Rename them to "odb.{c,h}" accordingly.

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>pack-bitmap: add load corrupt bitmap test</title>
<updated>2025-07-01T21:41:54Z</updated>
<author>
<name>Lidong Yan</name>
<email>502024330056@smail.nju.edu.cn</email>
</author>
<published>2025-07-01T05:32:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bfd5522e98cead32d7bbdf54eca4ffeb3e01fa6b'/>
<id>urn:sha1:bfd5522e98cead32d7bbdf54eca4ffeb3e01fa6b</id>
<content type='text'>
t5310 lacks a test to ensure git works correctly when commit bitmap
data is corrupted. So this patch add test helper in pack-bitmap.c to
list each commit bitmap position in bitmap file and `load corrupt bitmap`
test case in t/t5310 to corrupt a commit bitmap before loading it.

Signed-off-by: Lidong Yan &lt;502024330056@smail.nju.edu.cn&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-bitmap: reword comments in test_bitmap_commits()</title>
<updated>2025-07-01T21:41:53Z</updated>
<author>
<name>Lidong Yan</name>
<email>502024330056@smail.nju.edu.cn</email>
</author>
<published>2025-07-01T05:32:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=73bf771b958b0d28fc5839cd94c4b7ad2029f631'/>
<id>urn:sha1:73bf771b958b0d28fc5839cd94c4b7ad2029f631</id>
<content type='text'>
The comment in pack-bitmap.c:test_bitmap_commits(), suggests that
we can avoid reading the commit table altogether. However, this
comment is misleading. The reason we load bitmap entries here is
because test_bitmap_commits() needs to print the commit IDs from the
bitmap, and we must read the bitmap entries to obtain those commit IDs.
So reword this comment.

Signed-off-by: Lidong Yan &lt;502024330056@smail.nju.edu.cn&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-bitmap: fix memory leak if load_bitmap() failed</title>
<updated>2025-07-01T21:41:53Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2025-07-01T05:32:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3367b6657c456788e37c335bdd3225e517d2c804'/>
<id>urn:sha1:3367b6657c456788e37c335bdd3225e517d2c804</id>
<content type='text'>
After going through the "failed" label, load_bitmap() will return -1,
and its caller (either prepare_bitmap_walk() or prepare_bitmap_git())
will then call free_bitmap_index().

That function would have done:

    struct stored_bitmap *sb;
    kh_foreach_value(b-&gt;bitmaps, sb {
      ewah_pool_free(sb-&gt;root);
      free(sb);
    });

, but won't since load_bitmap() already called kh_destroy_oid_map() and
NULL'd the "bitmaps" pointer from within its "failed" label. Thus if you
got part of the way through loading bitmap entries and then failed, you
would leak all of the previous entries that you were able to load
successfully.

The solution is to remove the error handling code in load_bitmap(), because
its caller will always call free_bitmap_index() in case of an error.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Lidong Yan &lt;502024330056@smail.nju.edu.cn&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
