Re: [PATCH 2/3] revision: add "--ignore-merges" option to counteract "-m"

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

 



On Tue, Jul 28, 2020 at 10:52:14AM -0700, Chris Torek wrote:

> On Tue, Jul 28, 2020 at 9:40 AM Jeff King <peff@xxxxxxxx> wrote:
> > I pulled the option name from the rev_info field name. It might be too
> > broad (we are not ignoring merges during the traversal, only for the
> > diff). It could be "--no-diff-merges" or something, but that would
> > involve flipping the sense of the boolean (but that would just be in the
> > code, not user-visible, so not that big a deal).
> 
> Perhaps a bit bikesheddy, but I would suggest some clarifying
> notes in the documentation.  The fact that `git log` *follows*
> merges by default is pretty obvious, but the fact that it doesn't
> *diff them at all* by default appears to be surprising to most Git
> newcomers.  (It was to me, so many years ago, and I see this all
> the time on stackoverflow.)

Yeah, I agree this is a point of confusion. My hope is that the code
change makes some of the confusion go away without people having to read
the documentation.

But I think "git log -p" (or "git log -Sfoo") still remains as a point
of confusion. Possibly we should be using "--cc" by default there, too.
It's obviously more expensive, but I wonder how much that really matters
in practice. I'd rather not tie it in to this series, though, which I
think is more unambiguously helpful. :)

>   Note that --ignore-merges / --no-ignore-merges affect
>   only diff generation, not commit traversal.

Yeah, that would definitely reduce confusion, but I'm switching it to
--diff-merges (and flipping the boolean nature), which I think is even
better.

>   Note
>   also that by default, "git log -p" does not generate
>   diffs for merges except when using --first-parent.
>   See also the -c and --cc options and note that the
>   default for "git show" is "--cc".

I think this would be useful to have in the manpage, but not under this
option. It looks like we can expand on this under the "Diff Formatting"
section. That's still kind of buried, but is the first place that makes
any sense to me. I'll see if I can do a patch on top of my series.

-Peff



[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