From: Junio C Hamano Date: Tue, 26 May 2015 20:24:45 +0000 (-0700) Subject: Merge branch 'nd/untracked-cache' X-Git-Tag: v2.5.0-rc0~74 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/38ccaf93bbf5a99dbff908068292ffaa5bafe25e Merge branch 'nd/untracked-cache' Teach the index to optionally remember already seen untracked files to speed up "git status" in a working tree with tons of cruft. * nd/untracked-cache: (24 commits) git-status.txt: advertisement for untracked cache untracked cache: guard and disable on system changes mingw32: add uname() t7063: tests for untracked cache update-index: test the system before enabling untracked cache update-index: manually enable or disable untracked cache status: enable untracked cache untracked-cache: temporarily disable with $GIT_DISABLE_UNTRACKED_CACHE untracked cache: mark index dirty if untracked cache is updated untracked cache: print stats with $GIT_TRACE_UNTRACKED_STATS untracked cache: avoid racy timestamps read-cache.c: split racy stat test to a separate function untracked cache: invalidate at index addition or removal untracked cache: load from UNTR index extension untracked cache: save to an index extension ewah: add convenient wrapper ewah_serialize_strbuf() untracked cache: don't open non-existent .gitignore untracked cache: mark what dirs should be recursed/saved untracked cache: record/validate dir mtime and reuse cached output untracked cache: make a wrapper around {open,read,close}dir() ... --- 38ccaf93bbf5a99dbff908068292ffaa5bafe25e diff --cc dir.c index 4183acc082,e9eaf97efe..d318ffcb2a --- a/dir.c +++ b/dir.c @@@ -12,7 -12,8 +12,9 @@@ #include "refs.h" #include "wildmatch.h" #include "pathspec.h" +#include "utf8.h" + #include "varint.h" + #include "ewah/ewok.h" struct path_simplify { int len; @@@ -1671,19 -2141,20 +2190,21 @@@ int remove_dir_recursively(struct strbu void setup_standard_excludes(struct dir_struct *dir) { const char *path; - char *xdg_path; dir->exclude_per_dir = ".gitignore"; + + /* core.excludefile defaulting to $XDG_HOME/git/ignore */ + if (!excludes_file) + excludes_file = xdg_config_home("ignore"); + if (excludes_file && !access_or_warn(excludes_file, R_OK, 0)) - add_excludes_from_file(dir, excludes_file); ++ add_excludes_from_file_1(dir, excludes_file, ++ dir->untracked ? &dir->ss_excludes_file : NULL); + + /* per repository user preference */ path = git_path("info/exclude"); - if (!excludes_file) { - home_config_paths(NULL, &xdg_path, "ignore"); - excludes_file = xdg_path; - } if (!access_or_warn(path, R_OK, 0)) - add_excludes_from_file(dir, path); + add_excludes_from_file_1(dir, path, + dir->untracked ? &dir->ss_info_exclude : NULL); - if (excludes_file && !access_or_warn(excludes_file, R_OK, 0)) - add_excludes_from_file_1(dir, excludes_file, - dir->untracked ? &dir->ss_excludes_file : NULL); } int remove_path(const char *name)