OSDN Git Service

Merge branch 'nd/untracked-cache'
authorJunio C Hamano <gitster@pobox.com>
Tue, 26 May 2015 20:24:45 +0000 (13:24 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 May 2015 20:24:46 +0000 (13:24 -0700)
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()
  ...

1  2 
Documentation/git-status.txt
Makefile
builtin/commit.c
builtin/update-index.c
cache.h
compat/mingw.h
dir.c
dir.h
git-compat-util.h
read-cache.c
wt-status.c

Simple merge
diff --cc Makefile
Simple merge
Simple merge
Simple merge
diff --cc cache.h
Simple merge
diff --cc compat/mingw.h
Simple merge
diff --cc dir.c
--- 1/dir.c
--- 2/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";
-               add_excludes_from_file(dir, excludes_file);
 +
 +      /* 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_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)
diff --cc dir.h
Simple merge
Simple merge
diff --cc read-cache.c
Simple merge
diff --cc wt-status.c
Simple merge