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

[PATCH] Add comments to update_tree_entry()

From
APAndy Parkins <andyparkins@gmail.com>
Date
Dec 11, 2006, 22:13 UTC
Message-ID
<200612112213.11829.andyparkins@gmail.com>
In-Reply-To
<f323e83a37efd3b913004666f2fc104578a92833.1165875140.git.andyparkins@gmail.com>
Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
 tree-walk.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/tree-walk.c b/tree-walk.c
index 14cc5ae..5363366 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -37,6 +37,11 @@ static void entry_extract(struct tree_desc *t, struct name_entry *a)
 
 void update_tree_entry(struct tree_desc *desc)
 {
+	/* Each tree is represented by a buffer containing hashes followed
+	 * by space followed by filename; separated with NUL.  To move to the
+	 * next entry we simply move forward by strlen() (which skips the filename)
+	 * then skip the hash and the space. */
+	/* This function should really be called skip_tree_entry() */
 	const void *buf = desc->buf;
 	unsigned long size = desc->size;
 	int len = strlen(buf) + 1 + 20;
-- 
1.4.4.1.geeee8
Previous: Andy Parkins
Message 3 of 3 in “Comment -p mode for cat-file”
  1. Comment -p mode for cat-fileAndy Parkins, Dec 11, 2006
  2. Comment diff_treeAndy Parkins, Dec 11, 2006
  3. Add comments to update_tree_entry()Andy Parkins, Dec 11, 2006

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.