Re: [PATCH v8 4/5] dir_iterator: refactor state machine model

2017-04-16 Thread Michael Haggerty
On 04/06/2017 03:39 AM, Daniel Ferreira wrote: > Perform major refactor of dir_iterator_advance(). dir_iterator has > ceased to rely on a convoluted state machine mechanism of two loops and > two state variables (level.initialized and level.dir_state). This serves > to ease comprehension of the ite

Re: [PATCH v8 0/5] [GSoC] remove_subtree(): reimplement using iterators

2017-04-16 Thread Michael Haggerty
On 04/06/2017 03:39 AM, Daniel Ferreira wrote: > This is the seventh version of a patch series that implements the GSoC > microproject of converting a recursive call to readdir() to use dir_iterator. > > v1: > https://public-inbox.org/git/CAGZ79kZwT-9mHTiOJ5CEjk2wDFkn6+NcogjX0=vjhsah16a...@mail.g

Re: [PATCH 07/18] avoid using fixed PATH_MAX buffers for refs

2017-04-16 Thread Junio C Hamano
Jeff King writes: > diff --git a/builtin/replace.c b/builtin/replace.c > index f83e7b8fc..065515bab 100644 > --- a/builtin/replace.c > +++ b/builtin/replace.c > @@ -93,26 +93,31 @@ typedef int (*each_replace_name_fn)(const char *name, > const char *ref, > static int for_each_replace_name(const

Re: [PATCH] __git_ps1: Don't kill shell if user types `set -e`

2017-04-16 Thread Junio C Hamano
"Tom \"Ravi\" Hale" writes: > If a user types `set -e` in an interactive shell, and is using __git_ps1 > to set > their prompt, the shell will die if the current directory isn't inside a git > repository. > > This is because `set -e` instructs the shell to exit upon a command > returning a non-ze

Re: [PATCH 3/3] rebase: pass --[no-]signoff option to git am

2017-04-16 Thread Junio C Hamano
Giuseppe Bilotta writes: > Damnit! I just realized that I forgot to amend before the format-patch: > > On Sat, Apr 15, 2017 at 4:41 PM, Giuseppe Bilotta > wrote: > >> +signoff! passed to 'git am' > > This should be without the ! or --no-signoff is not accepted. Do I > need to resend or

Re: Index files autocompletion too slow in big repositories (w / suggestion for improvement)

2017-04-16 Thread Junio C Hamano
Johannes Sixt writes: > Cc Gábor. > > Am 15.04.2017 um 00:33 schrieb Ævar Arnfjörð Bjarmason: >> On Sat, Apr 15, 2017 at 12:08 AM, Carlos Pita >> wrote: >>> This is much faster (below 0.1s): >>> >>> __git_index_files () >>> { >>> local dir="$(__gitdir)" root="${2-.}" file; >>> if [ -d "

Re: [PATCH] push: document & test --force-with-lease with multiple remotes

2017-04-16 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > Document & test for cases where there are two remotes pointing to the > same URL, and a background fetch & subsequent `git push > --force-with-lease` shouldn't clobber un-updated references we haven't > fetched. > > Some editors like Microsoft's VSC have a featu

Re: [PATCH v5 4/8] convert: Separate generic structures and variables from the filter specific ones

2017-04-16 Thread Junio C Hamano
Lars Schneider writes: >> -static struct cmd2process *find_multi_file_filter_entry(struct hashmap >> *hashmap, const char *cmd) >> +static struct subprocess_entry *find_multi_file_filter_entry(const char >> *cmd) > > I am curious why you removed the hashmap parameter (here and in other pars of

Re: [PATCH] submodule: prevent backslash expantion in submodule names

2017-04-16 Thread Junio C Hamano
Jeff King writes: > The reason I mentioned escaping earlier is I wondered what would happen > when the submodule starts with a double-quote, or has a newline in the > name. Git's normal quoting would include backslash escape sequences, and > I wondered if we might be relying on any of these "read

Re: [PATCH 2/2] config: handle conditional include when $GIT_DIR is not set up

2017-04-16 Thread Duy Nguyen
On Sun, Apr 16, 2017 at 11:51:32AM -0400, Jeff King wrote: > > diff --git a/cache.h b/cache.h > > index e29a093839..27b7286f99 100644 > > --- a/cache.h > > +++ b/cache.h > > @@ -1884,6 +1884,8 @@ enum config_origin_type { > > > > struct config_options { > > unsigned int respect_includes : 1;

Re: [PATCH v3 1/2] Fix nonnull errors reported by UBSAN with GCC 7.

2017-04-16 Thread Junio C Hamano
Martin Liška writes: > From 0bdf4d717d3d368dd9676d15d20f8592c4d22fde Mon Sep 17 00:00:00 2001 > From: marxin > Date: Wed, 5 Apr 2017 14:31:32 +0200 > Subject: [PATCH 1/2] Fix nonnull errors reported by UBSAN with GCC 7. > > Replace call to memmove with newly introduced function memmove_or_null >

Re: [PATCH 1/2] config: prepare to pass more info in git_config_with_options()

2017-04-16 Thread Duy Nguyen
On Sun, Apr 16, 2017 at 11:31:28AM -0400, Jeff King wrote: > On Sun, Apr 16, 2017 at 05:41:24PM +0700, Nguyễn Thái Ngọc Duy wrote: > > > So far we can only pass one flag, respect_includes, to thie function. We > > need to pass some more (non-flag even), so let's make it accept a struct > > instead

Re: [PATCH] sha1_file: remove an used fd variable

2017-04-16 Thread Jeff King
On Sun, Apr 16, 2017 at 07:04:01PM +, Sebastian Schuberth wrote: > Signed-off-by: Sebastian Schuberth > --- > sha1_file.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/sha1_file.c b/sha1_file.c > index 7106389..9ecf71f 100644 > --- a/sha1_file.c > +++ b/sha1_file.c > @@ -3970,7

Re: [PATCH] server-info: avoid calling fclose(3) twice in update_info_file()

2017-04-16 Thread Jeff King
On Sun, Apr 16, 2017 at 06:55:58PM +0200, René Scharfe wrote: > If an error occurs when or after closing the stream we call fclose(3) > again in the error handler. The second call can exhibit undefined > behavior, so make sure to call fclose(3) at most once. Yikes. Good catch. > Also avoid > ca

Re: [PATCH v4 0/5] Kill manual ref parsing code in worktree.c

2017-04-16 Thread Junio C Hamano
Duy Nguyen writes: > This is embarassing. I worked on and off on this series over a long > period of time. I guess at the end I thought everything was ok "since > the last time" and just sent it away without realizing I hadn't > actually run the test suite, because it does fail here, now. > > Thi

Re: [PATCH] connect.c: handle errors from split_cmdline

2017-04-16 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > On Tue, Apr 11, 2017 at 12:54 PM, Jeff King wrote: >> On Tue, Apr 11, 2017 at 11:27:57AM +0200, Ævar Arnfjörð Bjarmason wrote: >> >>> Junio: If you're not in some rush to pick this up I'll take this, fix >>> up a bunch of other bugs & tests failures on odd --roo

Re: [PATCH] connect.c: handle errors from split_cmdline

2017-04-16 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: >> That's fine by me. We may want to pick up the segfault one separately >> (though I don't think it's security-interesting). > > Up to you, but in case it's less work for you & Junio I already have > it in my branch of fallout from this series/discussion, so if it

Re: [PATCH] Make git log work for git CWD outside of work tree

2017-04-16 Thread Junio C Hamano
Jeff King writes: >> cwd with prefix. I was kinda hoping "super prefix" would solve it, but >> that one seems designed specifically for submodules. > > Ah, right. I think the issue is that "prefix" really serves two uses. > For things like command-line arguments, we use to find the original path

Re: Feature request: --format=json

2017-04-16 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > On Sat, Apr 8, 2017 at 6:07 PM, Fred .Flintstone wrote: >> $ git log --format=json >> [{ >> "commit": "64eabf050e315a4c7a11e0c05ca163be7cf9075e", >> "tree": "b1e977800f40bbf6de906b1fe4f2de4b4b14f0fd", >> "author": "Tux 1490981516 +0200", >> "com

Re: What's cooking in git.git (Apr 2017, #02; draft as of Sat, 15)

2017-04-16 Thread Junio C Hamano
Duy Nguyen writes: >> * nd/worktree-add-lock (2017-04-15) 2 commits >> - SQUASH??? >> - worktree add: add --lock option >> > > Allow to lock a workktree immediately after it's created. This helps > prevent a race between "git worktree add; git worktree lock" and "git > worktree prune". Thanks.

Re: [PATCH 01/12] grep: add ability to disable threading with --threads=0 or grep.threads=0

2017-04-16 Thread Ævar Arnfjörð Bjarmason
On Fri, Apr 14, 2017 at 11:23 PM, Jeff King wrote: > On Tue, Apr 11, 2017 at 10:56:01PM +0200, Ævar Arnfjörð Bjarmason wrote: > >> > Right, my suggestion was to teach "grep" to treat --threads=1 as "do not >> > spawn any other threads". I.e., to make it like the "0" case you were >> > proposing, a

[PATCH v2 4/8] grep: skip pthreads overhead when using one thread

2017-04-16 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/8] tests: add a PTHREADS prerequisite

2017-04-16 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 6/8] pack-object & index-pack: add test for --threads warning under NO_PTHREADS

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

[PATCH v2 7/8] pack-objects: fix buggy warning about threads under NO_PTHREADS=YesPlease

2017-04-16 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 8/8] grep: given --threads with NO_PTHREADS=YesPlease, warn

2017-04-16 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 3/8] grep: don't redundantly compile throwaway patterns under threading

2017-04-16 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 2/8] grep: add tests for --threads=N and grep.threads

2017-04-16 Thread Ævar Arnfjörð Bjarmason
Add tests for when --threads=N is supplied on the command-line or when grep.threads is 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 for it

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

2017-04-16 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 0/8] grep threading cleanup & tests

2017-04-16 Thread Ævar Arnfjörð Bjarmason
This is the spiritual successor to the "grep: add ability to disable threading with --threads=0 or grep.threads=0" patch I submitted as part of my PCRE series (<20170408132506.5415-2-ava...@gmail.com>). There's a long back & forth thread between me and Jeff King as a follow-up to that which I'll s

Re: [PATCH] Documentation/git-checkout: make doc. of checkout clearer

2017-04-16 Thread Christoph Michelbach
On Sun, 2017-04-16 at 22:25 +0100, Philip Oakley wrote: > From: "Christoph Michelbach" > > It's: git checkout [-p|--patch] [] [--] ... > The one I quoted is direct from the Synopsis, which does indicate > there are  > potentially more aspects to resolve, such as the influence of using > the  > [-p

Re: [PATCH] Documentation/git-checkout: make doc. of checkout clearer

2017-04-16 Thread Philip Oakley
From: "Christoph Michelbach" On Sun, 2017-04-16 at 19:03 +0100, Philip Oakley wrote: From: "Christoph Michelbach" > > On Sun, 2017-04-16 at 00:28 +0100, Philip Oakley wrote: > > > > From: "Christoph Michelbach" > > > > > > > > > While technically in the documentation, the fact that changes >

[PATCH] sha1_file: remove an used fd variable

2017-04-16 Thread Sebastian Schuberth
Signed-off-by: Sebastian Schuberth --- sha1_file.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index 7106389..9ecf71f 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -3970,7 +3970,6 @@ int read_loose_object(const char *path, void **contents)

Re: [PATCH] Documentation/git-checkout: make doc. of checkout clearer

2017-04-16 Thread Christoph Michelbach
On Sun, 2017-04-16 at 19:03 +0100, Philip Oakley wrote: > From: "Christoph Michelbach" > > > > On Sun, 2017-04-16 at 00:28 +0100, Philip Oakley wrote: > > > > > > From: "Christoph Michelbach" > > > > > > > > > > > > While technically in the documentation, the fact that changes > > > > introdu

Re: [BUG] ls-files '**' globstar matches one or more directories instead of zero or more directories

2017-04-16 Thread Alistair Buxton
On IRC someone pointed me to the glossary section for pathspec, and I find that even more confusing. In the section about ":(glob)" it says: > For example, "**/foo" matches file or directory "foo" anywhere, the same as > pattern "foo". This is not true for ls-files: ":(glob)**/.gitignore" is co

Re: [PATCH] Documentation/git-checkout: make doc. of checkout clearer

2017-04-16 Thread Philip Oakley
From: "Christoph Michelbach" On Sun, 2017-04-16 at 00:28 +0100, Philip Oakley wrote: From: "Christoph Michelbach" > > While technically in the documentation, the fact that changes > introduced by a checkout are staged automatically, was > not obvious when reading its documentation. It is now

[PATCH] files_for_each_reflog_ent_reverse(): close stream and free strbuf on error

2017-04-16 Thread René Scharfe
Exit the loop orderly through the cleanup code, instead of dashing out with logfp still open and sb leaking. Found with Cppcheck. Signed-off-by: Rene Scharfe --- refs/files-backend.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/refs/files-backend.c b

[PATCH] server-info: avoid calling fclose(3) twice in update_info_file()

2017-04-16 Thread René Scharfe
If an error occurs when or after closing the stream we call fclose(3) again in the error handler. The second call can exhibit undefined behavior, so make sure to call fclose(3) at most once. Also avoid calling close(2) after fd has been successfully associated with the stream, as fclose(3) has be

[PATCH] am: close stream on error, but not stdin

2017-04-16 Thread René Scharfe
Avoid closing stdin, but do close an actual input file on error exit. Found with Cppcheck. Signed-off-by: Rene Scharfe --- builtin/am.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index f7a7a971fb..805f56cec2 100644 --- a/builtin/am.c

Re: [BUG] ls-files '**' globstar matches one or more directories instead of zero or more directories

2017-04-16 Thread Alistair Buxton
On 16 April 2017 at 12:25, Duy Nguyen wrote: > git ls-files ':(glob)**/*' > > Without that '**' is a normal '*' and matching just subdirs is expected. But '*/' should match exactly one subdirectory deep. Instead it matches one more more subdirectories. Meaning it behaves the way '**/*/' should.

Re: [PATCH 2/2] config: handle conditional include when $GIT_DIR is not set up

2017-04-16 Thread Jeff King
On Sun, Apr 16, 2017 at 05:41:25PM +0700, Nguyễn Thái Ngọc Duy wrote: > If setup_git_directory() and friends have not been called, > get_git_dir() (because of includeIf.gitdir:XXX) would lead to > > die("BUG: setup_git_env called without repository"); > > There are two cases when a config fi

Re: [PATCH 1/2] config: prepare to pass more info in git_config_with_options()

2017-04-16 Thread Jeff King
On Sun, Apr 16, 2017 at 05:41:24PM +0700, Nguyễn Thái Ngọc Duy wrote: > So far we can only pass one flag, respect_includes, to thie function. We > need to pass some more (non-flag even), so let's make it accept a struct > instead of an integer. Yeah, this makes sense. But... > diff --git a/built

Re: [PATCH v1] travis-ci: add static analysis build job to run coccicheck

2017-04-16 Thread Sebastian Schuberth
On 2017-04-11 09:26, Lars Schneider wrote: Add a dedicated build job for static analysis. As a starter we only run coccicheck but in the future we could run Clang Static Analyzer or similar tools, too. Just FYI, some time ago someone (I don't recall who) signed up Git with Coverity's free sca

Re: [PATCH] Documentation/git-checkout: make doc. of checkout clearer

2017-04-16 Thread Christoph Michelbach
On Sun, 2017-04-16 at 00:28 +0100, Philip Oakley wrote: > From: "Christoph Michelbach" > > > > While technically in the documentation, the fact that changes > > introduced by a checkout are staged automatically, was > > not obvious when reading its documentation. It is now specifically > > point

Re: [BUG] ls-files '**' globstar matches one or more directories instead of zero or more directories

2017-04-16 Thread Duy Nguyen
On Sat, Apr 15, 2017 at 2:17 AM, Alistair Buxton wrote: > To reproduce, go to any git repository and run: > > diff <(git ls-files '**/*' | sort) <(git ls-files | sort) Actually the '**/' magic only kicks in if you write git ls-files ':(glob)**/*' Without that '**' is a normal '*' and matchi

Re: [BUG] ls-files '**' globstar matches one or more directories instead of zero or more directories

2017-04-16 Thread Duy Nguyen
On Sat, Apr 15, 2017 at 2:17 AM, Alistair Buxton wrote: > To reproduce, go to any git repository and run: > > diff <(git ls-files '**/*' | sort) <(git ls-files | sort) > > Expected result: No output since both commands should produce identical > output. > > Actual result: '**/*' only matches

Re: What's cooking in git.git (Apr 2017, #02; draft as of Sat, 15)

2017-04-16 Thread Duy Nguyen
On Sat, Apr 15, 2017 at 5:14 PM, Junio C Hamano wrote: > * nd/conditional-config-include (2017-04-14) 2 commits > - config: resolve symlinks in conditional include's patterns > - path.c: and an option to call real_path() in expand_user_path() > $GIT_DIR may in some cases be normalized with all

[PATCH 2/2] config: handle conditional include when $GIT_DIR is not set up

2017-04-16 Thread Nguyễn Thái Ngọc Duy
If setup_git_directory() and friends have not been called, get_git_dir() (because of includeIf.gitdir:XXX) would lead to die("BUG: setup_git_env called without repository"); There are two cases when a config file could be read before $GIT_DIR is located. The first one is check_repository_form

[PATCH 1/2] config: prepare to pass more info in git_config_with_options()

2017-04-16 Thread Nguyễn Thái Ngọc Duy
So far we can only pass one flag, respect_includes, to thie function. We need to pass some more (non-flag even), so let's make it accept a struct instead of an integer. Signed-off-by: Nguyễn Thái Ngọc Duy --- Prep patch for the bug fix in 2/2. builtin/config.c | 21 - cache

[PATCH] __git_ps1: Don't kill shell if user types `set -e`

2017-04-16 Thread Tom "Ravi" Hale
If a user types `set -e` in an interactive shell, and is using __git_ps1 to set their prompt, the shell will die if the current directory isn't inside a git repository. This is because `set -e` instructs the shell to exit upon a command returning a non-zero exit status, and the following command e

Business Proposal

2017-04-16 Thread QUATIF GROUP OF COMPANIES
Dear Friend, I would like to discuss a very important issue with you. I am writing to find out if this is your valid email. Please, let me know if this email is valid Kind regards Adrien Saif Attorney to Quatif Group of Companies