Skip to content

nd/untracked-cache updates

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest24 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/24dir.c: optionally compute sha-1 of a .gitignore filedir.c dir.h+53 -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+213 -00 replies
11/24untracked cache: load from UNTR index extensiondir.c dir.h read-cache.c+226 -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+174 -00 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 -10 replies

Reviews trailers per patch

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

PatchStefan BellerJunio 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/24Helped-by
11/24
12/24
13/24
14/24
15/24
16/24
17/24
18/24
19/24
20/24Helped-by Helped-by
21/24
22/24Helped-by
23/24Helped-by Helped-by Helped-by
24/24Helped-by

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

Read the v1 thread

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

Compared to 'pu', this fixes two bugs (in 01/24 and 10/24) and one style vololation (in 11/24), found by Junio and Stefan. Diff

-- 8< --

dir.c +11 -8
index b8a4f9e..8a037ee 100644
@@ -687,7 +687,8 @@ static int add_excludes(const char *fname, const char *base, int baselen,
 			else if (check_index &&
 				 (pos = cache_name_pos(fname, strlen(fname))) >= 0 &&
 				 !ce_stage(active_cache[pos]) &&
-				 ce_uptodate(active_cache[pos]))
+				 ce_uptodate(active_cache[pos]) &&
+				 !would_convert_to_git(fname, NULL, 0, 0))
 				hashcpy(sha1_stat->sha1, active_cache[pos]->sha1);
 			else
 				hash_sha1_file(buf, size, "blob", sha1_stat->sha1);
@@ -2308,6 +2309,9 @@ void write_untracked_extension(struct strbuf *out, struct untracked_cache *untra
 	strbuf_add(out, untracked->ident.buf, untracked->ident.len);
 
 	strbuf_add(out, ouc, ouc_size(len));
+	free(ouc);
+	ouc = NULL;
+
 	if (!untracked->root) {
 		varint_len = encode_varint(0, varbuf);
 		strbuf_add(out, varbuf, varint_len);
@@ -2388,11 +2392,6 @@ static void stat_data_from_disk(struct stat_data *to, const struct stat_data *fr
 static int read_one_dir(struct untracked_cache_dir **untracked_,
 			struct read_data *rd)
 {
-#define NEXT(x) \
-	next = data + (x); \
-	if (next > rd->end) \
-		return -1;
-
 	struct untracked_cache_dir ud, *untracked;
 	const unsigned char *next, *data = rd->data, *end = rd->end;
 	unsigned int value;
@@ -2419,7 +2418,9 @@ static int read_one_dir(struct untracked_cache_dir **untracked_,
 	data = next;
 
 	len = strlen((const char *)data);
-	NEXT(len + 1);
+	next = data + len + 1;
+	if (next > rd->end)
+		return -1;
 	*untracked_ = untracked = xmalloc(sizeof(*untracked) + len);
 	memcpy(untracked, &ud, sizeof(ud));
 	memcpy(untracked->name, data, len + 1);
@@ -2427,7 +2428,9 @@ static int read_one_dir(struct untracked_cache_dir **untracked_,
 
 	for (i = 0; i < untracked->untracked_nr; i++) {
 		len = strlen((const char *)data);
-		NEXT(len + 1);
+		next = data + len + 1;
+		if (next > rd->end)
+			return -1;
 		untracked->untracked[i] = xstrdup((const char*)data);
 		data = next;
 	}

-- 8< --

Signature · 1 line
2.3.0.rc1.137.g477eb31