Junio C Hamano [off-list ref] writes:
Linus Torvalds [off-list ref] writes:
quoted
I'd have to see both patches to be able to tell. I do admit that while I
acked your patch, it sure ain't _pretty_ to do that special odd
"has_leading_ignored_dir()" thing.
Revised patch (v4) series is coming shortly.
Having sent these patches, I am wondering if the simplest fix might be this
one-liner.
diff --git a/dir.c b/dir.c
index d0999ba..7fba335 100644
--- a/dir.c
+++ b/dir.c
@@ -788,3 +788,3 @@ int read_directory(struct dir_struct *dir, const char *path, int len, const char
simplify = create_simplify(pathspec);
- read_directory_recursive(dir, path, len, 0, simplify);
+ read_directory_recursive(dir, "", 0, 0, simplify);
free_simplify(simplify);
What my series does is to keep all the "depending on dir->flags and what
excluded() says for path, decide to recurse, add it to dir->ignored[],
etc." logic and optimize only the readdir() loop, pretending as if it
returned only the entry on the "common prefix" path and nothing else, as
we know all other paths will be skipped by either simplified away or
filtered by in_pathspec() check.
If the directories we are reading are not humongous, maybe using this much
simpler patch might be preferrable (although it is completely untested).
On Sat, 9 Jan 2010, Junio C Hamano wrote:
quoted hunk
Having sent these patches, I am wondering if the simplest fix might be this
one-liner.
diff --git a/dir.c b/dir.c
index d0999ba..7fba335 100644
--- a/dir.c
+++ b/dir.c
@@ -788,3 +788,3 @@ int read_directory(struct dir_struct *dir, const char *path, int len, const char
simplify = create_simplify(pathspec);
- read_directory_recursive(dir, path, len, 0, simplify);
+ read_directory_recursive(dir, "", 0, 0, simplify);
free_simplify(simplify);
That one-liner doesn't work at all for me.
Lookie here:
[torvalds@nehalem linux]$ touch drivers/char/hello.c
[torvalds@nehalem linux]$ ~/git/git ls-files --exclude-standard -o drivers/char
[torvalds@nehalem linux]$ git ls-files --exclude-standard -o drivers/char
drivers/char/hello.c
where that ~/git/git is the version with the one-liner.
IOW, it now ignores _everything_, because the dir and the path don't
match.
Linus
Linus Torvalds [off-list ref] writes:
On Sat, 9 Jan 2010, Junio C Hamano wrote:
quoted
Having sent these patches, I am wondering if the simplest fix might be this
one-liner.
diff --git a/dir.c b/dir.c
index d0999ba..7fba335 100644
--- a/dir.c
+++ b/dir.c
@@ -788,3 +788,3 @@ int read_directory(struct dir_struct *dir, const char *path, int len, const char
simplify = create_simplify(pathspec);
- read_directory_recursive(dir, path, len, 0, simplify);
+ read_directory_recursive(dir, "", 0, 0, simplify);
free_simplify(simplify);
That one-liner doesn't work at all for me.
...
IOW, it now ignores _everything_, because the dir and the path don't
match.
Hmph, you are right. The real series is not equivalent to the one-liner
at all.