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

[PATCH] cat-file: document -p option

From
Jeff King <peff@peff.net>
Date
May 25, 2006, 01:22 UTC
Message-ID
<20060525012232.GA14486@coredump.intra.peff.net>
In-Reply-To
<20060524203108.70b6c596.seanlkml@sympatico.ca>

--- On Wed, May 24, 2006 at 08:31:08PM -0400, Sean wrote:

> $ meld sha1_file.c <(git cat-file -p c2f493a4ae:sha1_file.c)

I had never seen the -p option, and it wasn't in the Documentation. Let me know if I've gotten its function completely wrong. :)

-Peff
 Documentation/git-cat-file.txt |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt
index 504eb1b..5e9cbf8 100644
--- a/Documentation/git-cat-file.txt
+++ b/Documentation/git-cat-file.txt
@@ -8,12 +8,12 @@ git-cat-file - Provide content or type i
 
 SYNOPSIS
 --------
-'git-cat-file' [-t | -s | -e | <type>] <object>
+'git-cat-file' [-t | -s | -e | -p | <type>] <object>
 
 DESCRIPTION
 -----------
 Provides content or type of objects in the repository. The type
-is required unless '-t' is used to find the object type,
+is required unless '-t' or '-p' is used to find the object type,
 or '-s' is used to find the object size.
 
 OPTIONS
@@ -33,6 +33,9 @@ OPTIONS
 	Suppress all output; instead exit with zero status if <object>
 	exists and is a valid object.
 
+-p::
+	Pretty-print the contents of <object> based on its type.
+
 <type>::
 	Typically this matches the real type of <object> but asking
 	for a type that can trivially be dereferenced from the given
@@ -49,6 +52,8 @@ If '-s' is specified, the size of the <o
 
 If '-e' is specified, no output.
 
+If '-p' is specified, the contents of <object> are pretty-printed.
+
 Otherwise the raw (though uncompressed) contents of the <object> will
 be returned.
 
-- 
1.3.3.g4d548
Previous: Junio C Hamano
Message 15 of 15 in “Clean up sha1 file writing”
  1. Linus TorvaldsMay 24, 2006
  2. Matthias LederhoferMay 24, 2006
  3. Linus TorvaldsMay 24, 2006
  4. H. Peter AnvinJun 2, 2006
  5. Linus TorvaldsJun 2, 2006
  6. H. Peter AnvinJun 4, 2006
  7. Linus TorvaldsJun 4, 2006
  8. Linus TorvaldsJun 4, 2006
  9. H. Peter AnvinJun 4, 2006
  10. Junio C HamanoMay 24, 2006
  11. Linus TorvaldsMay 24, 2006
  12. Junio C HamanoMay 25, 2006
  13. SeanMay 25, 2006
  14. Junio C HamanoMay 26, 2006
  15. cat-file: document -p optionJeff King, May 25, 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.