<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/reftable/reader.c, branch v2.44.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.44.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.44.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-02-12T21:16:10Z</updated>
<entry>
<title>Merge branch 'ps/reftable-styles'</title>
<updated>2024-02-12T21:16:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-02-12T21:16:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f424d7c33df373fb8eb4c9dc63ab6dc24de24aa5'/>
<id>urn:sha1:f424d7c33df373fb8eb4c9dc63ab6dc24de24aa5</id>
<content type='text'>
Code clean-up in various reftable code paths.

* ps/reftable-styles:
  reftable/record: improve semantics when initializing records
  reftable/merged: refactor initialization of iterators
  reftable/merged: refactor seeking of records
  reftable/stack: use `size_t` to track stack length
  reftable/stack: use `size_t` to track stack slices during compaction
  reftable/stack: index segments with `size_t`
  reftable/stack: fix parameter validation when compacting range
  reftable: introduce macros to allocate arrays
  reftable: introduce macros to grow arrays
</content>
</entry>
<entry>
<title>reftable/record: improve semantics when initializing records</title>
<updated>2024-02-06T20:10:09Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-02-06T06:35:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ddef475d008b8a705a53e6bb1405bb773ffdc50'/>
<id>urn:sha1:3ddef475d008b8a705a53e6bb1405bb773ffdc50</id>
<content type='text'>
According to our usual coding style, the `reftable_new_record()`
function would indicate that it is allocating a new record. This is not
the case though as the function merely initializes records without
allocating any memory.

Replace `reftable_new_record()` with a new `reftable_record_init()`
function that takes a record pointer as input and initializes it
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: introduce macros to allocate arrays</title>
<updated>2024-02-06T20:10:08Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-02-06T06:35:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b4ff12c8eefff9cba73ba3cb7492111adfa31d87'/>
<id>urn:sha1:b4ff12c8eefff9cba73ba3cb7492111adfa31d87</id>
<content type='text'>
Similar to the preceding commit, let's carry over macros to allocate
arrays with `REFTABLE_ALLOC_ARRAY()` and `REFTABLE_CALLOC_ARRAY()`. This
requires us to change the signature of `reftable_calloc()`, which only
takes a single argument right now and thus puts the burden on the caller
to calculate the final array's size. This is a net improvement though as
it means that we can now provide proper overflow checks when multiplying
the array size with the member size.

Convert callsites of `reftable_calloc()` to the new signature and start
using the new macros where possible.

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: document reading and writing indices</title>
<updated>2024-02-01T19:11:33Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-02-01T07:52:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4950acae7d0db40c327003eff2621aaa2172322c'/>
<id>urn:sha1:4950acae7d0db40c327003eff2621aaa2172322c</id>
<content type='text'>
The way the index gets written and read is not trivial at all and
requires the reader to piece together a bunch of parts to figure out how
it works. Add some documentation to hopefully make this easier to
understand for the next reader.

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: be more careful about errors in indexed seeks</title>
<updated>2024-02-01T19:11:32Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-02-01T07:51:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d55fc5128b26a64c2e7b6612d0442c9e924696e8'/>
<id>urn:sha1:d55fc5128b26a64c2e7b6612d0442c9e924696e8</id>
<content type='text'>
When doing an indexed seek we first need to do a linear seek in order to
find the index block for our wanted key. We do not check the returned
error of the linear seek though. This is likely not an issue because the
next call to `table_iter_next()` would return error, too. But it very
much is a code smell when an error variable is being assigned to without
actually checking it.

Safeguard the code by checking for 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>Merge branch 'en/header-cleanup'</title>
<updated>2024-01-08T22:05:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-01-08T22:05:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=492ee03f60297e7e83d101f4519ab8abc98782bc'/>
<id>urn:sha1:492ee03f60297e7e83d101f4519ab8abc98782bc</id>
<content type='text'>
Remove unused header "#include".

* en/header-cleanup:
  treewide: remove unnecessary includes in source files
  treewide: add direct includes currently only pulled in transitively
  trace2/tr2_tls.h: remove unnecessary include
  submodule-config.h: remove unnecessary include
  pkt-line.h: remove unnecessary include
  line-log.h: remove unnecessary include
  http.h: remove unnecessary include
  fsmonitor--daemon.h: remove unnecessary includes
  blame.h: remove unnecessary includes
  archive.h: remove unnecessary include
  treewide: remove unnecessary includes in source files
  treewide: remove unnecessary includes from header files
</content>
</entry>
<entry>
<title>treewide: remove unnecessary includes in source files</title>
<updated>2023-12-26T20:04:31Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-12-23T17:14:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eea0e59ffbed6e33d171ace5be13cde9faa41639'/>
<id>urn:sha1:eea0e59ffbed6e33d171ace5be13cde9faa41639</id>
<content type='text'>
Each of these were checked with
   gcc -E -I. ${SOURCE_FILE} | grep ${HEADER_FILE}
to ensure that removing the direct inclusion of the header actually
resulted in that header no longer being included at all (i.e. that
no other header pulled it in transitively).

...except for a few cases where we verified that although the header
was brought in transitively, nothing from it was directly used in
that source file.  These cases were:
  * builtin/credential-cache.c
  * builtin/pull.c
  * builtin/send-pack.c

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable/block: introduce macro to initialize `struct block_iter`</title>
<updated>2023-12-11T15:23:17Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2023-12-11T09:08:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a8305bc6d8eb55cf52264964c8fc0289b72f2fd8'/>
<id>urn:sha1:a8305bc6d8eb55cf52264964c8fc0289b72f2fd8</id>
<content type='text'>
There are a bunch of locations where we initialize members of `struct
block_iter`, which makes it harder than necessary to expand this struct
to have additional members. Unify the logic via a new `BLOCK_ITER_INIT`
macro that initializes all members.

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: drop unused parameter from reader_seek_linear()</title>
<updated>2022-08-20T21:14:55Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2022-08-19T08:54:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=21a40847ed4a5ec96b0d9cc87b3fe406e7f8f904'/>
<id>urn:sha1:21a40847ed4a5ec96b0d9cc87b3fe406e7f8f904</id>
<content type='text'>
The reader code passes around a "struct reftable_reader" context
variable. But the seek function doesn't need it; the table iterator we
already get is sufficient.

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>reftable: reject 0 object_id_len</title>
<updated>2022-02-23T21:36:26Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2022-02-21T18:46:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eff5832ba13b81ebbf68b0c28934fe18ba8601fc'/>
<id>urn:sha1:eff5832ba13b81ebbf68b0c28934fe18ba8601fc</id>
<content type='text'>
The spec says 2 &lt;= object_id_len &lt;= 31. We are lenient and allow 1,
but we forbid 0, so we can be sure that we never read a 0-length key.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
