Re: Fix "git commit directory/" performance anomaly

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: Fix "git commit directory/" performance anomaly

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:28

Linus Torvalds [off-list ref] writes:
This trivial patch avoids re-hashing files that are already clean in the 
index. This mirrors what commit 0781b8a9b2fe760fc4ed519a3a26e4b9bd6ccffe 
did for "git add .", only for "git commit ." instead.
Makes sense.  Thanks.

Re: Fix "git commit directory/" performance anomaly

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:43:28


On Fri, 10 Aug 2007, Junio C Hamano wrote:
Linus Torvalds [off-list ref] writes:
quoted
This trivial patch avoids re-hashing files that are already clean in the 
index. This mirrors what commit 0781b8a9b2fe760fc4ed519a3a26e4b9bd6ccffe 
did for "git add .", only for "git commit ." instead.
Makes sense.  Thanks.
Please don't apply that patch without this trivial fix.

I don't know why I didn't notice. It passed all the tests, but it really 
shouldn't have, and the compiler warned.

		Linus

---
diff --git a/builtin-update-index.c b/builtin-update-index.c
index 8d22dfa..a7a4574 100644
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
@@ -91,7 +91,7 @@ static int add_one_path(struct cache_entry *old, const char *path, int len, stru
 
 	/* Was the old index entry already up-to-date? */
 	if (old && !ce_stage(old) && !ce_match_stat(old, st, 0))
-		return;
+		return 0;
 
 	size = cache_entry_size(len);
 	ce = xcalloc(1, size);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help