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

[PATCH] Comment -p mode for cat-file

From
APAndy Parkins <andyparkins@gmail.com>
Date
Dec 11, 2006, 22:13 UTC
Message-ID
<200612112213.00737.andyparkins@gmail.com>
In-Reply-To
<f323e83a37efd3b913004666f2fc104578a92833.1165875140.git.andyparkins@gmail.com>
Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
 builtin-cat-file.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/builtin-cat-file.c b/builtin-cat-file.c
index 6c16bfa..e7997ee 100644
--- a/builtin-cat-file.c
+++ b/builtin-cat-file.c
@@ -121,12 +121,16 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
 			die("Not a valid object name %s", argv[2]);
 
 		/* custom pretty-print here */
+		/* Special print tree types using ls-tree
+		 *  git-ls-tree argv[1] */
 		if (!strcmp(type, tree_type))
 			return cmd_ls_tree(2, argv + 1, NULL);
 
+		/* For everything else, read the object itself */
 		buf = read_sha1_file(sha1, type, &size);
 		if (!buf)
 			die("Cannot read object %s", argv[2]);
+		/* if the object is a tag, use pprint_tag() above */
 		if (!strcmp(type, tag_type)) {
 			pprint_tag(sha1, buf, size);
 			return 0;
-- 
1.4.4.1.geeee8
Next: Andy Parkins
Message 1 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.