[RFC PATCH 0/2] fallback to interpreter if JIT fails with pcre

2018-12-09 Thread Carlo Marcelo Arenas Belón
ures that will trigger the fallback, but the later is likely to need library changes which might not be possible with the old version anyway. [1] https://bugs.exim.org/show_bug.cgi?id=1749 Carlo Marcelo Arenas Belón (2): grep: fallback to interpreter if JIT fails with pcre1 grep: fallback to

[RFC PATCH 2/2] grep: fallback to interpreter if JIT fails with pcre2

2018-12-09 Thread Carlo Marcelo Arenas Belón
starting with 10.23, and as a side effect of the work for bug1749[1] (grep -P crash with seLinux), pcre2grep was modified to ignore any errors from pcre2_jit_compile so the interpreter could be used as a fallback [1] https://bugs.exim.org/show_bug.cgi?id=1749 Signed-off-by: Carlo Marcelo Arenas

[RFC PATCH 1/2] grep: fallback to interpreter if JIT fails with pcre1

2018-12-09 Thread Carlo Marcelo Arenas Belón
to the user. Signed-off-by: Carlo Marcelo Arenas Belón --- Makefile | 12 ++-- grep.c | 6 ++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 1a44c811aa..62b0cb6ee6 100644 --- a/Makefile +++ b/Makefile @@ -32,14 +32,14 @@ all

[PATCH] http-push: workaround for format overflow warning in gcc >= 9

2019-05-09 Thread Carlo Marcelo Arenas Belón
In function 'finish_request', inlined from 'process_response' at http-push.c:248:2: http-push.c:587:4: warning: '%s' directive argument is null [-Wformat-overflow=] 587 |fprintf(stderr, "Unable to get pack file %s\n%s", |^ 588 |

[PATCH v2] http-push: prevent format overflow warning with gcc >= 9

2019-05-14 Thread Carlo Marcelo Arenas Belón
se_request unconditionally at the end. Signed-off-by: Carlo Marcelo Arenas Belón Suggested-by: Eric Sunshine --- http-push.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-push.c b/http-push.c index f675a96316..e36561a6db 100644 --- a/http-push.c +++ b/http-push.c

[PATCH] fsmonitor: avoid signed integer overflow / infinite loop

2019-06-15 Thread Carlo Marcelo Arenas Belón
883e248b8a ("fsmonitor: teach git to optionally utilize a file system monitor to speed up detecting new or changed files.", 2017-09-22) uses an int in a loop that would wrap if index_state->cache_nr (unsigned) is bigger than INT_MAX Signed-off-by: Carlo Marcelo Arenas Belón --- fs

[PATCH] wrapper: avoid UB in macOS

2019-06-16 Thread Carlo Marcelo Arenas Belón
e cast to uint64_t so it also works in 32-bit platforms. Signed-off-by: Carlo Marcelo Arenas Belón --- wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrapper.c b/wrapper.c index ea3cf64d4c..1e45ab7b92 100644 --- a/wrapper.c +++ b/wrapper.c @@ -502,7 +502,7 @@ int g

[PATCH] xdiff: avoid accidental redefinition of LFS feature in OpenIndiana

2019-06-17 Thread Carlo Marcelo Arenas Belón
compat-util.h is the first header (through xinclude.h) Signed-off-by: Carlo Marcelo Arenas Belón --- xdiff/xutils.c | 4 1 file changed, 4 deletions(-) diff --git a/xdiff/xutils.c b/xdiff/xutils.c index 963e1c58b9..cfa6e2220f 100644 --- a/xdiff/xutils.c +++ b/xdiff/xutils.c @@ -20,13 +20,9 @@

[PATCH] trace2: correct typo in technical documentation

2019-06-26 Thread Carlo Marcelo Arenas Belón
Signed-off-by: Carlo Marcelo Arenas Belón --- Documentation/technical/api-trace2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/technical/api-trace2.txt b/Documentation/technical/api-trace2.txt index 23c3cc7a37..f7ffe7d599 100644 --- a/Documentation/technical/

[PATCH] grep: skip UTF8 checks explicitally

2019-07-21 Thread Carlo Marcelo Arenas Belón
abort when hitting the first binary blob in a fixed match after ed0479ce3d ("Merge branch 'ab/no-kwset' into next", 2019-07-15) Signed-off-by: Carlo Marcelo Arenas Belón --- grep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grep.c b/grep.c index fc

[PATCH] grep: use custom JIT stack with pcre2

2019-07-21 Thread Carlo Marcelo Arenas Belón
94da9193a6 ("grep: add support for PCRE v2", 2017-06-01) allocate a stack and assign it to a match context, but never pass it to pcre2_jit_match, using instead the default. Signed-off-by: Carlo Marcelo Arenas Belón --- This might have positive performance consequences (per the com

[PATCH] grep: skip UTF8 checks explicitly

2019-07-22 Thread Carlo Marcelo Arenas Belón
abort when hitting the first binary blob in a fixed match after ed0479ce3d ("Merge branch 'ab/no-kwset' into next", 2019-07-15) Reviewed-by: Johannes Schindelin Signed-off-by: Carlo Marcelo Arenas Belón --- V2: spelling fixes from Eric Sunshine grep.c | 4 ++-- 1 file c

[RFC PATCH 0/2] PCRE1 cleanup

2019-07-26 Thread Carlo Marcelo Arenas Belón
Sent as an RFC since it was meant to be applied against ab/pcre-jit-fixes but that is likely to change with the reroll of that branch. [PATCH 1/2] grep: make sure NO_LIBPCRE1_JIT disable JIT in PCRE1 [PATCH 2/2] grep: refactor and simplify PCRE1 support The end result could be squashed together

[RFC PATCH 2/2] grep: refactor and simplify PCRE1 support

2019-07-26 Thread Carlo Marcelo Arenas Belón
pcre_study with the right parameter after JIT support has been confirmed and unless it was requested to be disabled with NO_LIBPCRE1_JIT Signed-off-by: Carlo Marcelo Arenas Belón --- grep.c | 15 +-- grep.h | 9 - 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a

[RFC PATCH 1/2] grep: make sure NO_LIBPCRE1_JIT disable JIT in PCRE1

2019-07-26 Thread Carlo Marcelo Arenas Belón
d reliably to enforce JIT doesn't get used. Signed-off-by: Carlo Marcelo Arenas Belón --- Makefile | 9 ++--- grep.h | 4 +--- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 11ccea4071..7e0e6cc129 100644 --- a/Makefile +++ b/Makefile @@ -

[PATCH 1/3] grep: make pcre1_tables version agnostic

2019-07-27 Thread Carlo Marcelo Arenas Belón
t unsigned char* vs const uint8_t*) to be shared. Revert that change, as 94da9193a6 ("grep: add support for PCRE v2", 2017-06-01) failed to create an equivalent PCRE2 version. Signed-off-by: Carlo Marcelo Arenas Belón --- grep.c | 6 +++--- grep.h | 2 +- 2 files changed, 4 insertions(+

[PATCH 2/3] grep: use pcre_tables also for PCRE2

2019-07-27 Thread Carlo Marcelo Arenas Belón
red by all functions. Signed-off-by: Carlo Marcelo Arenas Belón --- grep.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/grep.c b/grep.c index cc65f7a987..d04635fad4 100644 --- a/grep.c +++ b/grep.c @@ -488,7 +488,6 @@ static void compile_pcre2_pattern(struct grep_pat *p, con

[PATCH 3/3] grep: plug leak of pcre chartables in PCRE2

2019-07-27 Thread Carlo Marcelo Arenas Belón
Just as it is done with PCRE1, make sure that the allocated chartables get free at cleanup time. This assumes no global context is used (NULL passed when created the tables), but will likely be updated in tandem if that ever changes. Signed-off-by: Carlo Marcelo Arenas Belón --- grep.c | 1

[PATCH 0/3] grep: memory leak in PCRE2

2019-07-27 Thread Carlo Marcelo Arenas Belón
codebase (ex: ab/pcre-jit-fixes) but hopefully the spreading on short simple commits helps with reviewing. Carlo Marcelo Arenas Belón (3): grep: make pcre1_tables version agnostic grep: use pcre_tables also for PCRE2 grep: plug leak of pcre chartables in PCRE2 grep.c | 12

[PATCH v2 2/5] wt-status.h: drop stdio.h include

2019-07-28 Thread Carlo Marcelo Arenas Belón
From: Jeff King We started including stdio.h to pick up the declaration of "FILE" in f26a001226 (Enable wt-status output to a given FILE pointer., 2007-09-17). But there's no need, since headers can assume that git-compat-util.h has been included, which covers stdio. This should just be redundan

[PATCH v2 1/5] verify-tag: drop signal.h include

2019-07-28 Thread Carlo Marcelo Arenas Belón
From: Jeff King There's no reason verify-tag.c needs to include signal.h. It's already in git-compat-util.h, which we properly include as the first header. And there doesn't seem to be a particular reason for this include; it's just an artifact from the file creation in 2ae68fcb78 (Make verify-ta

[PATCH v2 4/5] xdiff: remove duplicate headers from xhistogram.c

2019-07-28 Thread Carlo Marcelo Arenas Belón
8c912eea94 ("teach --histogram to diff", 2011-07-12) included them, but were already part of xinclude.h Signed-off-by: Carlo Marcelo Arenas Belón --- xdiff/xhistogram.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/xdiff/xhistogram.c b/xdiff/xhistogram.c index ec85f5992b..

[PATCH v2 5/5] xdiff: remove duplicate headers from xpatience.c

2019-07-28 Thread Carlo Marcelo Arenas Belón
92b7de93fb (Implement the patience diff algorithm, 2009-01-07) added them but were already part of xinclude.h Signed-off-by: Carlo Marcelo Arenas Belón --- xdiff/xpatience.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/xdiff/xpatience.c b/xdiff/xpatience.c index f3573d9f00..3c5601b602

[PATCH v2 0/5] system header cleanup

2019-07-28 Thread Carlo Marcelo Arenas Belón
stems (except for the 3rd one) and that has since shown to also be needed in Alpine Linux (because of _XOPEN_SOURCE redefinition). The last 2 patches are new to the series and just cleanup the dependency list in xdiff. Carlo Marcelo Arenas Belón (3): xdiff: drop system includes in xutils.c

[PATCH v2 3/5] xdiff: drop system includes in xutils.c

2019-07-28 Thread Carlo Marcelo Arenas Belón
e_tests.h:231:0: note: this is the location of the previous definition #define _FILE_OFFSET_BITS 32 Make sure git-compat-util.h is the first header (through xinclude.h) Signed-off-by: Carlo Marcelo Arenas Belón Signed-off-by: Junio C Hamano --- V2: reword commit with feedback from Johannes x

[RFC PATCH] grep: allow for run time disabling of JIT in PCRE

2019-07-28 Thread Carlo Marcelo Arenas Belón
PCRE2 pattern 'foo bar', got '-48' $ git grep -E 'foo bar' fatal: Couldn't JIT the PCRE2 pattern 'foo bar', got '-48' $ git grep -F 'foo bar' fatal: Couldn't JIT the PCRE2 pattern 'foo bar', got '-4

[RFC PATCH v2] grep: allow for run time disabling of JIT in PCRE

2019-07-29 Thread Carlo Marcelo Arenas Belón
when a JIT failure consistent with known security restrictions is found at regex compilation time. $ git grep 'foo bar' fatal: Couldn't JIT the PCRE2 pattern 'foo bar', got '-48' Signed-off-by: Carlo Marcelo Arenas Belón --- V2: add command line to grep as suggest

[PATCH v2] grep: avoid leak of chartables in PCRE2

2019-08-01 Thread Carlo Marcelo Arenas Belón
leanup use free as there is no global context defined when it was created (pcre2_maketables is passed a NULL pointer) but if that gets ever changed will need to be updated in tandem. Signed-off-by: Carlo Marcelo Arenas Belón --- V2: * better document why free is used as suggested by René * avo

[RFC PATCH v3] grep: treat PCRE2 jit compilation memory error as non fatal

2019-08-03 Thread Carlo Marcelo Arenas Belón
warning so that corrective action could be taken. [1] https://bugs.exim.org/show_bug.cgi?id=1749 Signed-off-by: Carlo Marcelo Arenas Belón --- grep.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/grep.c b/grep.c index f7c3a5803e..593a1cb7a0 100644 --- a/grep.c +++ b/grep.c

[RFC PATCH 2/2] grep: make default number of threads reflect runtime

2019-08-04 Thread Carlo Marcelo Arenas Belón
(23.28+0.09) -1.5% Signed-off-by: Carlo Marcelo Arenas Belón --- Documentation/git-grep.txt | 2 +- builtin/grep.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index 2d27969057..5d72e03b2e 100644 --- a

[RFC PATCH 1/2] p7810: add more grep performance relevant cases

2019-08-04 Thread Carlo Marcelo Arenas Belón
Add a baseline for a matching regex and make clear the distinction between fixed (now using kwset) and a real simple expression. Signed-off-by: Carlo Marcelo Arenas Belón --- t/perf/p7810-grep.sh | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/t

[RFC PATCH 0/2] grep: make threading smarter

2019-08-04 Thread Carlo Marcelo Arenas Belón
mance issue in HP-UX[1] Lastly the performance numbers point to deficiencies in kwset and the compat/regex code that will need to be addressed independently. Carlo Marcelo Arenas Belón (2): p7810: add more grep performance relevant cases grep: make default number of threads reflect ru

[PATCH 1/3] grep: make PCRE1 aware of custom allocator

2019-08-06 Thread Carlo Marcelo Arenas Belón
https://public-inbox.org/git/pull.306.git.gitgitgad...@gmail.com Signed-off-by: Carlo Marcelo Arenas Belón --- Makefile | 2 +- grep.c | 10 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bd246f2989..4b384f3759 100644 --- a/Makefile

[PATCH 0/3] grep: no leaks (WIP)

2019-08-06 Thread Carlo Marcelo Arenas Belón
there are still more things to consider as explained there The third patch is the original leak patch rebased on top. Carlo Marcelo Arenas Belón (3): grep: make PCRE1 aware of custom allocator grep: make PCRE2 aware of custom allocator grep: avoid leak of chartables in PCRE2 Makefile |

[PATCH 2/3] grep: make PCRE2 aware of custom allocator

2019-08-06 Thread Carlo Marcelo Arenas Belón
Most of the code stolen from[1] to easy on comparison and including the deficiency of setting the global context even for patterns that won't need it. Ideally, the call from grep_init could be moved to a place where it could be set without needing a lock and at least with this approach we have a p

[PATCH 3/3] grep: avoid leak of chartables in PCRE2

2019-08-06 Thread Carlo Marcelo Arenas Belón
-by: Carlo Marcelo Arenas Belón --- grep.c | 7 --- grep.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/grep.c b/grep.c index e748a6d68c..3e14ec91a6 100644 --- a/grep.c +++ b/grep.c @@ -524,7 +524,6 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struc

[RFC PATCH v3 0/3] grep: no leaks or crashes (windows testing needed)

2019-08-06 Thread Carlo Marcelo Arenas Belón
been tested and considered mostly complete. Junio, could you comment in my assumption that the use of grep in revision.c doesn't require initializing a PCRE2 global context and therefore not doing the cleanup? Carlo Marcelo Arenas Belón (3): grep: make PCRE1 aware of custom allocator grep: make P

[RFC PATCH v3 1/3] grep: make PCRE1 aware of custom allocator

2019-08-06 Thread Carlo Marcelo Arenas Belón
be good idea to test it in a platform where NED might have a positive impact (ex: Windows 7) [1] https://public-inbox.org/git/pull.306.git.gitgitgad...@gmail.com Signed-off-by: Carlo Marcelo Arenas Belón --- Makefile | 2 +- grep.c | 10 ++ 2 files changed, 11 insertions(+), 1 deletion(-

[RFC PATCH v3 2/3] grep: make PCRE2 aware of custom allocator

2019-08-06 Thread Carlo Marcelo Arenas Belón
riginal code[1] this work was based on. [1] https://public-inbox.org/git/3397e6797f872aedd18c6d795f4976e1c579514b.1565005867.git.gitgitgad...@gmail.com/ Reported-by: Johannes Schindelin Signed-off-by: Carlo Marcelo Arenas Belón --- builtin/grep.c | 1 +

[RFC PATCH v3 3/3] grep: avoid leak of chartables in PCRE2

2019-08-06 Thread Carlo Marcelo Arenas Belón
-by: Carlo Marcelo Arenas Belón --- grep.c | 7 --- grep.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/grep.c b/grep.c index 3e5bdf94a6..3d3ea0414e 100644 --- a/grep.c +++ b/grep.c @@ -527,7 +527,6 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struc

[RFC/PATCH 0/3] refactor MIN macro

2018-10-21 Thread Carlo Marcelo Arenas Belón
otherwise will warn on platforms where it is already defined (macOS) convert the internal version from xdiff to a common one from the compatibilty header additionally

[PATCH 2/3] git-compat-util: define MIN through compat

2018-10-21 Thread Carlo Marcelo Arenas Belón
this macro is commonly defined in system headers (usually ) but if it is not define it here so it can be used elsewhere Signed-off-by: Carlo Marcelo Arenas Belón --- git-compat-util.h | 5 + sha256/block/sha256.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a

[PATCH 1/3] sha256: avoid redefinition for MIN

2018-10-21 Thread Carlo Marcelo Arenas Belón
it is already defined whenever "sys/param.h" is available Signed-off-by: Carlo Marcelo Arenas Belón --- sha256/block/sha256.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sha256/block/sha256.c b/sha256/block/sha256.c index 18350c161a..0d4939cc2c 100644 --- a/sha256/block/sha2

[PATCH 3/3] xdiff: use compat's MIN instead

2018-10-21 Thread Carlo Marcelo Arenas Belón
Signed-off-by: Carlo Marcelo Arenas Belón --- xdiff/xdiffi.c | 2 +- xdiff/xemit.c | 6 +++--- xdiff/xhistogram.c | 6 +++--- xdiff/xmacros.h| 4 +--- xdiff/xprepare.c | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c index

[PATCH] test: avoid failures when USE_NED_ALLOCATOR

2018-10-23 Thread Carlo Marcelo Arenas Belón
contrib/nedmalloc doesn't support MALLOC_CHECK_ or MALLOC_PERTURB_ so add it to the same exception that is being used with valgrind Signed-off-by: Carlo Marcelo Arenas Belón --- t/test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/test-lib.sh b/t/test-lib.sh

[PATCH] khash: silence -Wunused-function

2018-10-23 Thread Carlo Marcelo Arenas Belón
after 36da893114 ("config.mak.dev: enable -Wunused-function", 2018-10-18) macro generated code should use a similar solution than commit-slab to silence the compiler. Signed-off-by: Carlo Marcelo Arenas Belón --- khash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[PATCH v2] compat: make sure git_mmap is not expected to write

2018-10-23 Thread Carlo Marcelo Arenas Belón
in f48000fc ("Yank writing-back support from gitfakemmap.", 2005-10-08) support for writting back changes was removed but the specific prot flag that would be used was not checked for Acked-by: Johannes Schindelin Signed-off-by: Carlo Marcelo Arenas Belón --- Changes in v2: * re

[PATCH v2 1/2] commit-slabs: move MAYBE_UNUSED out

2018-10-23 Thread Carlo Marcelo Arenas Belón
after 36da893114 ("config.mak.dev: enable -Wunused-function", 2018-10-18) it is expected to be used to prevent -Wunused-function warnings for code that was macro generated Signed-off-by: Carlo Marcelo Arenas Belón --- commit-slab-impl.h | 4 ++-- git-compat-util.h | 2 ++ 2 files

[PATCH v2 2/2] khash: silence -Wunused-function for delta-islands

2018-10-23 Thread Carlo Marcelo Arenas Belón
ands.c:23:1: warning: unused function 'kh_del_str' [-Wunused-function] Reported-by: René Scharfe Suggested-by: Nguyễn Thái Ngọc Duy Signed-off-by: Carlo Marcelo Arenas Belón --- khash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/khash.h b/khash.h index c0da40daa7..f

[PATCH v2 0/2] delta-islands: avoid unused function messages

2018-10-23 Thread Carlo Marcelo Arenas Belón
the macro generated code from delta-islands (using khash) triggers some unused function warnings in macOS, OpenBSD and some linux with a newer version of clang Carlo Marcelo Arenas Belón (2): commit-slabs: move MAYBE_UNUSED out khash: silence -Wunused-function for delta-islands commit-slab

[PATCH] sequencer: cleanup for gcc 8.2.1 warning

2018-10-24 Thread Carlo Marcelo Arenas Belón
sequencer.c: In function ‘write_basic_state’: sequencer.c:2392:37: warning: zero-length gnu_printf format string [-Wformat-zero-length] write_file(rebase_path_verbose(), ""); Signed-off-by: Carlo Marcelo Arenas Belón --- sequencer.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH v2] sequencer: cleanup for gcc warning in non developer mode

2018-10-25 Thread Carlo Marcelo Arenas Belón
nferred by the previous call the somehow more convoluted syntax works around the issue by providing a non empty format string and is already being used for the abort safety file since 1e41229d96 ("sequencer: make sequencer abort safer", 2016-12-07) Signed-off-by: Carlo Marcelo Aren

[PATCH v3 1/3] commit-slab: move MAYBE_UNUSED into git-compat-util

2018-10-25 Thread Carlo Marcelo Arenas Belón
after 36da893114 ("config.mak.dev: enable -Wunused-function", 2018-10-18) it is expected to be used to prevent -Wunused-function warnings for code that was macro generated Signed-off-by: Carlo Marcelo Arenas Belón Signed-off-by: Junio C Hamano --- commit-slab-impl.h | 4 +--- git-com

[PATCH v3 0/3] delta-islands: avoid unused function messages

2018-10-25 Thread Carlo Marcelo Arenas Belón
message cleanup * Make changes hdr-check clean Changes from v1: * Use MAYBE_UNUSED for all cases as suggested by Duy Carlo Marcelo Arenas Belón (3): commit-slab: move MAYBE_UNUSED into git-compat-util khash: silence -Wunused-function in delta-islands from khash commit-slab: missing definitions

[PATCH v3 2/3] khash: silence -Wunused-function in delta-islands from khash

2018-10-25 Thread Carlo Marcelo Arenas Belón
ands.c:23:1: warning: unused function 'kh_del_str' [-Wunused-function] Reported-by: René Scharfe Suggested-by: Nguyễn Thái Ngọc Duy Signed-off-by: Carlo Marcelo Arenas Belón Signed-off-by: Junio C Hamano --- khash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/khas

[PATCH v3 3/3] commit-slab: missing definitions and forward declarations (hdr-check)

2018-10-25 Thread Carlo Marcelo Arenas Belón
struct commmit needs to be defined before commit-slab can generate working code, object_id should be at least known through a forward declaration Signed-off-by: Carlo Marcelo Arenas Belón --- commit-slab-impl.h | 2 ++ commit-slab.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a

[PATCH] multi-pack-index: make code -Wunused-parameter clean

2018-11-03 Thread Carlo Marcelo Arenas Belón
e_offset Signed-off-by: Carlo Marcelo Arenas Belón --- midx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/midx.c b/midx.c index 4fac0cd08a..a2c17e3108 100644 --- a/midx.c +++ b/midx.c @@ -710,7 +710,7 @@ static size_t write_midx_object_offsets(struct hashfile *f,

[PATCH] parse-options: deprecate OPT_DATE

2018-11-05 Thread Carlo Marcelo Arenas Belón
Signed-off-by: Carlo Marcelo Arenas Belón --- Documentation/technical/api-parse-options.txt | 4 1 file changed, 4 deletions(-) diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt index 829b558110..2b036d7838 100644 --- a

[PATCH] builtin/notes: remove unnecessary free

2018-11-11 Thread Carlo Marcelo Arenas Belón
511726e4b1 ("builtin/notes: fix premature failure when trying to add the empty blob", 2014-11-09) removed the check for !len but left a call to free the buffer that will be otherwise NULL Signed-off-by: Carlo Marcelo Arenas Belón --- builtin/notes.c | 4 +--- 1 file changed, 1 inser

[PATCH 0/2] avoid unsigned long for timestamps

2018-11-12 Thread Carlo Marcelo Arenas Belón
specially problematic in Windows where unsigned long is only 32bit wide and therefore the assumption that a time_t would fit will lead to loss of precision in a 64bit OS. builtin/commit.c | 4 ++-- read-cache.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)

[PATCH 1/2] builtin/commit: use timestamp_t in parse_force_date

2018-11-12 Thread Carlo Marcelo Arenas Belón
unsigned long. Signed-off-by: Carlo Marcelo Arenas Belón --- builtin/commit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/commit.c b/builtin/commit.c index 0d9828e29e..a447e08f62 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -537,10 +537,10 @@ static i

[PATCH 2/2] read-cache: use time_t instead of unsigned long

2018-11-12 Thread Carlo Marcelo Arenas Belón
oblematic so move to time_t instead. Signed-off-by: Carlo Marcelo Arenas Belón --- read-cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/read-cache.c b/read-cache.c index 7b1354d759..5525d8e679 100644 --- a/read-cache.c +++ b/read-cache.c @@ -2625,9 +

[PATCH 2/2] read-cache: use time_t instead of unsigned long

2018-11-12 Thread Carlo Marcelo Arenas Belón
ication times of a shared index. dddbad728c ("timestamp_t: a new data type for timestamps", 2017-04-26) shows why that might be problematic so move to timestamp_t/time_t. if time_t can't represent a valid time keep the indexes for failsafe Signed-off-by: Carlo Marcelo Arenas B

[PATCH v5] clone: report duplicate entries on case-insensitive filesystems

2018-11-19 Thread Carlo Marcelo Arenas Belón
it://git.kernel.org/pub/scm/docs/man-pages/man-pages.git warning: the following paths have collided (e.g. case-sensitive paths on a case-insensitive filesystem) and only one from the same colliding group is in the working tree: 'man2/_Exit.2' 'man2/_exit.2' 'man3/NAN

[PATCH] t5562: skip if NO_CURL is enabled

2018-11-19 Thread Carlo Marcelo Arenas Belón
6c213e863a ("http-backend: respect CONTENT_LENGTH for receive-pack", 2018-07-27) introduced all tests but without a check for CURL support from git. Signed-off-by: Carlo Marcelo Arenas Belón --- t/t5562-http-backend-content-length.sh | 6 ++ 1 file changed, 6 insertions(+) diff

[PATCH v1 1/1] t5601-99: Enable colliding file detection for MINGW

2018-11-22 Thread Carlo Marcelo Arenas Belón
tter to avoid any compiled assumptions about the platform and let the user drive the fallback through core.checkStat instead Signed-off-by: Carlo Marcelo Arenas Belón --- entry.c | 4 1 file changed, 4 deletions(-) diff --git a/entry.c b/entry.c index 0a3c451f5f..5ae74856e6 100644 --- a/

[RFC PATCH 1/7] Documentation: update INSTALL for NetBSD

2018-11-25 Thread Carlo Marcelo Arenas Belón
NetBSD added a BSD licensed reimplementation of GNU libintl to its base at least since release 4.0 (mid 2012) and git can be configured to build with it. Signed-off-by: Carlo Marcelo Arenas Belón --- INSTALL | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/INSTALL b

[RFC PATCH 0/7] test: NetBSD support

2018-11-25 Thread Carlo Marcelo Arenas Belón
Likely still missing changes as it only completes a run with a minimal number of dependencies but open for feedback Requires pkgsrc packages for gmake, perl, bash and curl and completes a run $ gmake SHELL_PATH=/usr/pkg/bin/bash NO_PYTHON=1 CURL_DIR=/usr/pkg test Carlo Marcelo Arenas Belón (7

[RFC PATCH 2/7] t0301: remove trailing / for dir creation

2018-11-25 Thread Carlo Marcelo Arenas Belón
alternative fix Signed-off-by: Carlo Marcelo Arenas Belón --- t/t0301-credential-cache.sh | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/t0301-credential-cache.sh b/t/t0301-credential-cache.sh index fd92533acf..9529c612af 100755 --- a/t/t0301-credential-cache.sh +++ b/t

[RFC PATCH 4/7] config.mak.uname: NetBSD uses old iconv interface

2018-11-25 Thread Carlo Marcelo Arenas Belón
ional configure at least since NetBSD 6.0 Signed-off-by: Carlo Marcelo Arenas Belón --- config.mak.uname | 1 + 1 file changed, 1 insertion(+) diff --git a/config.mak.uname b/config.mak.uname index 36c973c7e6..59ce03819b 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -246,6 +246,

[RFC PATCH 3/7] config.mak.uname: NetBSD uses BSD semantics with fread for directories

2018-11-25 Thread Carlo Marcelo Arenas Belón
had been doing as a workaround Signed-off-by: Carlo Marcelo Arenas Belón --- config.mak.uname | 1 + 1 file changed, 1 insertion(+) diff --git a/config.mak.uname b/config.mak.uname index 3ee7da0e23..36c973c7e6 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -253,6 +25

[RFC PATCH 6/7] t5004: use GNU tar to avoid known issues with BSD tar

2018-11-25 Thread Carlo Marcelo Arenas Belón
56ee96572a ("t5004: resurrect original empty tar archive test", 2013-05-09) added a test to try to detect and workaround issues with the standard tar from BSD, but at least in NetBSD would be better to instead require GNU tar which is available from pkgsrc Signed-off-by: Carlo Marc

[RFC PATCH 5/7] test-lib: use pkgsrc provided unzip for NetBSD

2018-11-25 Thread Carlo Marcelo Arenas Belón
ead so all tests from t5003 succeed Signed-off-by: Carlo Marcelo Arenas Belón --- t/test-lib.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/t/test-lib.sh b/t/test-lib.sh index 6c6c0af7a1..2acb35f277 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1244,6 +1244,7 @@ test_lazy_pre

[RFC PATCH 7/7] config.mak.uname: use pkgsrc perl for NetBSD

2018-11-25 Thread Carlo Marcelo Arenas Belón
otherwise will default to /usr/bin/perl which wouldn't normally exist Signed-off-by: Carlo Marcelo Arenas Belón --- config.mak.uname | 1 + 1 file changed, 1 insertion(+) diff --git a/config.mak.uname b/config.mak.uname index 59ce03819b..d2edb723f4 100644 --- a/config.mak.uname

[PATCH] config.mak.dev: enable -Wpedantic in clang

2018-11-27 Thread Carlo Marcelo Arenas Belón
that with the hope that in the future CI could be used for early detection of similar issues -Wpedantic is only enabled for clang 10 or higher (only available in macOS with latest Xcode) but this restriction should be relaxed further as more environments are tested Signed-off-by: Carlo Marcelo Ar

[PATCH] t6036: avoid "cp -a"

2018-11-30 Thread Carlo Marcelo Arenas Belón
b8cd1bb713 ("t6036, t6043: increase code coverage for file collision handling", 2018-11-07) uses this GNU extension that is not available in a POSIX complaint cp; use cp -R instead Signed-off-by: Carlo Marcelo Arenas Belón --- to be applied on top of en/merge-path-collision for next

Re: [PATCH] t6036: avoid "cp -a"

2018-12-01 Thread Carlo Marcelo Arenas Belón
B3n?= Subject: [PATCH] tests: add lint for non portable cp -a cp -a, while a common flag isn't in POSIX and will therefore fail on systems that don't have GNUish tools (like OpenBSD, AIX or Solaris) Signed-off-by: Carlo Marcelo Arenas Belón --- t/check-non-portable-shell.pl | 1 + 1 fi

[PATCH] t5004: avoid using tar for empty packages

2018-12-01 Thread Carlo Marcelo Arenas Belón
anged the expected result for its tests from one containing an empty directory to a plain empty archive but the portable test wasn't updated resulting on them failing again in (at least) NetBSD and OpenBSD Signed-off-by: Carlo Marcelo Arenas Belón --- t/t5004-archive-corner-cases.sh | 17 ++

[PATCH] t5004: avoid using tar for empty packages

2018-12-01 Thread Carlo Marcelo Arenas Belón
anged the expected result for its tests from one containing an empty directory to a plain empty archive but the portable test wasn't updated resulting on them failing again in (at least) NetBSD and OpenBSD Signed-off-by: Carlo Marcelo Arenas Belón --- t/t5004-archive-corner-cases.sh | 17 ++

[PATCH 1/2] config.mak.uname: OpenBSD uses BSD semantics with fread for directories

2018-12-01 Thread Carlo Marcelo Arenas Belón
6.4) but considering this is a legacy feature it is likely that it affected all old versions and is probably what most users had been using as a workaround Signed-off-by: Carlo Marcelo Arenas Belón --- config.mak.uname | 1 + 1 file changed, 1 insertion(+) diff --git a/config.mak.uname b/con

[PATCH] unpack-trees: avoid dead store for struct progress

2018-10-18 Thread Carlo Marcelo Arenas Belón
it is unconditionally initialized a few lines below Signed-off-by: Carlo Marcelo Arenas Belón --- unpack-trees.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpack-trees.c b/unpack-trees.c index f25089b878..88dc9a615e 100644 --- a/unpack-trees.c +++ b/unpack-trees.c

[PATCH] multi-pack-index: avoid dead store for struct progress

2018-10-18 Thread Carlo Marcelo Arenas Belón
it is initialized unconditionally by a call to start_progress below. Signed-off-by: Carlo Marcelo Arenas Belón --- midx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/midx.c b/midx.c index ea2f3ffe2e..4fac0cd08a 100644 --- a/midx.c +++ b/midx.c @@ -941,7 +941,7 @@ static

[PATCH] builtin/receive-pack: dead initializer for retval in check_nonce

2018-10-20 Thread Carlo Marcelo Arenas Belón
NONCE_BAD is explicitly set when needed with the fallback instead as NONCE_SLOP Signed-off-by: Carlo Marcelo Arenas Belón --- builtin/receive-pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 95740f4f0e..ecce3d4043

[PATCH] read-cache: use of memory after it is freed

2018-10-20 Thread Carlo Marcelo Arenas Belón
introduced with c46c406ae1e (trace.h: support nested performance tracing) on Aug 18, 2018 but not affecting maint Signed-off-by: Carlo Marcelo Arenas Belón --- read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index 1df5c16dbc

[PATCH] cc5e1bf992 (gettext: avoid initialization if the locale dir is not present, 2018-04-21) changed the way the gettext initialization is done skipping most of it for performance reasons if the lo

2019-08-07 Thread Carlo Marcelo Arenas Belón
re keeping most of the performance improvement. Signed-off-by: Carlo Marcelo Arenas Belón --- gettext.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gettext.c b/gettext.c index d4021d690c..3ecf456f74 100644 --- a/gettext.c +++ b/gettext.c @@ -69,7 +69,14 @@

[RFC PATCH v4 1/3] grep: make PCRE1 aware of custom allocator

2019-08-07 Thread Carlo Marcelo Arenas Belón
be good idea to test it in a platform where NED might have a positive impact (ex: Windows 7) [1] https://public-inbox.org/git/pull.306.git.gitgitgad...@gmail.com Signed-off-by: Carlo Marcelo Arenas Belón Signed-off-by: Junio C Hamano --- Makefile | 2 +- grep.c | 10 ++ 2 files changed

[RFC PATCH v4 3/3] grep: avoid leak of chartables in PCRE2

2019-08-07 Thread Carlo Marcelo Arenas Belón
-by: Carlo Marcelo Arenas Belón Signed-off-by: Junio C Hamano --- grep.c | 7 --- grep.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/grep.c b/grep.c index 8ee982e2e8..ccb6ab38a3 100644 --- a/grep.c +++ b/grep.c @@ -541,7 +541,6 @@ static void compile_pcre2_patt

[RFC PATCH v4 2/3] grep: make PCRE2 aware of custom allocator

2019-08-07 Thread Carlo Marcelo Arenas Belón
rest of the users of it added later. Helped-by: René Scharfe Reported-by: Johannes Schindelin Signed-off-by: Carlo Marcelo Arenas Belón --- V4: * use xmalloc instead as suggested by René and Junio * "fix" for regression in t7816 as reported by René builtin/grep.c | 1 + builtin/log.

[RFC PATCH v4 0/3] grep: no leaks or crashes (windows testing needed)

2019-08-07 Thread Carlo Marcelo Arenas Belón
) or (hopefully not) * ignore the original leak (maybe with an UNLEAK) as René suggested [3] * discard this work and just use Dscho's fix (probably with some improvements) Carlo Marcelo Arenas Belón (3): grep: make PCRE1 aware of custom allocator grep: make PCRE2 aware of custom alloc

[RFC PATCH v5 0/3] grep: almost no more leaks, hopefully no crashes

2019-08-08 Thread Carlo Marcelo Arenas Belón
@gmail.com/ [3] https://public-inbox.org/git/7ec60d57-9940-35f2-f7b5-c87d4dc7c...@web.de/ Carlo Marcelo Arenas Belón (3): grep: make PCRE1 aware of custom allocator grep: make PCRE2 aware of custom allocator grep: avoid leak of chartables in PCRE2 Makefile | 2 +- bu

[RFC PATCH v5 2/3] grep: make PCRE2 aware of custom allocator

2019-08-08 Thread Carlo Marcelo Arenas Belón
t of the users of it added later. Helped-by: René Scharfe Reported-by: Johannes Schindelin Signed-off-by: Carlo Marcelo Arenas Belón --- builtin/grep.c | 1 + grep.c | 56 +- grep.h | 1 + 3 files changed, 57 insertions(+), 1 delet

[RFC PATCH v5 1/3] grep: make PCRE1 aware of custom allocator

2019-08-08 Thread Carlo Marcelo Arenas Belón
be good idea to test it in a platform where NED might have a positive impact (ex: Windows 7) [1] https://public-inbox.org/git/pull.306.git.gitgitgad...@gmail.com Signed-off-by: Carlo Marcelo Arenas Belón Signed-off-by: Junio C Hamano --- Makefile | 2 +- grep.c | 10 ++ 2 files changed

[RFC PATCH v5 3/3] grep: avoid leak of chartables in PCRE2

2019-08-08 Thread Carlo Marcelo Arenas Belón
-by: Carlo Marcelo Arenas Belón Signed-off-by: Junio C Hamano --- grep.c | 7 --- grep.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/grep.c b/grep.c index 8e0b838db0..146891e2bf 100644 --- a/grep.c +++ b/grep.c @@ -543,7 +543,6 @@ static void compile_pcre2_patt

[PATCH] SQUASH

2019-08-09 Thread Carlo Marcelo Arenas Belón
Make using a general context (that is only needed with NED) to depend on NED being selected at compile time. the compile_context could be also make conditional but it gets ugly really fasts with #ifdef --- Makefile | 2 +- grep.c | 4 2 files changed, 5 insertions(+), 1 deletion(-) diff -

[RFC PATCH] http: use xmalloc with cURL

2019-08-10 Thread Carlo Marcelo Arenas Belón
ismatch is unlikely to be found while testing because of that. cURL is very strict about its allocator being thread safe and so that might be an issue to look for. Signed-off-by: Carlo Marcelo Arenas Belón --- http.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/http.h b/http.h index

[PATCH] http: use xmalloc with cURL

2019-08-15 Thread Carlo Marcelo Arenas Belón
USE_NED_ALLOCATOR=YesPlease is used (most likely in Windows) Signed-off-by: Carlo Marcelo Arenas Belón --- This doesn't conflict with anything and was originally based on maint (so it applies cleanly also to master and next), but is now rebased on top of jk/drop-release-pack-memory so the final product wou

[PATCH v2] http: use xmalloc with cURL

2019-08-15 Thread Carlo Marcelo Arenas Belón
USE_NED_ALLOCATOR=YesPlease is used (most likely in Windows) Signed-off-by: Carlo Marcelo Arenas Belón --- Notes: v2: keep all global_init ifdefs together (as suggested by Junio) http.h | 4 1 file changed, 4 insertions(+) diff --git a/http.h b/http.h index b429f1cf04..20a2030c94 100644 --- a/http.h

[PATCH v3] http: use xmalloc with cURL

2019-08-15 Thread Carlo Marcelo Arenas Belón
USE_NED_ALLOCATOR=YesPlease is used (most likely in Windows) Signed-off-by: Carlo Marcelo Arenas Belón --- v3: proper use of #elif (Thanks Junio) v2: keep all curl_global_init ifdefs together (as suggested by Junio) http.h | 4 1 file changed, 4 insertions(+) diff --git a/http.h b/http.h index b429f1cf04

[PATCH 1/2] grep: make sure NO_LIBPCRE1_JIT disable JIT in PCRE1

2019-08-25 Thread Carlo Marcelo Arenas Belón
d reliably to enforce JIT doesn't get used. Signed-off-by: Carlo Marcelo Arenas Belón --- Makefile | 9 ++--- grep.h | 4 +--- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index f58bf14c7b..3f78ef942f 100644 --- a/Makefile +++ b/Makefile @@ -

[PATCH 2/2] grep: refactor and simplify PCRE1 support

2019-08-25 Thread Carlo Marcelo Arenas Belón
pcre_study with the right parameter after JIT support has been confirmed and unless it was requested to be disabled with NO_LIBPCRE1_JIT Signed-off-by: Carlo Marcelo Arenas Belón --- grep.c | 16 ++-- grep.h | 9 - 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a

  1   2   >