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

Re: 'show' pretty %B without a diff

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 21, 2010, 12:56 UTC
Message-ID
<m38vzjl1yr.fsf@localhost.localdomain>
In-Reply-To
<20101221104641.GA8600@external.screwed.box>
Peter Vereshagin <peter@vereshagin.org> writes:
> 2010/12/20 10:05:16 -0800 Junio C Hamano <gitster@pobox.com> => To Peter Vereshagin :
Show 5 quoted lines
> JCH> If your script is _not_ parsing the git command output, but is just
> JCH> blindly spewing it out to the invoking user, it is Ok to use "show",
> JCH> though.  Check "-s" option to the "show" command in that case.
> 
> "show" command doesn't seem to have "-s" switch. Skip it up though ;-)

Hmmm... true, unfortunately it is described in hidden corner: when git-show is used to display commits, it accepts diff family options... including `-s' described in git-diff-tree manpage:

  -s::
        By default, 'git diff-tree --stdin' shows differences,
        either in machine-readable form (without '-p') or in patch
        form (with '-p').  This output can be suppressed.  It is
        only useful with '-v' flag.
  -v::
        This flag causes 'git diff-tree --stdin' to also show
        the commit message before the differences.
I guess that `-s' should be present also in git-show manpage.
There is also `git log -1` (or `git log -1 --no-walk` for paranoid).
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Peter VereshaginNext: Jonathan Nieder
Message 6 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.