<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/reftable/stack.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-04-07T21:53:12Z</updated>
<entry>
<title>reftable/constants: make block types part of the public interface</title>
<updated>2025-04-07T21:53:12Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-07T13:16:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0f8ee94b636b5ab183c62b8fdd26c1611c2b86f4'/>
<id>urn:sha1:0f8ee94b636b5ab183c62b8fdd26c1611c2b86f4</id>
<content type='text'>
Now that reftable blocks can be read individually via the public
interface it becomes necessary for callers to be able to distinguish the
different types of blocks. Expose the relevant constants.

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/reader: rename data structure to "table"</title>
<updated>2025-04-07T21:53:09Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-07T13:16:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b648bd654947db06e5549d724f46d3660ac11e19'/>
<id>urn:sha1:b648bd654947db06e5549d724f46d3660ac11e19</id>
<content type='text'>
The `struct reftable_reader` subsystem encapsulates a table that has
been read from the disk. As such, the current name of that structure is
somewhat hard to understand as it only talks about the fact that we read
something from disk, without really giving an indicator _what_ that is.

Furthermore, this naming schema doesn't really fit well into how the
other structures are named: `reftable_merged_table`, `reftable_stack`,
`reftable_block` and `reftable_record` are all named after what they
encapsulate.

Rename the subsystem to `reftable_table`, which directly gives a hint
that the data structure is about handling the individual tables part of
the stack.

While this change results in a lot of churn, it prepares for us exposing
the APIs to third-party callers now that the reftable library is a
standalone library that can be linked against by other projects.

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/stack: stop using `sleep_millisec()`</title>
<updated>2025-02-18T18:55:38Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-02-18T09:20:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=10f2935c7f2070368dadde582f94c9c76e2fe991'/>
<id>urn:sha1:10f2935c7f2070368dadde582f94c9c76e2fe991</id>
<content type='text'>
Refactor our use of `sleep_millisec()` by open-coding it with poll(3p),
which is the current implementation of this function. Ideally, we'd use
a more direct way to sleep, but there is no equivalent to sleep(3p) that
would accept milliseconds as input.

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/system: introduce `reftable_rand()`</title>
<updated>2025-02-18T18:55:38Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-02-18T09:20:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=712f6cfe5411fdbbf46688c22a40fac7e0a8839b'/>
<id>urn:sha1:712f6cfe5411fdbbf46688c22a40fac7e0a8839b</id>
<content type='text'>
Introduce a new system-level `reftable_rand()` function that generates a
single unsigned integer for us. The implementation of this function is
to be provided by the calling codebase, which allows us to more easily
hook into pre-seeded random number generators.

Adapt the two callsites where we generated random data.

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/stack: stop using `write_in_full()`</title>
<updated>2025-02-18T18:55:35Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-02-18T09:20:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e31db89558b7f1d622e5a64cf37779b721099814'/>
<id>urn:sha1:e31db89558b7f1d622e5a64cf37779b721099814</id>
<content type='text'>
Similar to the preceding commit, drop our use of `write_in_full()` and
implement a new wrapper `reftable_write_full()` that handles this logic
for us. This is done to reduce our dependency on the Git library.

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/stack: stop using `read_in_full()`</title>
<updated>2025-02-18T18:55:35Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-02-18T09:20:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cb3e368b6913a2446f245e7ae7a7e4ae4a2e6794'/>
<id>urn:sha1:cb3e368b6913a2446f245e7ae7a7e4ae4a2e6794</id>
<content type='text'>
There is a single callsite of `read_in_full()` in the reftable library.
Open-code the function to reduce our dependency on the Git library.

Note that we only partially port over the logic from `read_in_full()`
and its underlying `xread()` helper. Most importantly, the latter also
knows to handle `EWOULDBLOCK` via `handle_nonblock()`. This logic is
irrelevant for us though because the reftable library never sets the
`O_NONBLOCK` option in the first place.

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 'kn/reflog-migration-fix-followup'</title>
<updated>2025-02-15T01:53:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-02-15T01:53:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=82522a9e2ce3e2b400a217a21b05204a2034edbc'/>
<id>urn:sha1:82522a9e2ce3e2b400a217a21b05204a2034edbc</id>
<content type='text'>
Code clean-up.

* kn/reflog-migration-fix-followup:
  reftable: prevent 'update_index' changes after adding records
  refs: use 'uint64_t' for 'ref_update.index'
  refs: mark `ref_transaction_update_reflog()` as static
</content>
</entry>
<entry>
<title>Merge branch 'ps/reftable-sign-compare'</title>
<updated>2025-01-28T21:02:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-01-28T21:02:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a17fd7dd3ada289df8e44e64ff52a5d886dfee95'/>
<id>urn:sha1:a17fd7dd3ada289df8e44e64ff52a5d886dfee95</id>
<content type='text'>
The reftable/ library code has been made -Wsign-compare clean.

* ps/reftable-sign-compare:
  reftable: address trivial -Wsign-compare warnings
  reftable/blocksource: adjust `read_block()` to return `ssize_t`
  reftable/blocksource: adjust type of the block length
  reftable/block: adjust type of the restart length
  reftable/block: adapt header and footer size to return a `size_t`
  reftable/basics: adjust `hash_size()` to return `uint32_t`
  reftable/basics: adjust `common_prefix_size()` to return `size_t`
  reftable/record: handle overflows when decoding varints
  reftable/record: drop unused `print` function pointer
  meson: stop disabling -Wsign-compare
</content>
</entry>
<entry>
<title>reftable: prevent 'update_index' changes after adding records</title>
<updated>2025-01-22T17:51:36Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2025-01-22T05:35:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=017bd8923986acd4992fd21f3451fdd15ec6edce'/>
<id>urn:sha1:017bd8923986acd4992fd21f3451fdd15ec6edce</id>
<content type='text'>
The function `reftable_writer_set_limits()` allows updating the
'min_update_index' and 'max_update_index' of a reftable writer. These
values are written to both the writer's header and footer.

Since the header is written during the first block write, any subsequent
changes to the update index would create a mismatch between the header
and footer values. The footer would contain the newer values while the
header retained the original ones.

To protect against this bug, prevent callers from updating these values
after any record is written. To do this, modify the function to return
an error whenever the limits are modified after any record adds. Check
for record adds within `reftable_writer_set_limits()` by checking the
`last_key` and `next` variable. The former is updated after each record
added, but is reset at certain points. The latter is set after writing
the first block.

Modify all callers of the function to anticipate a return type and
handle it accordingly. Add a unit test to also ensure the function
returns the error as expected.

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