Thread (1 message) 1 message, 1 author, 2016-08-11
DORMANTno replies

[PATCH] Comment -p mode for cat-file

From: Andy Parkins <hidden>
Date: 2016-08-11 19:30:54
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Andy Parkins <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help