<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/reftable/blocksource.c, 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-02T17:45:44Z</updated>
<entry>
<title>reftable/system: add abstraction to mmap files</title>
<updated>2026-04-02T17:45:44Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-04-02T07:31:18Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=87e4eee3f94ec261a92a76d06261b227b00de461'/>
<id>urn:sha1:87e4eee3f94ec261a92a76d06261b227b00de461</id>
<content type='text'>
In our codebase we have a couple of wrappers around mmap(3p) that allow
us to reimplement the syscall on platforms that don't have it natively,
like for example Windows. Other projects that embed the reftable library
may have a different infra though to hook up mmap wrappers, but these
are currently hard to integrate.

Provide the infrastructure to let projects easily define the mmap
interface with a custom struct and custom 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>reftable/block: rename `block` to `block_data`</title>
<updated>2025-04-07T21:53:10Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-07T13:16:18Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=2b3362c10d39efe09fe9ef16122df3bed5149032'/>
<id>urn:sha1:2b3362c10d39efe09fe9ef16122df3bed5149032</id>
<content type='text'>
The `reftable_block` structure associates a byte slice with a block
source. As such it only holds the data of a reftable block without
actually encoding any of the details for how to access that data.

Rename the structure to instead be called `reftable_block_data`. Besides
clarifying that this really only holds data, it also allows us to rename
the `reftable_block_reader` to `reftable_block` in the next commit, as
this is the structure that actually encapsulates access to the reftable
blocks.

Rename the `struct reftable_block_reader::block` member 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>reftable/blocksource: consolidate code into a single file</title>
<updated>2025-04-07T21:53:09Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-07T13:16:15Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=1ac4e5e83d997887dcd051c89861292a45a3db8c'/>
<id>urn:sha1:1ac4e5e83d997887dcd051c89861292a45a3db8c</id>
<content type='text'>
The code that implements block sources is distributed across a couple of
files. Consolidate all of it into "reftable/blocksource.c" and its
accompanying header so that it is easier to locate and more self
contained.

While at it, rename some of the functions to have properly scoped names.

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>reftable: fix formatting of the license header</title>
<updated>2025-04-07T21:53:09Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-07T13:16:13Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=6dcc05ffc3ead0745d19decd0e8ecd65edc9d414'/>
<id>urn:sha1:6dcc05ffc3ead0745d19decd0e8ecd65edc9d414</id>
<content type='text'>
The license headers used across the reftable library doesn't follow our
typical coding style for multi-line comments. Fix it.

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>reftable/basics: introduce `REFTABLE_UNUSED` annotation</title>
<updated>2025-02-18T18:55:38Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-02-18T09:20:50Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=f93b2a04243ee1a95920ae02a9423accbe1c3719'/>
<id>urn:sha1:f93b2a04243ee1a95920ae02a9423accbe1c3719</id>
<content type='text'>
Introduce the `REFTABLE_UNUSED` annotation and replace all existing
users of `UNUSED` in the reftable library to use the new macro instead.

Note that we unconditionally define `MAYBE_UNUSED` in the exact same
way, so doing so unconditionally for `REFTABLE_UNUSED` should be fine,
too.

Suggested-by: Toon Claes &lt;toon@iotcl.com&gt;
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>reftable/blocksource: stop using `xmmap()`</title>
<updated>2025-02-18T18:55:35Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-02-18T09:20:39Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=70afa6fa318db517adb0cc7d4cb66260061bb684'/>
<id>urn:sha1:70afa6fa318db517adb0cc7d4cb66260061bb684</id>
<content type='text'>
We use `xmmap()` to map reftables into memory. This function has two
problems:

  - It causes us to die in case the mmap fails.

  - It ties us to the Git codebase.

Refactor the code to use mmap(3p) instead with manual error checking.
Note that this function may not be the system-provided mmap(3p), but may
point to our `git_mmap()` wrapper that emulates the syscall on systems
that do not have mmap(3p) available.

Fix `reftable_block_source_from_file()` to properly bubble up the error
code in case the map(3p) call fails.

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>reftable/blocksource: adjust `read_block()` to return `ssize_t`</title>
<updated>2025-01-21T22:20:30Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-01-20T16:17:27Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=7c4c1cbc0b94665d6a94ac7df385459346af5265'/>
<id>urn:sha1:7c4c1cbc0b94665d6a94ac7df385459346af5265</id>
<content type='text'>
The `block_source_read_block()` function and its implementations return
an integer as a result that reflects either the number of bytes read, or
an error. As such its return type, a signed integer, isn't wrong, but it
doesn't give the reader a good hint what it actually returns.

Refactor the function to return an `ssize_t` instead, which is typical
for functions similar to read(3p) and should thus give readers a better
signal what they can expect as a result.

Adjust callers to better handle the returned value to avoid warnings
with -Wsign-compare. One of these callers is `reader_get_block()`, whose
return value is only ever used by its callers to figure out whether or
not the read was successful. So instead of bubbling up the `ssize_t`
there, too, we adapt it to only indicate success or errors.

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>reftable/blocksource: adapt interface name</title>
<updated>2024-10-17T20:59:56Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-10-17T04:53:59Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=f177d491637a3771f19055cb3873bda9c163c91a'/>
<id>urn:sha1:f177d491637a3771f19055cb3873bda9c163c91a</id>
<content type='text'>
Adapt the name of the `strbuf` block source to no longer relate to this
interface, but instead to the `reftable_buf` interface.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>reftable: convert from `strbuf` to `reftable_buf`</title>
<updated>2024-10-17T20:59:56Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-10-17T04:53:56Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=be4c070a3c9e7c9d6836c724929ff8a365361e1a'/>
<id>urn:sha1:be4c070a3c9e7c9d6836c724929ff8a365361e1a</id>
<content type='text'>
Convert the reftable library to use the `reftable_buf` interface instead
of the `strbuf` interface. This is mostly a mechanical change via sed(1)
with some manual fixes where functions for `strbuf` and `reftable_buf`
differ. The converted code does not yet handle allocation failures. This
will be handled in subsequent commits.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>reftable/blocksource: handle allocation failures</title>
<updated>2024-10-02T14:53:54Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-10-02T10:56:17Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=cd6a47167e068812735950b841c7174cd7cd321e'/>
<id>urn:sha1:cd6a47167e068812735950b841c7174cd7cd321e</id>
<content type='text'>
Handle allocation failures in the blocksource code.

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