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

Re: How pretty is pretty? git cat-file -p inconsistency

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Oct 7, 2011, 20:26 UTC
Message-ID
<4E8F6088.8060300@drmicha.warpmail.net>
In-Reply-To
<7v62k0wudg.fsf@alter.siamese.dyndns.org>
Junio C Hamano venit, vidit, dixit 07.10.2011 20:04:
Show 10 quoted lines
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> That is, "cat file -p" pretty prints dates for tag objects but not for
>> commit objects. In fact, "-p" on commit objects does not prettify at all
>> compared to the raw content. Is that intentional?
> 
> "cat-file -p" is an ill-conceived half-ass afterthought, and I do not
> think anybody sane considers it as part of the "plumbing" ultra stable
> interface for machine consumption. See a0f15fa (Pretty-print tagger
> dates., 2006-03-01).

Uh, I see. "git cat-file -p tagname" is a bit like the the missing "git tag show tagname" or "git show tagname" without the commit.

Show 7 quoted lines
> 
>> I'd suggest
>> prettifying dates with "-p" for commit objects also.
> 
> Please make it so. It is your choice to do a patch to update this single
> thing first, or to discuss the output with "-p" for all the other object
> types at the same time to get the list concensus before proceeding.

I never knew how ugly the output of "git tag-file tree sha1" is. I guess it's the type of object whose format I don't know... We don't have an object format description in Doc/technical, do we? tree.c doesn't tell me much.

Looking at how "cat-file -p" for tags is done makes me not want to do it for commits ;) We do have pretty "git show" for all types of objects, though "git cat-file -p treeobject" is more informative than "git show treeobject". I guess I have to make up my mind about what direction to go.

Michael
Previous: Junio C HamanoNext: Jakub Narebski
Message 3 of 6 in “How pretty is pretty? git cat-file -p inconsistency”
  1. Michael J GruberOct 7, 2011
  2. Junio C HamanoOct 7, 2011
  3. Michael J GruberOct 7, 2011
  4. Jakub NarebskiOct 7, 2011
  5. Michael J GruberOct 8, 2011
  6. Jakub NarebskiOct 8, 2011

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.