Git development
 help / color / mirror / Atom feed
* [RFC] git-log should use the same diff-options as git-show
@ 2016-03-18 21:47 Henning Moll
  2016-03-18 21:54 ` Stefan Beller
  0 siblings, 1 reply; 2+ messages in thread
From: Henning Moll @ 2016-03-18 21:47 UTC (permalink / raw)
  To: git

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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC] git-log should use the same diff-options as git-show
  2016-03-18 21:47 [RFC] git-log should use the same diff-options as git-show Henning Moll
@ 2016-03-18 21:54 ` Stefan Beller
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Beller @ 2016-03-18 21:54 UTC (permalink / raw)
  To: Henning Moll; +Cc: git@vger.kernel.org

On Fri, Mar 18, 2016 at 2:47 PM, Henning Moll <newsScott@gmx.de> wrote:
> 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?

Junio did some slight tweaks to --cc and -p,
see 82dee4160cc6d1b0d792c9f07b5803cd42abc610/
and its parent. That should be live in the upcoming 2.8.

>
> 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/
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-18 21:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-18 21:47 [RFC] git-log should use the same diff-options as git-show Henning Moll
2016-03-18 21:54 ` Stefan Beller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox