Skip to content

nd/untracked-cache update

Nguyễn Thái Ngọc Duy git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest24 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/24dir.c: optionally compute sha-1 of a .gitignore filedir.c dir.h+52 -70 replies
2/24untracked cache: record .gitignore information and dir hierarchydir.c dir.h+183 -190 replies
3/24untracked cache: initial untracked cache validationdir.c dir.h+114 -30 replies
4/24untracked cache: invalidate dirs recursively if .gitignore changesdir.c+17 -10 replies
5/24untracked cache: make a wrapper around {open,read,close}dir()dir.c+47 -80 replies
6/24untracked cache: record/validate dir mtime and reuse cached outputdir.c dir.h+121 -20 replies
7/24untracked cache: mark what dirs should be recursed/saveddir.c dir.h+15 -20 replies
8/24untracked cache: don't open non-existent .gitignoredir.c+25 -10 replies
9/24ewah: add convenient wrapper ewah_serialize_strbuf()ewah/ewah_io.c ewah/ewok.h split-index.c+17 -90 replies
10/24untracked cache: save to an index extensionDocumentation/technical/index-format.txt cache.h dir.c +2 more+210 -00 replies
11/24untracked cache: load from UNTR index extensiondir.c dir.h read-cache.c+227 -00 replies
12/24untracked cache: invalidate at index addition or removaldir.c dir.h read-cache.c +1 more+44 -20 replies
13/24read-cache.c: split racy stat test to a separate functionread-cache.c+15 -90 replies
14/24untracked cache: avoid racy timestampscache.h dir.c read-cache.c+12 -20 replies
15/24untracked cache: print stats with $GIT_TRACE_UNTRACKED_STATSdir.c+12 -00 replies
16/24untracked cache: mark index dirty if untracked cache is updatedcache.h dir.c read-cache.c+11 -10 replies
17/24untracked-cache: temporarily disable with $GIT_DISABLE_UNTRACKED_CACHEdir.c+1 -10 replies
18/24status: enable untracked cachebuiltin/commit.c wt-status.c+5 -20 replies
19/24update-index: manually enable or disable untracked cacheDocumentation/git-update-index.txt builtin/update-index.c+24 -00 replies
20/24update-index: test the system before enabling untracked cacheDocumentation/git-update-index.txt builtin/update-index.c+154 -06 replies
21/24t7063: tests for untracked cache.gitignore Makefile t/t7063-status-untracked-cache.sh +1 more+416 -00 replies
22/24mingw32: add uname()compat/mingw.c compat/mingw.h+20 -00 replies
23/24untracked cache: guard and disable on system changesDocumentation/technical/index-format.txt builtin/update-index.c dir.c +3 more+72 -70 replies
24/24git-status.txt: advertisement for untracked cacheDocumentation/git-status.txt+4 -11 reply

Reviews trailers per patch

None of the 24 patches has a Reviewed-by or Acked-by.

PatchJunio C HamanoTorsten BögershausenEric Sunshinebrian m. carlsonDavid TurnerRamsay Jones
1/24Helped-by Helped-by
2/24Helped-by Helped-by
3/24
4/24
5/24Helped-by
6/24Helped-by
7/24
8/24
9/24
10/24
11/24
12/24
13/24
14/24
15/24
16/24
17/24
18/24
19/24
20/24Helped-by
21/24
22/24Helped-by
23/24Helped-by Helped-by Helped-by
24/24

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v1 thread

Cover letter [PATCH 00/24] nd/untracked-cache update

Sorry for this really late update. This fixes bugs in extension writing code (10/24), support using the same cache from different hosts (23/24), and adds a new bug to point the user to untracked cache from 'git status -uno' (new patch 24/24)

Diff from 'pu'
-- 8< --

Documentation/git-status.txt +4 -1
index def635f..7850f53 100644
@@ -58,7 +58,10 @@ When `-u` option is not used, untracked files and directories are
 shown (i.e. the same as specifying `normal`), to help you avoid
 forgetting to add newly created files.  Because it takes extra work
 to find untracked files in the filesystem, this mode may take some
-time in a large working tree.  You can use `no` to have `git status`
+time in a large working tree.
+Consider to enable untracked cache and split index if supported (see
+`git update-index --untracked-cache` and `git update-index
+--split-index`), Otherwise you can use `no` to have `git status`
 return more quickly without showing untracked files.
 +
 The default can be changed using the status.showUntrackedFiles
Documentation/technical/index-format.txt +3 -2
index 5dc2bee..0045b89 100644
@@ -242,8 +242,9 @@ Git index format
 
   The extension starts with
 
-  - A NUL-terminated string describing the environment when the cache
-    is created.
+  - A sequence of NUL-terminated strings, preceded by the size of the
+    sequence in variable width encoding. Each string describes the
+    environment where the cache can be used.
 
   - Stat data of $GIT_DIR/info/exclude. See "Index entry" section from
     ctime field until "file size".
builtin/update-index.c +10 -6
index f23ec83..e76740d 100644
@@ -1083,7 +1083,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
 		the_index.split_index = NULL;
 		the_index.cache_changed |= SOMETHING_CHANGED;
 	}
-	if (untracked_cache > 0 && !the_index.untracked) {
+	if (untracked_cache > 0) {
 		struct untracked_cache *uc;
 
 		if (untracked_cache < 2) {
@@ -1091,11 +1091,15 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
 			if (!test_if_untracked_cache_is_supported())
 				return 1;
 		}
-		uc = xcalloc(1, sizeof(*uc));
-		uc->exclude_per_dir = ".gitignore";
-		/* should be the same flags used by git-status */
-		uc->dir_flags = DIR_SHOW_OTHER_DIRECTORIES | DIR_HIDE_EMPTY_DIRECTORIES;
-		the_index.untracked = uc;
+		if (!the_index.untracked) {
+			uc = xcalloc(1, sizeof(*uc));
+			strbuf_init(&uc->ident, 100);
+			uc->exclude_per_dir = ".gitignore";
+			/* should be the same flags used by git-status */
+			uc->dir_flags = DIR_SHOW_OTHER_DIRECTORIES | DIR_HIDE_EMPTY_DIRECTORIES;
+			the_index.untracked = uc;
+		}
+		add_untracked_ident(the_index.untracked);
 		the_index.cache_changed |= UNTRACKED_CHANGED;
 	} else if (!untracked_cache && the_index.untracked) {
 		the_index.untracked = NULL;
dir.c +57 -30

151 lines not on this page · raw message

dir.h +2 -0
index 2ce7dd3..6ccbc45 100644
@@ -127,6 +127,7 @@ struct untracked_cache {
 	struct sha1_stat ss_info_exclude;
 	struct sha1_stat ss_excludes_file;
 	const char *exclude_per_dir;
+	struct strbuf ident;
 	/*
 	 * dir_struct#flags must match dir_flags or the untracked
 	 * cache is ignored.
@@ -305,4 +306,5 @@ void untracked_cache_add_to_index(struct index_state *, const char *);
 void free_untracked_cache(struct untracked_cache *);
 struct untracked_cache *read_untracked_extension(const void *data, unsigned long sz);
 void write_untracked_extension(struct strbuf *out, struct untracked_cache *untracked);
+void add_untracked_ident(struct untracked_cache *);
 #endif

-- 8< --

Signature · 1 line
2.2.0.84.ge9c7a8a