Re: [PATCH v2] dir.c: ignore paths containing .git when invalidating untracked cache

2018-02-14 Thread Junio C Hamano
On Tue, Feb 13, 2018 at 5:24 PM, Duy Nguyen wrote: > I am worried that always doing the right thing may carry performance > penalty (this is based purely on reading verify_path() code, no actual > benchmarking). For safety, you can always set safe_path to zero. But > if you do

Re: [PATCH v2] dir.c: ignore paths containing .git when invalidating untracked cache

2018-02-13 Thread Duy Nguyen
On Wed, Feb 14, 2018 at 12:57 AM, Junio C Hamano wrote: > Duy Nguyen writes: > >> It's very tempting considering that the amount of changes is much >> smaller. But I think we should go with my version. The hope is when a >> _new_ call site appears, the

Re: [PATCH v2] dir.c: ignore paths containing .git when invalidating untracked cache

2018-02-13 Thread Junio C Hamano
Duy Nguyen writes: > It's very tempting considering that the amount of changes is much > smaller. But I think we should go with my version. The hope is when a > _new_ call site appears, the author would think twice before passing > zero or one to the safe_path argument.

Re: [PATCH v2] dir.c: ignore paths containing .git when invalidating untracked cache

2018-02-13 Thread Duy Nguyen
On Wed, Feb 7, 2018 at 11:59 PM, Ben Peart wrote: > diff --git a/dir.c b/dir.c > index 7c4b45e30e..d431da46f5 100644 > --- a/dir.c > +++ b/dir.c > @@ -1773,7 +1773,7 @@ static enum path_treatment treat_path(struct > dir_struct *dir, > if (!de) > return

Re: [PATCH v2] dir.c: ignore paths containing .git when invalidating untracked cache

2018-02-07 Thread Ben Peart
On 2/7/2018 4:21 AM, Nguyễn Thái Ngọc Duy wrote: read_directory() code ignores all paths named ".git" even if it's not a valid git repository. See treat_path() for details. Since ".git" is basically invisible to read_directory(), when we are asked to invalidate a path that contains ".git", we

[PATCH v2] dir.c: ignore paths containing .git when invalidating untracked cache

2018-02-07 Thread Nguyễn Thái Ngọc Duy
read_directory() code ignores all paths named ".git" even if it's not a valid git repository. See treat_path() for details. Since ".git" is basically invisible to read_directory(), when we are asked to invalidate a path that contains ".git", we can safely ignore it because the slow path would not

[PATCH v2] dir.c: ignore paths containing .git when invalidating untracked cache

2018-02-07 Thread Nguyễn Thái Ngọc Duy
read_directory() code ignores all paths named ".git" even if it's not a valid git repository. See treat_path() for details. Since ".git" is basically invisible to read_directory(), when we are asked to invalidate a path that contains ".git", we can safely ignore it because the slow path would not