Re: Why doesn't `git log -m` imply `-p`?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sergey Organov <sorganov@xxxxxxxxx> writes:

> Yep, but --diff-merges=m doesn't imply -p either, though it does produce
> diff output without -p, for merge commits only.

I misspoke without thinking it through.  It is absolutely wrong for
the "-m" option (or "--diff-merges=m" for that matter) to imply
"-p".

$ git log --stat --summary

would show "diff", but the kind of "diff" requested is not a textual
patch but just diffstat and the summary of new/removed files, and
the "diff" is shown only for single-parent commits, and it omits
"diff" for merge commits.  Adding "-m" to this command line is *not*
a request to show the textual patch.  It is to ask "diff" to be
shown pairwise with each of the parent.

$ git log -m --stat --summary

It is probably OK to special case "-m" given alone without any other
option [*1*] that specifies what kind of "diff" is requested and
make it imply "-p".  But unconditionally flipping "-p" on only
because you saw "-m" (or "--diff-merges=m" for that matter) is just
wrong.


[Footnote]

*1* They are not limited to "-p", "--stat" and "--summary", but
you'd need to also pay attention to "--raw", "--name-only", etc.)



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux