<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/reftable/stack_test.c, branch v2.46.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.46.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.46.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-06-17T22:55:58Z</updated>
<entry>
<title>Merge branch 'ps/no-writable-strings'</title>
<updated>2024-06-17T22:55:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-06-17T22:55:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4216329457926de0d977975fe9e3eef97a08be54'/>
<id>urn:sha1:4216329457926de0d977975fe9e3eef97a08be54</id>
<content type='text'>
Building with "-Werror -Wwrite-strings" is now supported.

* ps/no-writable-strings: (27 commits)
  config.mak.dev: enable `-Wwrite-strings` warning
  builtin/merge: always store allocated strings in `pull_twohead`
  builtin/rebase: always store allocated string in `options.strategy`
  builtin/rebase: do not assign default backend to non-constant field
  imap-send: fix leaking memory in `imap_server_conf`
  imap-send: drop global `imap_server_conf` variable
  mailmap: always store allocated strings in mailmap blob
  revision: always store allocated strings in output encoding
  remote-curl: avoid assigning string constant to non-const variable
  send-pack: always allocate receive status
  parse-options: cast long name for OPTION_ALIAS
  http: do not assign string constant to non-const field
  compat/win32: fix const-correctness with string constants
  pretty: add casts for decoration option pointers
  object-file: make `buf` parameter of `index_mem()` a constant
  object-file: mark cached object buffers as const
  ident: add casts for fallback name and GECOS
  entry: refactor how we remove items for delayed checkouts
  line-log: always allocate the output prefix
  line-log: stop assigning string constant to file parent buffer
  ...
</content>
</entry>
<entry>
<title>Merge branch 'cp/reftable-unit-test'</title>
<updated>2024-06-12T20:37:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-06-12T20:37:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=56346ba24e16274196180a859d27a8199acb6150'/>
<id>urn:sha1:56346ba24e16274196180a859d27a8199acb6150</id>
<content type='text'>
Basic unit tests for reftable have been reimplemented under the
unit test framework.

* cp/reftable-unit-test:
  t: improve the test-case for parse_names()
  t: add test for put_be16()
  t: move tests from reftable/record_test.c to the new unit test
  t: move tests from reftable/stack_test.c to the new unit test
  t: move reftable/basics_test.c to the unit testing framework
</content>
</entry>
<entry>
<title>reftable: cast away constness when assigning constants to records</title>
<updated>2024-06-07T17:30:49Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-06-07T06:37:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=66f892bb075f19bed784b86c7850a89c9a865aca'/>
<id>urn:sha1:66f892bb075f19bed784b86c7850a89c9a865aca</id>
<content type='text'>
The reftable records are used in multiple ways throughout the reftable
library. In many of those cases they merely act as input to a function
without getting modified by it at all. Most importantly, this happens
when writing records and when querying for records.

We rely on this in our tests and thus assign string constants to those
fields, which is about to generate warnings as those fields are of type
`char *`. While we could go through the process and instead allocate
those strings in all of our tests, this feels quite unnecessary.

Instead, add casts to `char *` for all of those strings. As this is part
of our tests, this also nicely serves as a demonstration that nothing
writes or frees those string constants, which would otherwise lead to
segfaults.

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>global: improve const correctness when assigning string constants</title>
<updated>2024-06-07T17:30:48Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-06-07T06:37:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b567004b4b43f9b0d88aa1f0b15698eae8f15836'/>
<id>urn:sha1:b567004b4b43f9b0d88aa1f0b15698eae8f15836</id>
<content type='text'>
We're about to enable `-Wwrite-strings`, which changes the type of
string constants to `const char[]`. Fix various sites where we assign
such constants to non-const variables.

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>t: move tests from reftable/stack_test.c to the new unit test</title>
<updated>2024-05-30T14:30:10Z</updated>
<author>
<name>Chandra Pratap</name>
<email>chandrapratap3519@gmail.com</email>
</author>
<published>2024-05-29T16:59:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f74e1865fe3fd0de573da03ecd0b9efdcb95c672'/>
<id>urn:sha1:f74e1865fe3fd0de573da03ecd0b9efdcb95c672</id>
<content type='text'>
parse_names() and names_equal() are functions defined in
reftable/basics.{c, h}. Move the tests for these functions from
reftable/stack_test.c to the newly ported test.

Mentored-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Chandra Pratap &lt;chandrapratap3519@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable: make the compaction factor configurable</title>
<updated>2024-05-14T00:02:39Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-05-13T08:18:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f663d34306d414bca27cf6b5dc7affb00e8603fe'/>
<id>urn:sha1:f663d34306d414bca27cf6b5dc7affb00e8603fe</id>
<content type='text'>
When auto-compacting, the reftable library packs references such that
the sizes of the tables form a geometric sequence. The factor for this
geometric sequence is hardcoded to 2 right now. We're about to expose
this as a config option though, so let's expose the factor via write
options.

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: pass opts as constant pointer</title>
<updated>2024-05-14T00:02:38Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-05-13T08:17:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=799237852bd265feb1e1a8d4a19780e20991b4fd'/>
<id>urn:sha1:799237852bd265feb1e1a8d4a19780e20991b4fd</id>
<content type='text'>
We sometimes pass the refatble write options as value and sometimes as a
pointer. This is quite confusing and makes the reader wonder whether the
options get modified sometimes.

In fact, `reftable_new_writer()` does cause the caller-provided options
to get updated when some values aren't set up. This is quite unexpected,
but didn't cause any harm until now.

Adapt the code so that we do not modify the caller-provided values
anymore. While at it, refactor the code to code to consistently pass the
options as a constant pointer to clarify that the caller-provided opts
will not ever get modified.

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: consistently refer to `reftable_write_options` as `opts`</title>
<updated>2024-05-14T00:02:37Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-05-13T08:17:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4d35bb2abaeff3965024b0f1599641641bcb17a6'/>
<id>urn:sha1:4d35bb2abaeff3965024b0f1599641641bcb17a6</id>
<content type='text'>
Throughout the reftable library the `reftable_write_options` are
sometimes referred to as `cfg` and sometimes as `opts`. Unify these to
consistently use `opts` to avoid confusion.

While at it, touch up the coding style a bit by removing unneeded braces
around one-line statements and newlines between variable declarations.

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/reftable-write-optim'</title>
<updated>2024-05-08T17:18:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-05-08T17:18:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5aec7231c8daabeca7cb2d3caa0ed0f88223f81e'/>
<id>urn:sha1:5aec7231c8daabeca7cb2d3caa0ed0f88223f81e</id>
<content type='text'>
Code to write out reftable has seen some optimization and
simplification.

* ps/reftable-write-optim:
  reftable/block: reuse compressed array
  reftable/block: reuse zstream when writing log blocks
  reftable/writer: reset `last_key` instead of releasing it
  reftable/writer: unify releasing memory
  reftable/writer: refactorings for `writer_flush_nonempty_block()`
  reftable/writer: refactorings for `writer_add_record()`
  refs/reftable: don't recompute committer ident
  reftable: remove name checks
  refs/reftable: skip duplicate name checks
  refs/reftable: perform explicit D/F check when writing symrefs
  refs/reftable: fix D/F conflict error message on ref copy
</content>
</entry>
<entry>
<title>Merge branch 'jt/reftable-geometric-compaction'</title>
<updated>2024-04-16T21:50:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-04-16T21:50:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=82a31ec32441cd06daa5e0397a73f4159cdaad4b'/>
<id>urn:sha1:82a31ec32441cd06daa5e0397a73f4159cdaad4b</id>
<content type='text'>
The strategy to compact multiple tables of reftables after many
operations accumulate many entries has been improved to avoid
accumulating too many tables uncollected.

* jt/reftable-geometric-compaction:
  reftable/stack: use geometric table compaction
  reftable/stack: add env to disable autocompaction
  reftable/stack: expose option to disable auto-compaction
</content>
</entry>
</feed>
