Re: [PATCH v5 5/5] clean: improve performance when removing lots of directories

2015-04-28 Thread erik elfström
On Tue, Apr 28, 2015 at 8:24 AM, Jeff King wrote: > > This iteration looks reasonable overall to me. > > Should this is_git_repository() helper be available to other files? I > think there are other calls to resolve_gitlink_ref() that would want the > same treatment (e.g., I think "git status" may

Re: [PATCH v5 5/5] clean: improve performance when removing lots of directories

2015-04-27 Thread Jeff King
On Sun, Apr 26, 2015 at 08:49:45AM +0200, Erik Elfström wrote: > +/* > + * Return 1 if the given path is the root of a git repository or > + * submodule else 0. Will not return 1 for bare repositories with the > + * exception of creating a bare repository in "foo/.git" and calling > + * is_git_rep

[PATCH v5 5/5] clean: improve performance when removing lots of directories

2015-04-25 Thread Erik Elfström
"git clean" uses resolve_gitlink_ref() to check for the presence of nested git repositories, but it has the drawback of creating a ref_cache entry for every directory that should potentially be cleaned. The linear search through the ref_cache list causes a massive performance hit for large number o