[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH v2 0/7] making log --first-parent imply -m
From:       Jeff King <peff () peff ! net>
Date:       2020-07-31 23:08:58
Message-ID: 20200731230858.GA1461090 () coredump ! intra ! peff ! net
[Download RAW message or body]

On Thu, Jul 30, 2020 at 12:41:39AM +0300, Sergey Organov wrote:

> > Here's a re-roll taking into account the discussion so far:
> >
> >   - the escape hatch option name is flipped to "--no-diff-merges" (with
> >     "--diff-merges" matching "-m")
> 
> Rather than being just a synonym for -m, is there a chance for
> "--diff-merges" implementation to be turned to output diff to the first
> parent only, no matter if --first-parent is active or not?
>
> Alternatively, may it have a parameter such as "-m parent-number" of
> "git cherry-pick" being set to "1" by default?

Yes, I agree that would be a useful feature, but I don't think it needs
to be part of this series. It could be implemented as --diff-merges=1 to
show only the one against the first parent, or as its own option. But we
can add that on top.

> This -m output of diffs to all the parents is in fact primary source of
> confusion for me, even over all these mind-blowing inter-dependencies
> between --first-parent, --cc, -c, -m, -p and what not. Who ever needs
> these (potentially huge) diffs against other parents, anyway?

I've used "-m" second-parent diffs occasionally for hunting down
mismerges, etc, but I agree that most of the time you just want to see
the diff against the first parent.

> Introduction of this new option is a great opportunity for improvement
> that would be a pity to miss.

Adding an optional value to the flag is something we can do later. We
would miss the opportunity for "--diff-merges" to default to
"--diff-merges=1", but I'm not sure I'd want to do that anyway. Having
it be consistent with "-m" seems less confusing to me, and it is already
too late to change that.

If we want an option that defaults to "1", we can give it a new name.
The only thing that is lost now is that --diff-merges would already be
taken. :) But I think I'd probably call such an option "--diff-parents"
or something like that anyway.

-Peff
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic