<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/reftable, branch v2.36.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.36.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.36.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-03-28T20:58:10Z</updated>
<entry>
<title>reftable: make assignments portable to AIX xlc v12.01</title>
<updated>2022-03-28T20:58:10Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-03-28T19:10:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=33665d98e6bff90896ec5b9f8e8f1223b780a4d1'/>
<id>urn:sha1:33665d98e6bff90896ec5b9f8e8f1223b780a4d1</id>
<content type='text'>
Change the assignment syntax introduced in 66c0dabab5e (reftable: make
reftable_record a tagged union, 2022-01-20) to be portable to AIX xlc
v12.1:

    avar@gcc111:[/home/avar]xlc -qversion
    IBM XL C/C++ for AIX, V12.1 (5765-J02, 5725-C72)
    Version: 12.01.0000.0000

The error emitted before this was e.g.:

    "reftable/generic.c", line 133.26: 1506-196 (S) Initialization
    between types "char*" and "struct reftable_ref_record" is not
    allowed.

The syntax in the pre-image is supported by e.g. xlc 13.01 on a newer
AIX version:

    avar@gcc119:[/home/avar]xlc -qversion
    IBM XL C/C++ for AIX, V13.1.3 (5725-C72, 5765-J07)
    Version: 13.01.0003.0006

But as we've otherwise supported this compiler let's not break it
entirely if it's easy to work around it.

Suggested-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable: rename writer_stats to reftable_writer_stats</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:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=73a4c188b77acbfdf25641e2bb4d1600c45338ec'/>
<id>urn:sha1:73a4c188b77acbfdf25641e2bb4d1600c45338ec</id>
<content type='text'>
This function is part of the reftable API, so it should use the
reftable_ prefix

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable: add test for length of disambiguating prefix</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:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3c443a02a9f98227fa5c22935d88bcf68cfeaeec'/>
<id>urn:sha1:3c443a02a9f98227fa5c22935d88bcf68cfeaeec</id>
<content type='text'>
The ID =&gt; ref map is trimming object IDs to a disambiguating prefix.
Check that we are computing their length correctly.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable: ensure that obj_id_len is &gt;= 2 on writing</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:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b4007fcc6fe04deeeb3cdf7b018413f65c9de6e8'/>
<id>urn:sha1:b4007fcc6fe04deeeb3cdf7b018413f65c9de6e8</id>
<content type='text'>
When writing the same hash many times, we might decide to use a
length-1 object ID prefix for the ObjectID =&gt; ref table, which is out
of spec.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable: avoid writing empty keys at the block layer</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:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=45c2fcc2a0659e42c7e4f21f0b97393df261ca51'/>
<id>urn:sha1:45c2fcc2a0659e42c7e4f21f0b97393df261ca51</id>
<content type='text'>
The public interface (reftable_writer) already ensures that keys are
written in strictly increasing order, and an empty key by definition
fails this check.

However, by also enforcing this at the block layer, it is easier to
verify that records (which are written into blocks) never have to
consider the possibility of empty keys.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable: add a test that verifies that writing empty keys fails</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:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=140765911050d62a23503972ef6513ef18252ad3'/>
<id>urn:sha1:140765911050d62a23503972ef6513ef18252ad3</id>
<content type='text'>
Empty keys can only be written as ref records with empty names. The
log record has a logical timestamp in the key, so the key is never
empty.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&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>
<entry>
<title>Merge branch 'ab/auto-detect-zlib-compress2'</title>
<updated>2022-02-16T23:14:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-16T23:14:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=00e38ba6d801143a10f762d781e3e885243caa42'/>
<id>urn:sha1:00e38ba6d801143a10f762d781e3e885243caa42</id>
<content type='text'>
The build procedure has been taught to notice older version of zlib
and enable our replacement uncompress2() automatically.

* ab/auto-detect-zlib-compress2:
  compat: auto-detect if zlib has uncompress2()
</content>
</entry>
<entry>
<title>Merge branch 'hn/reftable-coverity-fixes'</title>
<updated>2022-02-16T23:14:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-16T23:14:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=34230514b83f55ea0f4531e8486533ac5c3e2ffe'/>
<id>urn:sha1:34230514b83f55ea0f4531e8486533ac5c3e2ffe</id>
<content type='text'>
Problems identified by Coverity in the reftable code have been
corrected.

* hn/reftable-coverity-fixes:
  reftable: add print functions to the record types
  reftable: make reftable_record a tagged union
  reftable: remove outdated file reftable.c
  reftable: implement record equality generically
  reftable: make reftable-record.h function signatures const correct
  reftable: handle null refnames in reftable_ref_record_equal
  reftable: drop stray printf in readwrite_test
  reftable: order unittests by complexity
  reftable: all xxx_free() functions accept NULL arguments
  reftable: fix resource warning
  reftable: ignore remove() return value in stack_test.c
  reftable: check reftable_stack_auto_compact() return value
  reftable: fix resource leak blocksource.c
  reftable: fix resource leak in block.c error path
  reftable: fix OOB stack write in print functions
</content>
</entry>
<entry>
<title>compat: auto-detect if zlib has uncompress2()</title>
<updated>2022-01-26T17:05:55Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-01-24T18:27:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=07564773c2569d012719ab9e26b9b27251f3d354'/>
<id>urn:sha1:07564773c2569d012719ab9e26b9b27251f3d354</id>
<content type='text'>
We have a copy of uncompress2() implementation in compat/ so that we
can build with an older version of zlib that lack the function, and
the build procedure selects if it is used via the NO_UNCOMPRESS2
$(MAKE) variable.  This is yet another "annoying" knob the porters
need to tweak on platforms that are not common enough to have the
default set in the config.mak.uname file.

Attempt to instead ask the system header &lt;zlib.h&gt; to decide if we
need the compatibility implementation.  This is a deviation from the
way we have been handling the "compatiblity" features so far, and if
it can be done cleanly enough, it could work as a model for features
that need compatibility definition we discover in the future.  With
that goal in mind, avoid expedient but ugly hacks, like shoving the
code that is conditionally compiled into an unrelated .c file, which
may not work in future cases---instead, take an approach that uses a
file that is independently compiled and stands on its own.

Compile and link compat/zlib-uncompress2.c file unconditionally, but
conditionally hide the implementation behind #if/#endif when zlib
version is 1.2.9 or newer, and unconditionally archive the resulting
object file in the libgit.a to be picked up by the linker.

There are a few things to note in the shape of the code base after
this change:

 - We no longer use NO_UNCOMPRESS2 knob; if the system header
   &lt;zlib.h&gt; claims a version that is more cent than the library
   actually is, this would break, but it is easy to add it back when
   we find such a system.

 - The object file compat/zlib-uncompress2.o is always compiled and
   archived in libgit.a, just like a few other compat/ object files
   already are.

 - The inclusion of &lt;zlib.h&gt; is done in &lt;git-compat-util.h&gt;; we used
   to do so from &lt;cache.h&gt; which includes &lt;git-compat-util.h&gt; as the
   first thing it does, so from the *.c codes, there is no practical
   change.

 - Until objects in libgit.a that is already used gains a reference
   to the function, the reftable code will be the only one that
   wants it, so libgit.a on the linker command line needs to appear
   once more at the end to satisify the mutual dependency.

 - Beat found a trick used by OpenSSL to avoid making the
   conditionally-compiled object truly empty (apparently because
   they had to deal with compilers that do not want to see an
   effectively empty input file).  Our compat/zlib-uncompress2.c
   file borrows the same trick for portabilty.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Helped-by: Beat Bolli &lt;dev+git@drbeat.li&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
