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

[RFC] git-log should use the same diff-options as git-show

From
HMHenning Moll <newsscott@gmx.de>
Date
Mar 18, 2016, 21:47 UTC
Message-ID
<loom.20160318T222303-528@post.gmane.org>
Hi

Recently i stumbled upon an old stash entry. It was clear to me that the stash only contained non-indexed worktree changes. So i assumed to get insight by doing

    $ git log -1 -p stash@{0}

But surprisingly the result was "no patch" (The problem which i was not aware at that time was the fact that a stash commit is a merge). So i asked a question on stackoverflow (1) an learned that there are different default options used depending on the git command used:

    $ git show stash@{0}
    $ git diff stash@{0}^..stash@{0}
work with default, but for git-log i need to 
    $ git log -1 -p --cc stash@{0}

to make it behave the same. This does not seem reasonable to me, though i read about commit 1aec791 (2) in git's own repository. What do you think?

Maybe - as a compromise - just show any kind of hint instead of nothing?

Best regards Henning

(1) - http://stackoverflow.com/questions/36089674/git-log-1-p-stash0-shows-empty-patch (2) - https://git.kaarsemaker.net/git/commit/1aec7917dc52901c6df301ddc8fea70f5ce0db09/

Next: Stefan Beller
Message 1 of 2 in “[RFC] git-log should use the same diff-options as git-show”
  1. Henning MollMar 18, 2016
  2. Stefan BellerMar 18, 2016

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.