{"thread":{"id":"56201","subject":"[PATCH 1/3] fixup! Provide zlib's uncompress2 from compat/zlib-compat.c","startedAt":"2021-08-02T19:01:35Z","lastAt":"2021-08-16T01:16:09Z","messageCount":14,"participants":["Carlo Marcelo Arenas Belón","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"431745","messageId":"20210802190054.58282-2-carenas@gmail.com","threadId":"56201","inReplyTo":"20210802190054.58282-1-carenas@gmail.com","subject":"[PATCH 1/3] fixup! Provide zlib's uncompress2 from compat/zlib-compat.c","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2021-08-02T19:00:52Z","receivedAt":"2021-08-02T19:01:35Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"124b6e20ef (Provide zlib's uncompress2 from compat/zlib-compat.c,\n2021-07-20) adds a compatibility replacement function for uncompress2\nthat could be used for building with zlib < 1.2.9, but adds it to libgit.\n\nthis could result in link failures depending on the library order used\nby the link command as shown in (from the 32bit linux CI task for the seen\nbranch):\n\n  reftable/libreftable.a(block.o): In function `block_reader_init':\n  /__w/git/git/reftable/block.c:222: undefined reference to `uncompress2'\n  collect2: error: ld returned 1 exit status\n  Makefile:2649: recipe for target 'git-daemon' failed\n\nadd it instead to the libreftable library that is also the current user.\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 94ba729376..d1c2a8acc1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1760,7 +1760,7 @@ endif\n \n ifdef NO_UNCOMPRESS2\n \tBASIC_CFLAGS += -DNO_UNCOMPRESS2\n-\tLIB_OBJS += compat/zlib-uncompress2.o\n+\tREFTABLE_OBJS += compat/zlib-uncompress2.o\n endif\n \n ifdef NO_POSIX_GOODIES\n-- \n2.32.0.826.g286871f41a\n\n"},{"id":"431746","messageId":"20210802190054.58282-1-carenas@gmail.com","threadId":"56201","inReplyTo":null,"subject":"[PATCH 0/3] hn/reftable \"fixes\" for OpenBSD","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2021-08-02T19:00:51Z","receivedAt":"2021-08-02T19:01:36Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"While building \"seen\" in OpenBSD, noticed the following issues as part\nof reftable support.\n\nthe first patch also affected Linux and was indeed one of the two reasons\nfor the failed CI runs of that branch, hence why it might be worth\nsquashing into the corresponding commit as the subject implies.\n\nthe second patch might be worth squashing as well, but neither address\nthe segfault in t0031.14 which manifests as :\n\n  2d732e1 refs/heads/primary@{9}: commit (initial): number 1\n  ++ grep 'commit: number 10' output\n  357ed45 refs/heads/primary@{0}: commit: number 10\n  ++ git gc\n  error: reflog died of signal 11\n  fatal: failed to run reflog\n  error: last command exited with $?=128\n  not ok 14 - reflog, repack\n\nand that correspond to a call of `git reflog expire --all` with the\nfollowing backtrace :\n\n  #0  hashmap_entry_init (hash=<optimized out>, e=0xbfba1384) at hashmap.h:317\n  #1  hashmap_get_from_hash (keydata=0x0, hash=<optimized out>, map=0xa027208)\n      at hashmap.h:378\n  #2  oidmap_get (map=0xa027208, key=0x0) at oidmap.c:38\n  #3  0x08202dae in do_lookup_replace_object (r=0x83fc180 <the_repo>, oid=0x0)\n      at replace-object.c:76\n  #4  0x081b59d3 in lookup_replace_object (oid=0x0, r=0x83fc180 <the_repo>)\n      at replace-object.h:40\n  #5  parse_object (r=0x83fc180 <the_repo>, oid=0x0) at object.c:271\n  #6  0x08134e87 in lookup_commit_reference_gently (r=0x83fc180 <the_repo>,\n      oid=0x0, quiet=1) at commit.c:35\n  #7  0x080d6e39 in reflog_expiry_prepare (\n      refname=0xa026fb4 \"refs/heads/primary\", oid=0x0, cb_data=0xbfba161c)\n      at builtin/reflog.c:363\n  #8  0x081f9325 in git_reftable_reflog_expire (ref_store=0xa026c40,\n      refname=0xa026fb4 \"refs/heads/primary\", oid=0x0, flags=0,\n      prepare_fn=0x80d6c80 <reflog_expiry_prepare>,\n      should_prune_fn=0x80d72b0 <should_expire_reflog_ent>,\n      cleanup_fn=0x80d6990 <reflog_expiry_cleanup>, policy_cb_data=0xbfba161c)\n      at refs/reftable-backend.c:1511\n  #9  0x081ef820 in refs_reflog_expire (policy_cb_data=0xbfba161c,\n      cleanup_fn=0x80d6990 <reflog_expiry_cleanup>,\n      should_prune_fn=0x80d72b0 <should_expire_reflog_ent>,\n      prepare_fn=0x80d6c80 <reflog_expiry_prepare>, flags=0, oid=0x0,\n      refname=0xa026fb4 \"refs/heads/primary\", refs=<optimized out>)\n      at refs.c:2408\n  #10 reflog_expire (refname=0xa026fb4 \"refs/heads/primary\", oid=0x0, flags=0,\n      prepare_fn=0x80d6c80 <reflog_expiry_prepare>,\n      should_prune_fn=0x80d72b0 <should_expire_reflog_ent>,\n      cleanup_fn=0x80d6990 <reflog_expiry_cleanup>, policy_cb_data=0xbfba161c)\n      at refs.c:2420\n  #11 0x080d786f in cmd_reflog_expire (argc=<optimized out>,\n      argv=<optimized out>, prefix=<optimized out>) at builtin/reflog.c:634\n  #12 0x0804e9fb in run_builtin (argv=<optimized out>, argc=<optimized out>,\n      p=<optimized out>) at git.c:461\n  #13 handle_builtin (argc=3, argv=argv@entry=0xbfba2208) at git.c:716\n  #14 0x0804edcb in run_argv (argv=0xbfba1ffc, argcp=0xbfba20a0) at git.c:783\n  #15 cmd_main (argc=3, argv=0xbfba2204) at git.c:914\n  #16 0x0804d8dc in main (argc=4, argv=0xbfba2204) at common-main.c:52\n\nCarlo Marcelo Arenas Belón (3):\n  fixup! Provide zlib's uncompress2 from compat/zlib-compat.c\n  reftable: clarify zlib version dependency\n  openbsd: allow reftable building with zlib 1.2.3\n\n Makefile         | 2 +-\n config.mak.uname | 1 +\n reftable/block.c | 4 +++-\n 3 files changed, 5 insertions(+), 2 deletions(-)\n\n-- \n2.32.0.826.g286871f41a\n"},{"id":"431747","messageId":"20210802190054.58282-3-carenas@gmail.com","threadId":"56201","inReplyTo":"20210802190054.58282-1-carenas@gmail.com","subject":"[PATCH 2/3] reftable: clarify zlib version dependency","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2021-08-02T19:00:53Z","receivedAt":"2021-08-02T19:01:37Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"3541411189 (reftable: reading/writing blocks, 2021-07-20) add a comment\nexplaining that a newer zlib version is required but being a little vague\nabout the specifics\n\nmake sure the zlib version is mentioned to aid on deciding to enable or\nnot the NO_UNCOMPRESS2 compatibility layer\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\nSquashing this as part of a reroll of hn/reftable might be preferable\n\n reftable/block.c | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/reftable/block.c b/reftable/block.c\nindex 92f8e5abfa..eb5268dd3a 100644\n--- a/reftable/block.c\n+++ b/reftable/block.c\n@@ -16,7 +16,9 @@ license that can be found in the LICENSE file or at\n #include <zlib.h>\n \n #ifdef NO_UNCOMPRESS2\n-/* This is uncompress2, which is only available in zlib as of 2017.\n+/*\n+ * This is uncompress2, which is only available in zlib >= 1.2.9\n+ * (released as of early 2017)\n  */\n int uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source,\n \t\tuLong *sourceLen);\n-- \n2.32.0.826.g286871f41a\n\n"},{"id":"431748","messageId":"20210802190054.58282-4-carenas@gmail.com","threadId":"56201","inReplyTo":"20210802190054.58282-1-carenas@gmail.com","subject":"[PATCH 3/3] openbsd: allow reftable building with zlib 1.2.3","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2021-08-02T19:00:54Z","receivedAt":"2021-08-02T19:01:39Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"all released versions of OpenBSD (up to 6.9) include an older than 1.2.9\nversion of zlib in base.\n\nenable the compat uncompress2 function until is no longer needed (likely\nat least until the next 2 future releases are not yet EOL)\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\n config.mak.uname | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/config.mak.uname b/config.mak.uname\nindex 59726d6538..074dc2324e 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -260,6 +260,7 @@ ifeq ($(uname_S),FreeBSD)\n \tFILENO_IS_A_MACRO = UnfortunatelyYes\n endif\n ifeq ($(uname_S),OpenBSD)\n+\tNO_UNCOMPRESS2 = YesPlease\n \tNO_STRCASESTR = YesPlease\n \tNO_MEMMEM = YesPlease\n \tUSE_ST_TIMESPEC = YesPlease\n-- \n2.32.0.826.g286871f41a\n\n"},{"id":"431940","messageId":"20210804064434.42236-1-carenas@gmail.com","threadId":"56201","inReplyTo":"20210802190054.58282-1-carenas@gmail.com","subject":"[PATCH 4/3] fixup! reftable: add dump utility","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2021-08-04T06:44:34Z","receivedAt":"2021-08-04T06:45:08Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"avoid _XOPEN_SOURCE in alpine by making sure git-compat-util.h is included\nfirst (through hash.h) as recommended and therefore avoid:\n\n  In file included from ./hash.h:4,\n                   from reftable/dump.c:19:\n  ./git-compat-util.h:147: warning: \"_XOPEN_SOURCE\" redefined\n    147 | #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n        |\n  In file included from /usr/include/unistd.h:8,\n                   from reftable/reftable-writer.h:15,\n                   from reftable/dump.c:14:\n  /usr/include/features.h:16: note: this is the location of the previous definition\n     16 | #define _XOPEN_SOURCE 700\n        |\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\nThis allows for the alpine CI job to build, but will still fail with the\nreported segfault in the subcommand for `git reflog`.\n\nIt is important to note that it only happens in \"seen\" though, as the same\ncode merged to master pass that test (even if it might fail somewhere else)\n\n reftable/dump.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/reftable/dump.c b/reftable/dump.c\nindex 668cfa8996..eb7b2b4161 100644\n--- a/reftable/dump.c\n+++ b/reftable/dump.c\n@@ -6,6 +6,7 @@ license that can be found in the LICENSE file or at\n https://developers.google.com/open-source/licenses/bsd\n */\n \n+#include \"hash.h\"\n #include \"reftable-blocksource.h\"\n #include \"reftable-error.h\"\n #include \"reftable-merged.h\"\n@@ -16,7 +17,6 @@ license that can be found in the LICENSE file or at\n #include \"reftable-reader.h\"\n #include \"reftable-stack.h\"\n #include \"reftable-generic.h\"\n-#include \"hash.h\"\n \n #include <stddef.h>\n #include <stdio.h>\n-- \n2.33.0.rc0.443.g98cc19b6c0\n\n"},{"id":"431965","messageId":"xmqq35rpqg27.fsf@gitster.g","threadId":"56201","inReplyTo":"20210804064434.42236-1-carenas@gmail.com","subject":"Re: [PATCH 4/3] fixup! reftable: add dump utility","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-08-04T17:24:00Z","receivedAt":"2021-08-04T17:24:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carlo Marcelo Arenas Belón  <carenas@gmail.com> writes:\n\n> avoid _XOPEN_SOURCE in alpine by making sure git-compat-util.h is included\n> first (through hash.h) as recommended and therefore avoid:\n\nThe headers cache.h and builtin.h are the only ones whose inclusion\nallows the source to omit an explicit inclusion of git-compat-util.h\nand we'd prefer the inclusion of git-compat-util.h to be explicit\nhere, not through hash.h.  Just including git-compat-util.h directly\nwithout moving inclusion of hash.h should be sufficient.\n\n\ndiff --git a/reftable/dump.c b/reftable/dump.c\nindex 668cfa8996..eb7b2b4161 100644\n--- a/reftable/dump.c\n+++ b/reftable/dump.c\n@@ -6,6 +6,7 @@ license that can be found in the LICENSE file or at\n https://developers.google.com/open-source/licenses/bsd\n */\n \n+#include \"git-compat-util.h\"\n #include \"reftable-blocksource.h\"\n #include \"reftable-error.h\"\n #include \"reftable-merged.h\"\n"},{"id":"432774","messageId":"20210816011538.34199-1-carenas@gmail.com","threadId":"56201","inReplyTo":"20210802190054.58282-1-carenas@gmail.com","subject":"[PATCH v2 0/7] hn/reftable \"fixes\" for BSD","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2021-08-16T01:15:31Z","receivedAt":"2021-08-16T01:15:54Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"A few issues I noticed while buiding \"seen\" in some BSD systems.\n\nPatches 1-3 aren't changed from v1, and 4 had the fixes suggested by\nJunio[1] added.\n\nPatch 5 affects an EOL NetBSD 7.2 system and therefore might be dropped\nbut I thought it was safe/generic enough and might become useful in\nother old systems as well.\n\nThe last 2 patches are a well known recurring issue, that even prompted\na explicit documentation update in cc0c42975a (CodingGuidelines: spell\nout post-C89 rules, 2019-07-16).\n\nAll these patches are expected to be applied on top of hn/reftable and\nhopefully absorved and discarded.\n\nCarlo Marcelo Arenas Belón (7):\n  fixup! Provide zlib's uncompress2 from compat/zlib-compat.c\n  reftable: clarify zlib version dependency\n  openbsd: allow reftable building with zlib 1.2.3\n  fixup! reftable: add dump utility\n  fixup! Provide zlib's uncompress2 from compat/zlib-compat.c\n  fixup! reftable: reftable file level tests\n  fixup! reftable: (de)serialization for the polymorphic record type\n\n Makefile                  | 2 +-\n compat/zlib-uncompress2.c | 3 +++\n config.mak.uname          | 1 +\n reftable/block.c          | 4 +++-\n reftable/dump.c           | 1 +\n reftable/readwrite_test.c | 4 ++--\n reftable/record_test.c    | 4 +++-\n 7 files changed, 14 insertions(+), 5 deletions(-)\n\n[1] https://lore.kernel.org/git/xmqq35rpqg27.fsf@gitster.g/\n-- \n2.33.0.rc2.476.g1b09a32a73\n\n"},{"id":"432775","messageId":"20210816011538.34199-2-carenas@gmail.com","threadId":"56201","inReplyTo":"20210816011538.34199-1-carenas@gmail.com","subject":"[PATCH v2 1/7] fixup! Provide zlib's uncompress2 from compat/zlib-compat.c","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2021-08-16T01:15:32Z","receivedAt":"2021-08-16T01:15:56Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"124b6e20ef (Provide zlib's uncompress2 from compat/zlib-compat.c,\n2021-07-20) adds a compatibility replacement function for uncompress2\nthat could be used for building with zlib < 1.2.9, but adds it to libgit.\n\nthis could result in link failures depending on the library order used\nby the link command as shown in (from the 32bit linux CI task for the seen\nbranch):\n\n  reftable/libreftable.a(block.o): In function `block_reader_init':\n  /__w/git/git/reftable/block.c:222: undefined reference to `uncompress2'\n  collect2: error: ld returned 1 exit status\n  Makefile:2649: recipe for target 'git-daemon' failed\n\nadd it instead to the libreftable library that is also the current user.\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 6014f74a1b..b4f5cc6fc0 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1739,7 +1739,7 @@ endif\n \n ifdef NO_UNCOMPRESS2\n \tBASIC_CFLAGS += -DNO_UNCOMPRESS2\n-\tLIB_OBJS += compat/zlib-uncompress2.o\n+\tREFTABLE_OBJS += compat/zlib-uncompress2.o\n endif\n \n ifdef NO_POSIX_GOODIES\n-- \n2.33.0.rc2.476.g1b09a32a73\n\n"},{"id":"432776","messageId":"20210816011538.34199-3-carenas@gmail.com","threadId":"56201","inReplyTo":"20210816011538.34199-1-carenas@gmail.com","subject":"[PATCH v2 2/7] reftable: clarify zlib version dependency","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2021-08-16T01:15:33Z","receivedAt":"2021-08-16T01:15:58Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"3541411189 (reftable: reading/writing blocks, 2021-07-20) add a comment\nexplaining that a newer zlib version is required but being a little vague\nabout the specifics\n\nmake sure the zlib version is mentioned to aid on deciding to enable or\nnot the NO_UNCOMPRESS2 compatibility layer\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n reftable/block.c | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/reftable/block.c b/reftable/block.c\nindex 92f8e5abfa..eb5268dd3a 100644\n--- a/reftable/block.c\n+++ b/reftable/block.c\n@@ -16,7 +16,9 @@ license that can be found in the LICENSE file or at\n #include <zlib.h>\n \n #ifdef NO_UNCOMPRESS2\n-/* This is uncompress2, which is only available in zlib as of 2017.\n+/*\n+ * This is uncompress2, which is only available in zlib >= 1.2.9\n+ * (released as of early 2017)\n  */\n int uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source,\n \t\tuLong *sourceLen);\n-- \n2.33.0.rc2.476.g1b09a32a73\n\n"},{"id":"432777","messageId":"20210816011538.34199-4-carenas@gmail.com","threadId":"56201","inReplyTo":"20210816011538.34199-1-carenas@gmail.com","subject":"[PATCH v2 3/7] openbsd: allow reftable building with zlib 1.2.3","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2021-08-16T01:15:34Z","receivedAt":"2021-08-16T01:16:00Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"all released versions of OpenBSD (up to 6.9) include an older than 1.2.9\nversion of zlib in base.\n\nenable the compat uncompress2 function until is no longer needed (likely\nat least until the next 2 future releases are not yet EOL)\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n config.mak.uname | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/config.mak.uname b/config.mak.uname\nindex a2b156e338..019c88d5df 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -256,6 +256,7 @@ ifeq ($(uname_S),FreeBSD)\n \tFILENO_IS_A_MACRO = UnfortunatelyYes\n endif\n ifeq ($(uname_S),OpenBSD)\n+\tNO_UNCOMPRESS2 = YesPlease\n \tNO_STRCASESTR = YesPlease\n \tNO_MEMMEM = YesPlease\n \tUSE_ST_TIMESPEC = YesPlease\n-- \n2.33.0.rc2.476.g1b09a32a73\n\n"},{"id":"432778","messageId":"20210816011538.34199-5-carenas@gmail.com","threadId":"56201","inReplyTo":"20210816011538.34199-1-carenas@gmail.com","subject":"[PATCH v2 4/7] fixup! reftable: add dump utility","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2021-08-16T01:15:35Z","receivedAt":"2021-08-16T01:16:04Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"avoid _XOPEN_SOURCE redefinition in alpine by making sure git-compat-util.h\nis included first (as recommended in CodingGuidelines) and therefore avoid:\n\n  In file included from ./hash.h:4,\n                   from reftable/dump.c:19:\n  ./git-compat-util.h:147: warning: \"_XOPEN_SOURCE\" redefined\n    147 | #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n        |\n  In file included from /usr/include/unistd.h:8,\n                   from reftable/reftable-writer.h:15,\n                   from reftable/dump.c:14:\n  /usr/include/features.h:16: note: this is the location of the previous definition\n     16 | #define _XOPEN_SOURCE 700\n        |\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\nUsing code contributed by Junio and only reusing the commit from my original\n\n reftable/dump.c | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/reftable/dump.c b/reftable/dump.c\nindex 668cfa8996..ef017701b6 100644\n--- a/reftable/dump.c\n+++ b/reftable/dump.c\n@@ -6,6 +6,7 @@ license that can be found in the LICENSE file or at\n https://developers.google.com/open-source/licenses/bsd\n */\n \n+#include \"git-compat-util.h\"\n #include \"reftable-blocksource.h\"\n #include \"reftable-error.h\"\n #include \"reftable-merged.h\"\n-- \n2.33.0.rc2.476.g1b09a32a73\n\n"},{"id":"432779","messageId":"20210816011538.34199-6-carenas@gmail.com","threadId":"56201","inReplyTo":"20210816011538.34199-1-carenas@gmail.com","subject":"[PATCH v2 5/7] fixup! Provide zlib's uncompress2 from compat/zlib-compat.c","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2021-08-16T01:15:36Z","receivedAt":"2021-08-16T01:16:04Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"the code imported from zlib 1.2.11 uses an optional feature from 1.2.5.2\nthat could cause compilation errors with older versions.\n\nmake sure it is defined and disabled in those cases to avoid\nbuilding failures.\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\n compat/zlib-uncompress2.c | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/compat/zlib-uncompress2.c b/compat/zlib-uncompress2.c\nindex 23b72b49c4..f49f680567 100644\n--- a/compat/zlib-uncompress2.c\n+++ b/compat/zlib-uncompress2.c\n@@ -14,6 +14,9 @@\n  */\n \n #include <zlib.h>\n+#ifndef z_const\n+#define z_const\n+#endif\n \n /* clang-format off */\n \n-- \n2.33.0.rc2.476.g1b09a32a73\n\n"},{"id":"432780","messageId":"20210816011538.34199-7-carenas@gmail.com","threadId":"56201","inReplyTo":"20210816011538.34199-1-carenas@gmail.com","subject":"[PATCH v2 6/7] fixup! reftable: reftable file level tests","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2021-08-16T01:15:37Z","receivedAt":"2021-08-16T01:16:07Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"C99 style loop initializers still problematic with gnu89 C in older\ncompilers.\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\n reftable/readwrite_test.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/reftable/readwrite_test.c b/reftable/readwrite_test.c\nindex 42ca48f83c..146b00cb02 100644\n--- a/reftable/readwrite_test.c\n+++ b/reftable/readwrite_test.c\n@@ -120,7 +120,7 @@ static void test_log_buffer_size(void)\n \tstruct reftable_write_options opts = {\n \t\t.block_size = 4096,\n \t};\n-\tint err;\n+\tint err, i;\n \tstruct reftable_log_record log = { .refname = \"refs/heads/master\",\n \t\t\t\t\t   .update_index = 0xa,\n \t\t\t\t\t   .value_type = REFTABLE_LOG_UPDATE,\n@@ -138,7 +138,7 @@ static void test_log_buffer_size(void)\n \t   hash, to ensure that the compressed part is larger than the original.\n \t*/\n \tuint8_t hash1[GIT_SHA1_RAWSZ], hash2[GIT_SHA1_RAWSZ];\n-\tfor (int i = 0; i < GIT_SHA1_RAWSZ; i++) {\n+\tfor (i = 0; i < GIT_SHA1_RAWSZ; i++) {\n \t\thash1[i] = (uint8_t)(rand() % 256);\n \t\thash2[i] = (uint8_t)(rand() % 256);\n \t}\n-- \n2.33.0.rc2.476.g1b09a32a73\n\n"},{"id":"432781","messageId":"20210816011538.34199-8-carenas@gmail.com","threadId":"56201","inReplyTo":"20210816011538.34199-1-carenas@gmail.com","subject":"[PATCH v2 7/7] fixup! reftable: (de)serialization for the polymorphic record type","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2021-08-16T01:15:38Z","receivedAt":"2021-08-16T01:16:09Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\n reftable/record_test.c | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/reftable/record_test.c b/reftable/record_test.c\nindex bf5d072b20..519c0bbf18 100644\n--- a/reftable/record_test.c\n+++ b/reftable/record_test.c\n@@ -207,9 +207,11 @@ static void test_reftable_log_record_roundtrip(void)\n \t\t\t.value_type = REFTABLE_LOG_DELETION,\n \t\t}\n \t};\n+\tint i;\n+\n \tset_test_hash(in[0].update.new_hash, 1);\n \tset_test_hash(in[0].update.old_hash, 2);\n-\tfor (int i = 0; i < ARRAY_SIZE(in); i++) {\n+\tfor (i = 0; i < ARRAY_SIZE(in); i++) {\n \t\tstruct reftable_record rec = { NULL };\n \t\tstruct strbuf key = STRBUF_INIT;\n \t\tuint8_t buffer[1024] = { 0 };\n-- \n2.33.0.rc2.476.g1b09a32a73\n\n"}]}