Re: [PATCH v2 0/7] making log --first-parent imply -m
- From
Jeff King <peff@peff.net>
- Date
- Aug 4, 2020, 21:25 UTC
- Message-ID
- <20200804212518.GB2020725@coredump.intra.peff.net>
- In-Reply-To
- <873652166e.fsf@osv.gnss.ru>
On Tue, Aug 04, 2020 at 11:56:25PM +0300, Sergey Organov wrote:
Show 21 quoted lines
> >> diff --git a/revision.c b/revision.c
> >> index 669bc856694f..dcdff59bc36a 100644
> >> --- a/revision.c
> >> +++ b/revision.c
> >> @@ -2323,10 +2323,31 @@ static int handle_revision_opt(struct
> >> rev_info *revs, int argc, const char **arg
> >> revs->diff = 1;
> >> revs->diffopt.flags.recursive = 1;
> >> revs->diffopt.flags.tree_in_recursive = 1;
> >> - } else if (!strcmp(arg, "-m") || !strcmp(arg, "--diff-merges")) {
> >> + } else if ((argcount = parse_long_opt("diff-merges", argv, &optarg))) {
> >> revs->ignore_merges = 0;
> >> + if (!strcmp(optarg, "off")) {
> >> + revs->ignore_merges = 1;
> >> + } else if (!strcmp(optarg, "all")) {
> >> + revs->diff = 0;
> >
> > Should this be revs->ignore_merges = 0?
>
> It's 4 lines above, as it's in fact common for all the cases but the
> first one.Ah, I missed that. That raises more questions, though. ;)
For "-m" we do not need to set revs->diff; why do we need to do so here?
For "--cc", we do not need to set revs->ignore_merges. Why do we need to do so here? We do need it set eventually, but I think setup_revisions() later handles that, and wants ignore_merges untouched to decide whether the user asked for it or not.
-Peff