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

Re: 'show' pretty %B without a diff

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 20, 2010, 18:05 UTC
Message-ID
<7v4oa8cobn.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20101220111214.GD10354@external.screwed.box>
Peter Vereshagin <peter@vereshagin.org> writes:
> JCH> Especially if you are doing a script, you probably should be using
> JCH> "cat-file commit" anyway, no?
>
> cat-file doesn't seem to support formatting option?

That is exactly why I suggested "cat-file", as you are scripting. We reserve the right to change the human-visible formatting output from Porcelain commands like "show" any time to make it "prettier" (we may start coloring strings that look like object names in the commit log message in "git show" output, for example), while giving scripts more stable output through the plumbing commands like "cat-file" so that they can parse and process without having to worry about the output format changing under them.

If your script is _not_ parsing the git command output, but is just blindly spewing it out to the invoking user, it is Ok to use "show", though. Check "-s" option to the "show" command in that case.

Previous: Peter VereshaginNext: Peter Vereshagin
Message 4 of 10 in “'show' pretty %B without a diff”
  1. Peter VereshaginDec 20, 2010
  2. Junio C HamanoDec 20, 2010
  3. Peter VereshaginDec 20, 2010
  4. Junio C HamanoDec 20, 2010
  5. Peter VereshaginDec 21, 2010
  6. Jakub NarebskiDec 21, 2010
  7. Jonathan NiederDec 21, 2010
  8. Martin LanghoffDec 21, 2010
  9. Jakub NarebskiDec 21, 2010
  10. peter@vereshagin.orgDec 22, 2010

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.