All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: lilinchao@oschina.cn
Cc: git <git@vger.kernel.org>
Subject: Re: Should "git apply"'s option "--3way" imply "--index" in option description?
Date: Fri, 30 Jul 2021 07:34:07 -0700	[thread overview]
Message-ID: <xmqqeebf3m74.fsf@gitster.g> (raw)
In-Reply-To: <a9c2851af11011ebb8e40024e87935e7@oschina.cn> (lilinchao@oschina.cn's message of "Fri, 30 Jul 2021 16:32:21 +0800")

"lilinchao@oschina.cn" <lilinchao@oschina.cn> writes:

> like this:
>
> diff --git a/apply.c b/apply.c
> index 44bc31d6eb..0b353af96c 100644
> --- a/apply.c
> +++ b/apply.c
> @@ -5024,7 +5024,7 @@ int apply_parse_options(int argc, const char **argv,
>                 OPT_BOOL(0, "apply", force_apply,
>                         N_("also apply the patch (use with --stat/--summary/--check)")),
>                 OPT_BOOL('3', "3way", &state->threeway,
> -                        N_( "attempt three-way merge, fall back on normal patch if that fails")),
> +                        N_( "attempt three-way merge, fall back on normal patch if that fails(implies --index)")),
>                 OPT_FILENAME(0, "build-fake-ancestor", &state->fake_ancestor,
>                         N_("build a temporary index based on embedded index information")),
>                 /* Think twice before adding "--nul" synonym to this */

It is not incorrect per-se, but because "--3way" implies "--index"
only when "--cached" is not in effect, it may do more harm than it
helps to mention only just the "--index" half of the story.

If we were to touch that line, I'd just chop off "if that fails" at
the end---the phrase "fall back" already tells readers that it happens
only when the non-fallback action does not work.

Thanks.

      reply	other threads:[~2021-07-30 14:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30  8:32 Should "git apply"'s option "--3way" imply "--index" in option description? lilinchao
2021-07-30 14:34 ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqeebf3m74.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=lilinchao@oschina.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.