git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Cc: git@vger.kernel.org, "Jean-Noël Avila" <jn.avila@free.fr>,
	"Johannes Sixt" <j6t@kdbg.org>, "René Scharfe" <l.s.r@web.de>
Subject: Re: [PATCH] am: fix error message in parse_opt_show_current_patch()
Date: Thu, 21 Sep 2023 12:09:10 -0700	[thread overview]
Message-ID: <xmqqh6nn5oo9.fsf@gitster.g> (raw)
In-Reply-To: <20230921110727.789156-1-oswald.buddenhagen@gmx.de> (Oswald Buddenhagen's message of "Thu, 21 Sep 2023 13:07:27 +0200")

Oswald Buddenhagen <oswald.buddenhagen@gmx.de> writes:

> The argument order was incorrect. This was introduced by 246cac8505
> (i18n: turn even more messages into "cannot be used together" ones,
> 2022-01-05).
>
> Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
>
> ---
> fwiw, this is currently the only message that actually uses the %s=%s
> format, so as of now, factoring out the argument names has only
> theoretical value.

I am not sure I follow, if you mean that the programmer needs to
pass "--show-current-patch" only once if we used something like
"%1$s=%2s and %1$s=%3s", I agree that it probably has little value.

The patch looks good.  It seems that we are seeing a crack in test
coverage, by the way?

Will queue.  Thanks.

> diff --git a/builtin/am.c b/builtin/am.c
> index 202040b62e..6655059a57 100644
> --- a/builtin/am.c
> +++ b/builtin/am.c
> @@ -2303,7 +2303,8 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar
>  	if (resume->mode == RESUME_SHOW_PATCH && new_value != resume->sub_mode)
>  		return error(_("options '%s=%s' and '%s=%s' "
>  					   "cannot be used together"),
> -					 "--show-current-patch", "--show-current-patch", arg, valid_modes[resume->sub_mode]);
> +			     "--show-current-patch", arg,
> +			     "--show-current-patch", valid_modes[resume->sub_mode]);
>  
>  	resume->mode = RESUME_SHOW_PATCH;
>  	resume->sub_mode = new_value;

  reply	other threads:[~2023-09-21 19:47 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-09 21:10 [PATCH 1/2] parse-options: add int value pointer to struct option René Scharfe
2023-09-09 21:14 ` [PATCH 2/2] parse-options: use and require int pointer for OPT_CMDMODE René Scharfe
2023-09-10 10:18   ` Oswald Buddenhagen
2023-09-11 20:11     ` René Scharfe
2023-09-12  8:40       ` Jeff King
2023-09-16 17:45         ` Junio C Hamano
2023-09-18  9:28           ` René Scharfe
2023-09-18 10:10             ` Oswald Buddenhagen
2023-09-19  7:41               ` René Scharfe
2023-09-21 11:07                 ` [PATCH] am: fix error message in parse_opt_show_current_patch() Oswald Buddenhagen
2023-09-21 19:09                   ` Junio C Hamano [this message]
2023-09-21 19:28                     ` Oswald Buddenhagen
2023-09-18 13:33             ` [PATCH 2/2] parse-options: use and require int pointer for OPT_CMDMODE Phillip Wood
2023-09-18 17:11               ` Junio C Hamano
2023-09-18 19:48                 ` Phillip Wood
2023-10-03  8:49                   ` René Scharfe
2023-10-03 17:15                     ` Junio C Hamano
2023-09-19  7:47               ` René Scharfe
2023-09-11 19:12   ` Junio C Hamano
2023-09-11 20:11     ` René Scharfe
2023-09-19  9:40   ` Oswald Buddenhagen
2023-09-20  8:18     ` René Scharfe
2023-09-21 10:40       ` Oswald Buddenhagen
2023-10-03  8:49         ` René Scharfe
2023-10-03  9:38           ` Oswald Buddenhagen
2023-10-03 17:54             ` René Scharfe
2023-10-03 18:24               ` Oswald Buddenhagen
2023-09-10 18:40 ` [PATCH 1/2] parse-options: add int value pointer to struct option Taylor Blau
2023-09-11 19:19   ` Junio C Hamano
2023-09-11 22:28     ` Oswald Buddenhagen
2023-09-18 11:34       ` Kristoffer Haugsbakk
2023-09-18  9:53     ` René Scharfe
2023-09-18 10:28       ` Oswald Buddenhagen
2023-09-18 16:17       ` Junio C Hamano
2023-09-20 11:34         ` René Scharfe
2023-09-11 20:12   ` René Scharfe

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=xmqqh6nn5oo9.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=jn.avila@free.fr \
    --cc=l.s.r@web.de \
    --cc=oswald.buddenhagen@gmx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).