Re: [PATCH v6 0/5] Reftable support git-core
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 19, 2020, 18:10 UTC
- Message-ID
- <xmqq8skyfnxm.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CAOw_e7ZztSCzpmaCYg2c1iaZLWSsYz4dYegT0V0dHVaDy8A_uQ@mail.gmail.com>
Han-Wen Nienhuys <hanwenn@gmail.com> writes:
Show 10 quoted lines
> On Wed, Feb 19, 2020 at 6:02 PM Junio C Hamano <gitster@pobox.com> wrote: > >> > your checker is tripping over code imported from zlib. I added a /* >> > clang-format off */ comment to avoid reformatting this code. What do >> > you suggest? >> >> Use zlib from the system instead? > > uncompress2 is a 2016 addition to zlib. It doesn't pass on > gitgitgadget's CI, because it is using an older version of zlib.
Ahh.
It is OK (and indeed you're right that you cannot avoid it) to ship a reasonably new snapshot as a fallback in such a case, but it still is far more preferrable to avoid linking with the fallback snapshot copy when a working one is available on the system, especially for a widely used and established library like zlib, because we have one less thing to keep up-to-date with the security patches made to the upstream.
In any case, if we cannot avoid shipping a borrowed code that we'd rather not touch or fix-up, covering them with local .gitattributes file, disabling selected whitespace checks, may be one way out. IIUC, our default settings for the whitespace check is in the top-level .gitattributes file
* whitespace=!indent,trail,space
*.[ch] whitespace=indent,trail,space diff=cpp
*.sh whitespace=indent,trail,space eol=lfA new local .gitattrubutes file in retable/ directory to loosen the set of checks. The borrowed code triggers indent-with-non-tab and trailing-space at least, which needs to be disabled locally, I think.
Thanks.
reftable/.gitattributes | 1 + 1 file changed, 1 insertion(+)
diff --git a/reftable/.gitattributes b/reftable/.gitattributes new file mode 100644 index 0000000000..f44451a379 --- /dev/null +++ b/reftable/.gitattributes @@ -0,0 +1 @@ +/zlib-compat.c whitespace=-indent-with-non-tab,-trailing-space