Re: [PATCH v5] fetch-pack: always allow fetching of literal SHA1s

2017-05-13 Thread Jeff King
On Fri, May 12, 2017 at 11:00:36AM -0700, Jonathan Tan wrote: > > @@ -617,7 +632,8 @@ static void filter_refs(struct fetch_pack_args *args, > > else if (cmp == 0) { > > keep = 1; /* definitely have it */ > >

Re: [PATCH v6] fetch-pack: always allow fetching of literal SHA1s

2017-05-13 Thread Jeff King
On Fri, May 12, 2017 at 01:46:48PM -0700, Jonathan Tan wrote: > Change from v5: used "ensure_tip_oids_initialized" function instead. > This removes some of the muddiness (e.g. with newlist being modified > after the function). I don't think it really improves the muddiness. You are still calling

Re: [PATCH] hashmap: hashmap_get_next passes through keydata as well

2017-05-13 Thread Jeff King
On Fri, May 12, 2017 at 01:02:44PM -0700, Stefan Beller wrote: > The 'keydata' may be of value in the underlying compare function to decide > if the given two entries are the same. I had to scratch my head over this for a minute, because there isn't really any motivating example of what you're tr

Re: [PATCH v7 04/10] convert: move packet_write_line() into pkt-line as packet_writel()

2017-05-13 Thread Jeff King
On Fri, May 05, 2017 at 11:27:56AM -0400, Ben Peart wrote: > +int packet_writel(int fd, const char *line, ...); This isn't a new problem, but I noticed that this function should probably get annotated to describe its interface. Junio, can you pick up the patch below on top of Ben's series (or I'

Re: [PATCH v7 09/10] sub-process: move sub-process functions into separate files

2017-05-13 Thread Jeff King
On Fri, May 05, 2017 at 11:28:01AM -0400, Ben Peart wrote: > +static void subprocess_exit_handler(struct child_process *process) > +{ > + sigchain_push(SIGPIPE, SIG_IGN); > + /* Closing the pipe signals the subprocess to initiate a shutdown. */ > + close(process->in); > + close(pro

Re: [PATCH v7 00/10] refactor the filter process code into a reusable module

2017-05-13 Thread Jeff King
On Mon, May 08, 2017 at 10:58:46AM +0900, Junio C Hamano wrote: > Will queue; during the pre-release freeze, new things would move > slowly, but let's see if we have more comments from others and then > merge it to 'next' soon after the 2.13 final. I gave it a fresh read-through. I had a few comm

git subtree merge deletes files in top directory

2017-05-13 Thread Nikolai Hartmann
Hi, I'm trying to add a subtree which contains a folder with the same name as the subtree directory itself. Adding seems to work, but if i pull after the subtree remote changed, files in my top directory are deleted and everything seems to have "moved up" one directory - although i specify a subtr

Re: What's cooking in git.git (May 2017, #04; Fri, 12)

2017-05-13 Thread Jeff King
On Fri, May 12, 2017 at 03:43:21PM +0900, Junio C Hamano wrote: > * sg/clone-refspec-from-command-line-config (2017-05-09) 2 commits > - git-clone --config order & fetching extra refs during initial clone > - clone: respect configured fetch respecs during initial fetch > > "git clone -c var=va

Re: [PATCH v3] fetch-pack: always allow fetching of literal SHA1s

2017-05-13 Thread Jeff King
On Thu, May 11, 2017 at 10:00:50AM -0700, Brandon Williams wrote: > > None of this is your problem now either way; the advertisement-limiting > > extension is still vaporware, albeit one we've discussed a lot. I just > > wanted to make sure we weren't painting ourselves into any corners. And > > I

[PATCH] doc: use https link to Wikipeai to avoid http redirect

2017-05-13 Thread Sven Strickroth
Signed-off-by: Sven Strickroth --- Documentation/gitweb.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/gitweb.txt b/Documentation/gitweb.txt index 96156e5e1..88450589a 100644 --- a/Documentation/gitweb.txt +++ b/Documentation/gitweb.txt @@ -84,7 +84,7 @@ sep

Re: [PATCH 00/11] Start retiring .git/remotes/ and .git/branches/ for good

2017-05-13 Thread Junio C Hamano
Jonathan Nieder writes: > Johannes Schindelin wrote: >> On Fri, 12 May 2017, Junio C Hamano wrote: > >>> And this one is also important. I do not think we had to touch any >>> code that handles .git/remotes/ or .git/branches when we extended >>> the .git/config based configuration for remotes, s

Re: [PATCH] doc: use https link to Wikipeai to avoid http redirect

2017-05-13 Thread Ævar Arnfjörð Bjarmason
On Sat, May 13, 2017 at 11:54 AM, Sven Strickroth wrote: Spelling error: Wikipeai Looks good, but let's change these too while we're at it: $ git grep http://en.wikip Documentation/gitweb.txt:87:http://en.wikipedia.org/wiki/Query_string#URL_encoding[]), the difference bisect.c:549: * http://en.

[PATCH] Use https links to Wikipedia to avoid http redirects

2017-05-13 Thread Sven Strickroth
Signed-off-by: Sven Strickroth --- Documentation/gitweb.txt | 2 +- bisect.c | 2 +- gitweb/gitweb.perl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/gitweb.txt b/Documentation/gitweb.txt index 96156e5e1..88450589a 100644 --- a/Document

Re: [PATCH 11/29] grep: add a test helper function for less verbose -f \0 tests

2017-05-13 Thread Ævar Arnfjörð Bjarmason
On Fri, May 12, 2017 at 7:06 AM, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason writes: > >> Add a helper function to make the tests which check for patterns with >> \0 in them more succinct. Right now this isn't a big win, but >> subsequent commits will add a lot more of these tests. >> >> The

Re: [PATCH] fixup! log: add exhaustive tests for pattern style options & config

2017-05-13 Thread Ævar Arnfjörð Bjarmason
On Fri, May 12, 2017 at 12:50 PM, Johannes Schindelin wrote: > On Windows, `(1|2)` is not a valid file name, and therefore the tag > cannot be created as expected by the new test. > > So simply skip this test on Windows. Thanks for the hotfix. I'll fix this in my v2, but do it differently in such

Re: [PATCH] fixup! log: add exhaustive tests for pattern style options & config

2017-05-13 Thread Ævar Arnfjörð Bjarmason
On Sat, May 13, 2017 at 1:44 AM, Jonathan Nieder wrote: > Johannes Schindelin wrote: > >> On Windows, `(1|2)` is not a valid file name, and therefore the tag >> cannot be created as expected by the new test. >> >> So simply skip this test on Windows. >> >> Signed-off-by: Johannes Schindelin >> --

Re: [PATCH] usage.c: drop set_error_handle()

2017-05-13 Thread Ramsay Jones
On 13/05/17 04:48, Jeff King wrote: > The set_error_handle() function was introduced by 3b331e926 > (vreportf: report to arbitrary filehandles, 2015-08-11) so > that run-command could send post-fork, pre-exec errors to > the parent's original stderr. > > That use went away in 79319b194 (run-comm

Re: [PATCH] hashmap: hashmap_get_next passes through keydata as well

2017-05-13 Thread Stefan Beller
On Sat, May 13, 2017 at 1:50 AM, Jeff King wrote: > On Fri, May 12, 2017 at 01:02:44PM -0700, Stefan Beller wrote: > >> The 'keydata' may be of value in the underlying compare function to decide >> if the given two entries are the same. > > I had to scratch my head over this for a minute, because

Re: [PATCH v4 1/3] usability: don't ask questions if no reply is required

2017-05-13 Thread Johannes Sixt
Am 13.05.2017 um 00:36 schrieb Junio C Hamano: Thanks, all three patches look good. Will queue. Let's merge them to 'next' soonish and eventually down to 'master' and 'maint'. The patches change translated strings. You should probably wait for an update of their translations before you relea

[PATCH 0/5] p0004: support being called by t/perf/run

2017-05-13 Thread René Scharfe
p0004-lazy-init-name-hash.sh errors out if the test repo is too small, and doesn't generate any perf test results even if it finishes successfully. That prevents t/perf/run from running the whole test suite. This series tries to address these issues. p0004: simplify calls of test-lazy-init-nam

[PATCH 1/5] p0004: simplify calls of test-lazy-init-name-hash

2017-05-13 Thread René Scharfe
The test library puts helpers into $PATH, so we can simply call them without specifying their location. The suffix $X is also not necessary because .exe files on Windows can be started without specifying their extension, and on other platforms it's empty anyway. Signed-off-by: Rene Scharfe ---

[PATCH 2/5] p0004: avoid using pipes

2017-05-13 Thread René Scharfe
The return code of commands on the producing end of a pipe is ignored. Evaluate the outcome of test-lazy-init-name-hash by calling sort separately. Signed-off-by: Rene Scharfe --- t/perf/p0004-lazy-init-name-hash.sh | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/t/pe

[PATCH 3/5] p0004: use test_perf

2017-05-13 Thread René Scharfe
The perf test suite (more specifically: t/perf/aggregate.perl) requires each test script to write test results into a file, otherwise it aborts when aggregating. Add actual performance tests with test_perf to allow p0004 to be run together with other perf scripts. Calibrate the value for the para

[PATCH 4/5] p0004: don't abort if multi-threaded is too slow

2017-05-13 Thread René Scharfe
If the single-threaded variant beats the multi-threaded one then we may have a performance bug, but that doesn't justify aborting the test. Drop that check; we can compare the results for --single and --multi using the actual performance tests. Signed-off-by: Rene Scharfe --- t/perf/p0004-lazy-i

[PATCH 5/5] p0004: don't error out if test repo is too small

2017-05-13 Thread René Scharfe
Repositories with less than 4000 entries are always handled using a single thread, causing test-lazy-init-name-hash --multi to error out. Don't abort the whole test script in that case, but simply skip the multi-threaded performance check. We can still use it to compare the single-threaded speed o

Re: [PATCH 09/29] grep: amend submodule recursion test for regex engine testing

2017-05-13 Thread Ævar Arnfjörð Bjarmason
On Fri, May 12, 2017 at 6:59 AM, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason writes: > >> Amend the submodule recursion test to prepare it for subsequent tests >> of whether it passes along the grep.patternType to the submodule >> greps. >> >> This is the result of searching & replacing: >>

Re: [PATCH v4 03/12] t/test-lib-functions.sh: allow to specify the tag name to test_commit

2017-05-13 Thread Ævar Arnfjörð Bjarmason
On Tue, Feb 12, 2013 at 11:17 AM, Brandon Casey wrote: > The part of test_commit() may not be appropriate for a tag name. > So let's allow test_commit to accept a fourth argument to specify the tag > name. [Kind of late to notice, I know] I see nobody spotted in four rounds of reviews that this

Re: [PATCH 04/29] log: add exhaustive tests for pattern style options & config

2017-05-13 Thread Ævar Arnfjörð Bjarmason
On Fri, May 12, 2017 at 6:48 AM, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason writes: > >> Add exhaustive tests for how the different grep.patternType options & >> the corresponding command-line options affect git-log. >> ... >> The patterns being passed to fixed/basic/extended/PCRE are caref

Re: [PATCH] compat/regex: fix compilation on Windows

2017-05-13 Thread Johannes Schindelin
Hi Ævar, I originally replied in a very verbose manner, going step by step through the "one-liner", but decided to rephrase everything. So here goes. On Sat, 13 May 2017, Ævar Arnfjörð Bjarmason wrote: > Let's drop this current gawk import series. Well, the reason why you imported the current

Re: [PATCH] fixup! log: add exhaustive tests for pattern style options & config

2017-05-13 Thread Johannes Schindelin
Hi Jonathan, On Fri, 12 May 2017, Jonathan Nieder wrote: > Johannes Schindelin wrote: > > > On Windows, `(1|2)` is not a valid file name, and therefore the tag > > cannot be created as expected by the new test. > > > > So simply skip this test on Windows. > > > > Signed-off-by: Johannes Schindel

Re: [PATCH] compat/regex: fix compilation on Windows

2017-05-13 Thread Ævar Arnfjörð Bjarmason
On Sat, May 13, 2017 at 8:30 PM, Johannes Schindelin wrote: > Hi Ævar, > > I originally replied in a very verbose manner, going step by step through > the "one-liner", but decided to rephrase everything. > > So here goes. > > On Sat, 13 May 2017, Ævar Arnfjörð Bjarmason wrote: > >> Let's drop this

Re: [PATCH] Use https links to Wikipedia to avoid http redirects

2017-05-13 Thread Ævar Arnfjörð Bjarmason
On Sat, May 13, 2017 at 11:54 AM, Sven Strickroth wrote: > Signed-off-by: Sven Strickroth Thanks! FWIW: Reviewed-by: Ævar Arnfjörð Bjarmason > --- > Documentation/gitweb.txt | 2 +- > bisect.c | 2 +- > gitweb/gitweb.perl | 2 +- > 3 files changed, 3 insertions(+), 3 de

[PATCH v2 01/29] Makefile & configure: reword inaccurate comment about PCRE

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Reword an outdated & inaccurate comment which suggests that only git-grep can use PCRE. This comment was added back when PCRE support was initially added in commit 63e7e9d8b6 ("git-grep: Learn PCRE", 2011-05-09), and was true at the time. It hasn't been telling the full truth since git-log learne

[PATCH v2 04/29] log: add exhaustive tests for pattern style options & config

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add exhaustive tests for how the different grep.patternType options & the corresponding command-line options affect git-log. Before this change it was possible to patch revision.c so that the --basic-regexp option was synonymous with --extended-regexp, and --perl-regexp wasn't recognized at all, a

[PATCH v2 00/29] Easy to review grep & pre-PCRE changes

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Easy to review? 29 patches? Are you kidding me?! As noted in v1 (<20170511091829.5634-1-ava...@gmail.com>; https://public-inbox.org/git/20170511091829.5634-1-ava...@gmail.com/) these are all doc, test, refactoring etc. changes needed by the subsequent "PCRE v2, PCRE v1 JIT, log -P & fixes" series.

[PATCH v2 06/29] grep: add a test for backreferences in PCRE patterns

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add a test for backreferences such as (.)\1 in PCRE patterns. This test ensures that the PCRE_NO_AUTO_CAPTURE option isn't turned on. Before this change turning it on would break these sort of patterns, but wouldn't break any tests. Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t7810-grep.sh | 7

[PATCH v2 02/29] grep & rev-list doc: stop promising libpcre for --perl-regexp

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Stop promising in our grep & rev-list options documentation that we're always going to be using libpcre when given the --perl-regexp option. Instead talk about using "Perl-compatible regular expressions" and using these types of patterns using "a compile-time dependency". Saying "libpcre" means t

[PATCH v2 08/29] grep: add tests for --threads=N and grep.threads

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add tests for --threads=N being supplied on the command-line, or when grep.threads=N being supplied in the configuration. When the threading support was made run-time configurable in commit 89f09dd34e ("grep: add --threads= option and grep.threads configuration", 2015-12-15) no tests were added fo

[PATCH v2 10/29] grep: add tests for grep pattern types being passed to submodules

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add testing for grep pattern types being correctly passed to submodules. The pattern "(.|.)[\d]" matches differently under fixed (not at all), and then matches different lines under basic/extended & perl regular expressions, so this change asserts that the pattern type is passed along correctly. S

[PATCH v2 12/29] grep: prepare for testing binary regexes containing rx metacharacters

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add setup code needed for testing regexes that contain both binary data and regex metacharacters. The POSIX regcomp() function inherently can't support that, because it takes a \0-delimited char *, but other regex engines APIs like PCRE v2 take a pattern/length pair, and are thus able to handle \0

[PATCH v2 11/29] grep: add a test helper function for less verbose -f \0 tests

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add a helper function to make the tests which check for patterns with \0 in them more succinct. Right now this isn't a big win, but subsequent commits will add a lot more of these tests. The helper is based on the match() function in t3070-wildmatch.sh. Signed-off-by: Ævar Arnfjörð Bjarmason ---

[PATCH v2 03/29] test-lib: rename the LIBPCRE prerequisite to PCRE

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Rename the LIBPCRE prerequisite to PCRE. This is for preparation for libpcre2 support, where having just "LIBPCRE" would be confusing as it implies v1 of the library. None of these tests are incompatible between versions 1 & 2 of libpcre, it's less confusing to give them a more general name to mak

[PATCH v2 05/29] grep: add a test asserting that --perl-regexp dies when !PCRE

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add a test asserting that when --perl-regexp (and -P for grep) is given to git-grep & git-log that we die with an error. In developing the PCRE v2 series I introduced a regression where -P would (through control-flow fall-through) become synonymous with basic POSIX matching. I.e. 'git grep -P '[\d

[PATCH v2 07/29] grep: change non-ASCII -i test to stop using --debug

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Change a non-ASCII case-insensitive test case to stop using --debug, and instead simply test for the expected results. The test coverage remains the same with this change, but the test won't break due to internal refactoring. This test was added in commit 793dc676e0 ("grep/icase: avoid kwsset whe

[PATCH v2 09/29] grep: amend submodule recursion test for regex engine testing

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Amend the submodule recursion test to prepare it for subsequent tests of whether it passes along the grep.patternType to the submodule greps. This is the result of searching & replacing: foobar -> (1|2)d(3|4) foo-> (1|2) bar-> (3|4) Currently there's no tests for whether e.g.

[PATCH v2 18/29] grep: catch a missing enum in switch statement

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add a die(...) to a default case for the switch statement selecting between grep pattern types under --recurse-submodules. Normally this would be caught by -Wswitch, but the grep_pattern_type type is converted to int by going through parse_options(). Changing the argument type passed to compile_su

[PATCH v2 16/29] perf: add a performance comparison test of grep -G, -E and -P

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add a very basic performance comparison test comparing the POSIX basic, extended and perl engines. In theory the "basic" and "extended" engines should be implemented using the same underlying code with a slightly different pattern parser, but some implementations may not do this. Jump through some

[PATCH v2 15/29] perf: emit progress output when unpacking & building

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Amend the t/perf/run output so that in addition to the "Running N tests" heading currently being emitted, it also emits "Unpacking $rev" and "Building $rev" when setting up the build/$rev directory & when building it, respectively. This makes it easier to see what's going on and what revision is b

[PATCH v2 14/29] perf: add a GIT_PERF_MAKE_COMMAND for when *_MAKE_OPTS won't do

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add a git GIT_PERF_MAKE_COMMAND variable to compliment the existing GIT_PERF_MAKE_OPTS facility. This allows specifying an arbitrary shell command to execute instead of 'make'. This is useful e.g. in cases where the name, semantics or defaults of a Makefile flag have changed over time. It can even

[PATCH v2 13/29] grep: add tests to fix blind spots with \0 patterns

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Address a big blind spot in the tests for patterns containing \0. The is_fixed() function considers any string that contains \0 fixed, even if it contains regular expression metacharacters, those patterns are currently matched with kwset. Before this change removing that memchr(s, 0, len) check fr

[PATCH v2 19/29] grep: remove redundant regflags assignment under PCRE

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Remove a redundant assignment to the "regflags" variable. This variable is only used for POSIX regular expression matching, not when the PCRE library is used. This redundant assignment was added as a result of copy/paste programming in commit 84befcd0a4 ("grep: add a grep.patternType configuration

[PATCH v2 22/29] grep: change the internal PCRE macro names to be PCRE1

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Change the internal USE_LIBPCRE define, & build options flag to use a naming convention ending in PCRE1, without changing the long-standing USE_LIBPCRE Makefile flag which enables this code. This is for preparation for libpcre2 support where having things like USE_LIBPCRE and USE_LIBPCRE2 in any m

[PATCH v2 21/29] grep: factor test for \0 in grep patterns into a function

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Factor the test for \0 in grep patterns into a function. Since commit 9eceddeec6 ("Use kwset in grep", 2011-08-21) any pattern containing a \0 is considered fixed as regcomp() can't handle it. This limitation was never documented, and other some regular expression engines are capable of compiling

[PATCH v2 17/29] perf: add a performance comparison of fixed-string grep

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add a performance comparison test which compares both case-sensitive & case-insensitive fixed-string grep, as well as non-ASCII case-sensitive & case-insensitive grep. Currently only the "-i æ" performance test doesn't go through the same kwset.[ch] codepath, see the "Even when -F..." comment in g

[PATCH v2 26/29] pack-objects & index-pack: add test for --threads warning

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add a test for the warning that's emitted when --threads or pack.threads is provided under NO_PTHREADS=YesPlease. This uses the new PTHREADS prerequisite. The assertion for C_LOCALE_OUTPUT in the latter test is currently redundant, since unlike index-pack the pack-objects warnings aren't i18n'd. H

[PATCH v2 24/29] grep: move is_fixed() earlier to avoid forward declaration

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Move the is_fixed() function which are currently only used in compile_regexp() earlier so it can be used in the PCRE family of functions in a later change. Signed-off-by: Ævar Arnfjörð Bjarmason --- grep.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --g

[PATCH v2 20/29] grep: remove redundant `regflags &= ~REG_EXTENDED` assignments

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Remove redundant assignments to the "regflags" variable. There are no code paths that have previously set the regflags to anything, and certainly not to `|= REG_EXTENDED`. This code gave the impression that it had to reset its environment, but it doesn't. This dates back to the initial introductio

[PATCH v2 25/29] test-lib: add a PTHREADS prerequisite

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add a PTHREADS prerequisite which is false when git is compiled with NO_PTHREADS=YesPlease. There's lots of custom code that runs when threading isn't available, but before this prerequisite there was no way to test it. Signed-off-by: Ævar Arnfjörð Bjarmason --- Makefile | 1 + t/README

[PATCH v2 29/29] grep: assert that threading is enabled when calling grep_{lock,unlock}

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Change the grep_{lock,unlock} functions to assert that num_threads is true, instead of only locking & unlocking the pthread mutex lock when it is. These functions are never called when num_threads isn't true, this logic has gone through multiple iterations since the initial introduction of grep th

[PATCH v2 28/29] grep: given --threads with NO_PTHREADS=YesPlease, warn

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add a warning about missing thread support when grep.threads or --threads is set to a non 0 (default) or 1 (no parallelism) value under NO_PTHREADS=YesPlease. This is for consistency with the index-pack & pack-objects commands, which also take a --threads option & are configurable via pack.threads

[PATCH v2 27/29] pack-objects: fix buggy warning about threads

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Fix a buggy warning about threads under NO_PTHREADS=YesPlease. Due to re-using the delta_search_threads variable for both the state of the "pack.threads" config & the --threads option, setting "pack.threads" but not supplying --threads would trigger the warning for both "pack.threads" & --threads.

[PATCH v2 23/29] grep: change internal *pcre* variable & function names to be *pcre1*

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Change the internal PCRE variable & function names to have a "1" suffix. This is for preparation for libpcre2 support, where having non-versioned names would be confusing. An earlier change in this series ("grep: change the internal PCRE macro names to be PCRE1", 2017-04-07) elaborates on the moti

[PATCH v2 0/7] PCRE v2, PCRE v1 JIT, log -P & fixes

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Trivial changes since v1, but I wanted to send a new one for completeness since I re-sent the "Easy to review grep & pre-PCRE changes" series. For v1 see <20170511170142.15934-1-ava...@gmail.com> (https://public-inbox.org/git/20170511170142.15934-1-ava...@gmail.com/). Changes noted below & reply

[PATCH v2 1/7] grep: don't redundantly compile throwaway patterns under threading

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Change the pattern compilation logic under threading so that grep doesn't compile a pattern it never ends up using on the non-threaded code path, only to compile it again N times for N threads which will each use their own copy, ignoring the initially compiled pattern. This redundant compilation d

[PATCH v2 3/7] log: add -P as a synonym for --perl-regexp

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add a short -P option as a synonym for the longer --perl-regexp, for consistency with the options the corresponding grep invocations accept. This was intentionally omitted in commit 727b6fc3ed ("log --grep: accept --basic-regexp and --perl-regexp", 2012-10-03) for unspecified future use. Make it

[PATCH v2 2/7] grep: skip pthreads overhead when using one thread

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Skip the administrative overhead of using pthreads when only using one thread. Instead take the non-threaded path which would be taken under NO_PTHREADS. The threading support was initially added in commit 5b594f457a ("Threaded grep", 2010-01-25) with a hardcoded compile-time number of 8 threads.

[PATCH v2 5/7] grep: un-break building with PCRE < 8.32

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Amend my change earlier in this series ("grep: add support for the PCRE v1 JIT API", 2017-04-11) to un-break the build on PCRE v1 versions earlier than 8.32. The JIT support was added in version 8.20 released on 2011-10-21, but it wasn't until 8.32 released on 2012-11-30 that the fast code path to

[PATCH v2 6/7] grep: un-break building with PCRE < 8.20

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Amend my change earlier in this series ("grep: add support for the PCRE v1 JIT API", 2017-04-11) to un-break the build on PCRE v1 versions earlier than 8.20. The 8.20 release was the first release to have JIT & pcre_jit_stack in the headers, so a mock type needs to be provided for it on those rele

[PATCH v2 4/7] grep: add support for the PCRE v1 JIT API

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Change the grep PCRE v1 code to use JIT when available. When PCRE support was initially added in commit 63e7e9d8b6 ("git-grep: Learn PCRE", 2011-05-09) PCRE had no JIT support, it was integrated into 8.20 released on 2011-10-21. Enabling JIT support usually improves performance by more than 40%. T

[PATCH v2 7/7] grep: add support for PCRE v2

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Add support for v2 of the PCRE API. This is a new major version of PCRE that came out in early 2015[1]. The regular expression syntax is the same, but while the API is similar, pretty much every function is either renamed or takes different arguments. Thus using it via entirely new functions makes

Re: [PATCH] usage.c: drop set_error_handle()

2017-05-13 Thread Brandon Williams
On 05/12, Jeff King wrote: > The set_error_handle() function was introduced by 3b331e926 > (vreportf: report to arbitrary filehandles, 2015-08-11) so > that run-command could send post-fork, pre-exec errors to > the parent's original stderr. > > That use went away in 79319b194 (run-command: elimin

[RFC PATCH v2 09/22] blame: move reverse flag to scoreboard

2017-05-13 Thread Jeff Smith
The reverse flag is used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith --- blame.h | 3 +++ builtin/blame.c | 20 +++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/bla

[RFC PATCH v2 00/22] Add blame to libgit

2017-05-13 Thread Jeff Smith
Rather than duplicate large portions of builtin/blame.c in cgit, it would be better to shift its core functionality into libgit.a. The functionality left in builtin/blame.c mostly relates to terminal presentation. Since initial patchset: Made commit titles consistent Broke some commits into m

[RFC PATCH v2 21/22] blame: create scoreboard setup function in libgit

2017-05-13 Thread Jeff Smith
Signed-off-by: Jeff Smith --- blame.c | 272 +++- blame.h | 5 +- builtin/blame.c | 259 + 3 files changed, 271 insertions(+), 265 deletions(-) diff --git a/blame.c b/blame.c

[RFC PATCH v2 03/22] blame: remove unused parameters

2017-05-13 Thread Jeff Smith
Clean up blame code before moving it into libgit Signed-off-by: Jeff Smith --- builtin/blame.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index c419981..e30b3ef 100644 --- a/builtin/blame.c +++ b/builtin/blame

[RFC PATCH v2 06/22] blame: move stat counters to scoreboard

2017-05-13 Thread Jeff Smith
Statistic counters are used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith --- blame.h | 5 + builtin/blame.c | 29 - 2 files changed, 17 insertions(+), 17 deletions(-) d

[RFC PATCH v2 05/22] blame: move scoreboard structure to header

2017-05-13 Thread Jeff Smith
The scoreboard structure is core to the blame interface. Since scoreboard will be more exposed, rename it to blame_scoreboard to clarify what it is a part of. Signed-off-by: Jeff Smith --- blame.h | 29 builtin/blame.c | 83 +++

[RFC PATCH v2 10/22] blame: move show_root flag to scoreboard

2017-05-13 Thread Jeff Smith
The show_root flag is used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith --- blame.h | 1 + builtin/blame.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/blame.h b/blame.h index

[RFC PATCH v2 19/22] blame: move scoreboard-related methods to libgit

2017-05-13 Thread Jeff Smith
Signed-off-by: Jeff Smith --- blame.c | 1313 ++ blame.h | 11 + builtin/blame.c | 1330 +-- 3 files changed, 1330 insertions(+), 1324 deletions(-) diff --git a/blame.c b/bla

[RFC PATCH v2 02/22] blame: move textconv_object with related functions

2017-05-13 Thread Jeff Smith
textconv_object is used in places other than blame.c and should be moved to a more appropriate location. Other textconv related functions are located in diff.c so that seems as good a place as any. Signed-off-by: Jeff Smith --- builtin.h | 2 -- builtin/blame.c| 28 ---

[RFC PATCH v2 01/22] blame: remove unneeded dependency on blob.h

2017-05-13 Thread Jeff Smith
With commit 21666f1 ("convert object type handling from a string to a number", 2007-02-26), there was no longer a need for blame.c to include blob.h but it was not removed. Signed-off-by: Jeff Smith --- builtin/blame.c | 1 - 1 file changed, 1 deletion(-) diff --git a/builtin/blame.c b/builtin/

[RFC PATCH v2 18/22] blame: move fake-commit-related methods to libgit

2017-05-13 Thread Jeff Smith
Signed-off-by: Jeff Smith --- blame.c | 203 +++- blame.h | 4 +- builtin/blame.c | 197 -- 3 files changed, 205 insertions(+), 199 deletions(-) diff --git a/blame.c b/blame.

[RFC PATCH v2 04/22] blame: move origin and entry structures to header

2017-05-13 Thread Jeff Smith
The origin and blame_entry structures are core to the blame interface and reference each other. Since origin will be more exposed, rename it to blame_origin to clarify what it is a part of. Signed-off-by: Jeff Smith --- blame.h | 86 ++ builtin/blame.c | 185

[RFC PATCH v2 08/22] blame: move contents_from to scoreboard

2017-05-13 Thread Jeff Smith
The argument from --contents is used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith --- blame.h | 3 +++ builtin/blame.c | 1 + 2 files changed, 4 insertions(+) diff --git a/blame.h b/blame.h index fde7d

[RFC PATCH v2 07/22] blame: move copy/move thresholds to scoreboard

2017-05-13 Thread Jeff Smith
Copy and move score thresholds are used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith --- blame.h | 10 ++ builtin/blame.c | 36 2 files changed, 26 insertion

[RFC PATCH v2 11/22] blame: move xdl_opts flags to scoreboard

2017-05-13 Thread Jeff Smith
The xdl_opts flags are used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith --- blame.h | 1 + builtin/blame.c | 7 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/blame.h b/blame.h

[RFC PATCH v2 15/22] blame: wrap blame_sort and compare_blame_final

2017-05-13 Thread Jeff Smith
The new method's interface is marginally cleaner than blame_sort, and will avoid the need to expose the compare_blame_final method. Signed-off-by: Jeff Smith --- builtin/blame.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.

[RFC PATCH v2 17/22] blame: move origin-related methods to libgit

2017-05-13 Thread Jeff Smith
Signed-off-by: Jeff Smith --- Makefile| 1 + blame.c | 62 + blame.h | 15 +++ builtin/blame.c | 120 4 files changed, 102 insertions(+), 96 deletions(-) create mode 100644 blame.

[RFC PATCH v2 20/22] blame: create scoreboard init function in libgit

2017-05-13 Thread Jeff Smith
Signed-off-by: Jeff Smith --- blame.c | 7 +++ blame.h | 2 ++ builtin/blame.c | 4 +--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/blame.c b/blame.c index 798e61b..17ebf64 100644 --- a/blame.c +++ b/blame.c @@ -1574,3 +1574,10 @@ void assign_blame(struct

[RFC PATCH v2 13/22] blame: make sanity_check use a callback in scoreboard

2017-05-13 Thread Jeff Smith
Allow the interface user to decide how to handle a failed sanity check, whether that be to output with the current state or to do nothing. Signed-off-by: Jeff Smith --- blame.h | 4 builtin/blame.c | 23 +++ 2 files changed, 19 insertions(+), 8 deletions(-) dif

[RFC PATCH v2 16/22] blame: rework methods that determine 'final' commit

2017-05-13 Thread Jeff Smith
Either prepare_initial or prepare_final is used to determine which commit is marked as 'final'. Call the underlying methods directly to make this more clear. Signed-off-by: Jeff Smith --- builtin/blame.c | 49 +++-- 1 file changed, 23 insertions(+), 26

[RFC PATCH v2 14/22] blame: move progess updates to a scoreboard callback

2017-05-13 Thread Jeff Smith
Allow the interface user to decide how to handle a progress update. Signed-off-by: Jeff Smith --- blame.h | 3 +++ builtin/blame.c | 24 ++-- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/blame.h b/blame.h index e85db06..a0bd91b 100644 --- a/blame.

[RFC PATCH v2 22/22] blame: create entry prepend function in libgit

2017-05-13 Thread Jeff Smith
Signed-off-by: Jeff Smith --- blame.c | 16 blame.h | 2 ++ builtin/blame.c | 11 +-- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/blame.c b/blame.c index f6c9cb7..00404b9 100644 --- a/blame.c +++ b/blame.c @@ -1845,3 +1845,19 @@ void

[RFC PATCH v2 12/22] blame: move no_whole_file_rename flag to scoreboard

2017-05-13 Thread Jeff Smith
The no_whole_file_rename flag is used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith --- blame.h | 1 + builtin/blame.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/blame.h b/bla

Re: [PATCH 0/3] interpret-trailers + commit -v bugfix

2017-05-13 Thread Brian Malehorn
> As I said, I'm a little iffy on doing this unconditionally, but it may > be the least-bad solution. I'd just worry about collateral damage to > somebody who doesn't use commit.verbose, but has something scissors-like > in their commit message. > > If you were to switch out is_scissors_line() fo

[PATCH] interpret-trailers: obey scissors lines

2017-05-13 Thread Brian Malehorn
If a commit message is being editted as "verbose", it will contain a scissors string ("-- >8 --") and a diff: my subject # >8 # Do not touch the line above. # Everything below will be removed. diff --git a/foo.txt b/foo.txt

checkout -b remotes/origin/ should not work

2017-05-13 Thread Stefan Beller
NEEDSWORK: checkout -b remotes/origin/ should not work, unless force is given (maybe?) (I just run into that, now I have a remote tracking branch that points at my detached HEAD. Oh well.)

Re: [PATCH] interpret-trailers: obey scissors lines

2017-05-13 Thread Jeff King
On Sat, May 13, 2017 at 08:39:23PM -0700, Brian Malehorn wrote: > If a commit message is being editted as "verbose", it will contain a > scissors string ("-- >8 --") and a diff: > > my subject > > # >8 > # Do not touch the line above.

Re: checkout -b remotes/origin/ should not work

2017-05-13 Thread Jeff King
On Sat, May 13, 2017 at 08:52:37PM -0700, Stefan Beller wrote: > NEEDSWORK: > > checkout -b remotes/origin/ should not work, unless force is > given (maybe?) > > (I just run into that, now I have a remote tracking branch that points > at my detached HEAD. Oh well.) To be pedantic, you have a lo

[PATCH 07/19] diff.c: convert fn_out_consume to use emit_line_*

2017-05-13 Thread Stefan Beller
In a later patch, I want to propose an option to detect&color moved lines in a diff, which cannot be done in a one-pass over the diff. Instead we need to go over the whole diff twice, because we cannot detect the first line of the two corresponding lines (+ and -) that got moved. So to prepare the

  1   2   >