<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/reftable/basics.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>2025-10-07T16:22:57Z</updated>
<entry>
<title>reftable: check for trailing newline in 'tables.list'</title>
<updated>2025-10-07T16:22:57Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2025-10-07T12:11:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f6442063775b68d9eeaeb9088379fba3298c80ac'/>
<id>urn:sha1:f6442063775b68d9eeaeb9088379fba3298c80ac</id>
<content type='text'>
In the reftable format, the 'tables.list' file contains a
newline separated list of tables. While we parse this file, we do not
check or care about the last newline. Tighten the parser in
`parse_names()` to return an appropriate error if the last newline is
missing.

This requires modification to `parse_names()` to now return the error
while accepting the output as a third argument.

Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable: make REFTABLE_UNUSED C99 compatible</title>
<updated>2025-05-29T16:18:53Z</updated>
<author>
<name>Carlo Marcelo Arenas Belón</name>
<email>carenas@gmail.com</email>
</author>
<published>2025-05-29T10:11:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f1228cd12c129a7e4da317e1d21741a3ec26e07e'/>
<id>urn:sha1:f1228cd12c129a7e4da317e1d21741a3ec26e07e</id>
<content type='text'>
Since f93b2a0424 (reftable/basics: introduce `REFTABLE_UNUSED`
annotation, 2025-02-18), the reftable library was migrated to
use an internal version of `UNUSED`, which unconditionally sets
a GNU __attribute__ to avoid warnings function parameters that
are not being used.

Make the definition conditional to prevent breaking the build
with non GNU compilers.

Reported-by: "Randall S. Becker" &lt;rsbecker@nexbridge.com&gt;
Signed-off-by: Carlo Marcelo Arenas Belón &lt;carenas@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable/block: create public interface for reading blocks</title>
<updated>2025-04-07T21:53:11Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-07T13:16:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=655e18d6b4f845090b0ba4761105b32726893ecb'/>
<id>urn:sha1:655e18d6b4f845090b0ba4761105b32726893ecb</id>
<content type='text'>
While users of the reftable library wouldn't generally require access to
individual blocks in a reftable table, there are valid usecases where
one may require low-level access to them. One such upcoming usecase in
the Git codebase is to implement consistency checks for the reftable
library where we want to verify each block individually.

Create a public interface for reading blocks. The interface isn't yet
complete and lacks e.g. a way to read individual records from a block.
Such missing functionality will be backfilled in subsequent commits.

Note that this change also requires us to expose `reftable_buf`, which
is used by the `reftable_block_first_key()` function.

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='https://git.shady.money/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='https://git.shady.money/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/basics: stop using `SWAP()` macro</title>
<updated>2025-02-18T18:55:38Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-02-18T09:20:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f8ed12dec459df9ea0d43ccacc93cb2c32702c0e'/>
<id>urn:sha1:f8ed12dec459df9ea0d43ccacc93cb2c32702c0e</id>
<content type='text'>
Stop using `SWAP()` macro in favor of an open-coded variant of it. Note
that this also requires us to open-code the build assert that `SWAP()`
itself uses to verify that the size of both variables matches.

This is done to reduce our dependency on the Git codebase.

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: provide wrappers for big endian conversion</title>
<updated>2025-02-18T18:55:37Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-02-18T09:20:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e676694298c4a8d9f6fdf3844cbfb03bbee552cc'/>
<id>urn:sha1:e676694298c4a8d9f6fdf3844cbfb03bbee552cc</id>
<content type='text'>
We're using a mixture of big endian conversion functions provided by
both the reftable library, but also by the Git codebase. Refactor the
code so that we exclusively use reftable-provided wrappers in order to
untangle us from the Git codebase.

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: stop using `st_mult()` in array allocators</title>
<updated>2025-02-18T18:55:37Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-02-18T09:20:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6e3ea71639a3541523f2be8f950325c8a0aa6768'/>
<id>urn:sha1:6e3ea71639a3541523f2be8f950325c8a0aa6768</id>
<content type='text'>
We're using `st_mult()` as part of our macro helpers that allocate
arrays. This is bad due two two reasons:

  - `st_mult()` causes us to die in case the multiplication overflows.

  - `st_mult()` ties us to the Git codebase.

Refactor the code to instead detect overflows manually and return an
error in such cases.

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: adjust `hash_size()` to return `uint32_t`</title>
<updated>2025-01-21T22:20:29Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-01-20T16:17:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=57adf71b93efa9f9b4db5147e9fa1235f0a1d5ba'/>
<id>urn:sha1:57adf71b93efa9f9b4db5147e9fa1235f0a1d5ba</id>
<content type='text'>
The `hash_size()` function returns the number of bytes used by the hash
function. Weirdly enough though, it returns a signed integer for its
size even though the size obviously cannot ever be negative. The only
case where it could be negative is if the function returned an error
when asked for an unknown hash, but we assert(3p) instead.

Adjust the type of `hash_size()` to be `uint32_t` and adapt all places
that use signed integers for the hash size to follow suit. This also
allows us to get rid of a couple asserts that we had which verified that
the size was indeed positive, which further stresses the point that this
refactoring makes sense.

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: adjust `common_prefix_size()` to return `size_t`</title>
<updated>2025-01-21T22:20:29Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-01-20T16:17:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5ac65f0d6b867ff031fda03779c2f2613f022b10'/>
<id>urn:sha1:5ac65f0d6b867ff031fda03779c2f2613f022b10</id>
<content type='text'>
The `common_prefix_size()` function computes the length of the common
prefix between two buffers. As such its return value will always be an
unsigned integer, as the length cannot be negative. Regardless of that,
the function returns a signed integer, which is nonsensical and causes a
couple of -Wsign-compare warnings all over the place.

Adjust the function to return a `size_t` instead.

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