git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] diff: use filespec as in-place size cache

From
Junio C Hamano <junkio@cox.net>
Date
May 6, 2007, 08:51 UTC
Message-ID
<7vfy6acp32.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vr6pucp9e.fsf@assigned-by-dhcp.cox.net>

When we have a filespec primed with size, later size_only request should be fillable without recomputing it.

---
diff --git a/diff.c b/diff.c
index 0f8c68f..fb3eba5 100644
--- a/diff.c
+++ b/diff.c
@@ -1515,6 +1515,9 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
 	if (s->data)
 		return err;
 
+	if (size_only && 0 < s->size)
+		return err;
+
 	if (S_ISDIRLNK(s->mode))
 		return diff_populate_gitlink(s, size_only);
 
Previous: Junio C HamanoNext: Nicolas Pitre
Message 3 of 6 in “diff: release blobs after generating textual diff.”
  1. diff: release blobs after generating textual diff.Junio C Hamano, May 6, 2007
  2. diff.c: truly honor size_only request for populate_filespec.Junio C Hamano, May 6, 2007
  3. diff: use filespec as in-place size cacheJunio C Hamano, May 6, 2007
  4. Nicolas PitreMay 6, 2007
  5. Robin RosenbergMay 6, 2007
  6. Junio C HamanoMay 8, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.