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

Re: `git show --oneline commit` does not do what's intuitively expected

From
Jeff King <peff@peff.net>
Date
Feb 17, 2017, 04:05 UTC
Message-ID
<20170217040522.jugt4uuak74l3qjw@sigill.intra.peff.net>
In-Reply-To
<CA+-W3ctdRtLpziJ9TX2hqk7RagMyJpHsrfwj=rN7oXQ8EeUPnw@mail.gmail.com>
On Fri, Feb 17, 2017 at 02:51:36AM +0100, Luna Kid wrote:
> tl;dr; --> Please add --no-diff (or --msg-only) to git show. We'll
> love you for that. :)
I think it is already spelled "--no-patch", or "-s" for short.
Show 5 quoted lines
> Please note that "show" is such a profoundly generic command verb,
> probably also used heavily in git, especially to show commits, that it
> comes to mind as second nature, without thinking, as the primary (or
> even as "the only") choice for showing various items in various ways
> -- which, in fact, it already properly does, indeed.

Right. That's what's it for. The DESCRIPTION section of the manpage starts with:

       Shows one or more objects (blobs, trees, tags and commits).
       For commits it shows the log message and textual diff. It also
       presents the merge commit in a special format as produced by git
       diff-tree --cc.
       For tags, it shows[...etc...]

I guess that second paragraph could mention "--no-patch" explicitly to disable it. It's documented in the COMMON DIFF OPTIONS section, but of course there are quite a few options listed, so it's easy to miss.

-Peff
Previous: Luna KidNext: Linus Torvalds
Message 2 of 3 in “`git show --oneline commit` does not do what's intuitively expected”
  1. Luna KidFeb 17, 2017
  2. Jeff KingFeb 17, 2017
  3. Linus TorvaldsFeb 22, 2017

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.