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

Re: 'show' pretty %B without a diff

From
Peter Vereshagin <peter@vereshagin.org>
Date
Dec 20, 2010, 11:12 UTC
Message-ID
<20101220111214.GD10354@external.screwed.box>
In-Reply-To
<7vmxo0ddbm.fsf@alter.siamese.dyndns.org>

Hey Mr(s) Junio show some good to me! 2010/12/20 01:05:17 -0800 Junio C Hamano <gitster@pobox.com> => To Peter Vereshagin :

JCH> > I'd like to output a comment in my script. JCH> > Thus, I try: 'git show --format="%B" commitId' JCH> > There is always diff in the end of the output. No matter what format I specify, even when it is empty. JCH> > How can I avoid diff output in the 'git show'? JCH> JCH> The best answer to "avoid" it would be not to use "git show"; after all JCH> the command is about showing the change it introduces when it is used on a JCH> commit. JCH> 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? Also, it outputs 4 more unwanted fields than just the %B... used with the -p is the only what looks like the what I asked. Is it appropriate in a general case to skip the everything on that output till the first empty line? cause I'm not sure those are always 4 and not-empty lines.

Thanks anyway, it's just better than nothing. Although I wish the -p for cat-file to behave like the simlar-minded --pretty of the 'show'. (=

Or the Git.pm just to have a functionality to get the %B of the commit.

73! Peter pgp: A0E26627 (4A42 6841 2871 5EA7 52AB 12F8 0CE1 4AAC A0E2 6627) -- http://vereshagin.org

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 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.