Re: [PATCH v2 28/33] diff-merges: add '--diff-merges=1' as synonym for 'first-parent'
- From
Elijah Newren <newren@gmail.com>
- Date
- Dec 18, 2020, 06:19 UTC
- Message-ID
- <CABPp-BExc7rBCVEvLLs1u_hXurDTtWxTKg0ZN0+PA-21u_ShkA@mail.gmail.com>
- In-Reply-To
- <20201216184929.3924-29-sorganov@gmail.com>
On Wed, Dec 16, 2020 at 10:50 AM Sergey Organov <sorganov@gmail.com> wrote:
>
> As we now have --diff-merges={m|c|cc}, add --diff-merges=1 as synonym
> for --diff-merges=first-parent, to have shorter mnemonics for it as
> well.In all the other cases, --diff-merges=<short> is equivalent to -<short>. Here, --diff-merges=1 and -1 do _very_ different things. Is there any concern that might cause confusion? (My gut reaction is this is probably fine and people won't try to make such a connection, but it made me worry just enough that I thought I'd flag it for you and other reviewers to at least mull over and maybe comment on.)
Show 22 quoted lines
> Signed-off-by: Sergey Organov <sorganov@gmail.com> > --- > diff-merges.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/diff-merges.c b/diff-merges.c > index 9492cd2b871d..63a0d78b7730 100644 > --- a/diff-merges.c > +++ b/diff-merges.c > @@ -57,7 +57,8 @@ static void set_diff_merges(struct rev_info *revs, const char *optarg) > return; > } > if (0) ; > - else if (!strcmp(optarg, "first") || !strcmp(optarg, "first-parent")) > + else if (!strcmp(optarg, "first") || !strcmp(optarg, "first-parent") || > + !strcmp(optarg, "1")) > set_first_parent(revs); > else if (!strcmp(optarg, "sep") || !strcmp(optarg, "separate") || > !strcmp(optarg, "m")) > -- > 2.25.1 >