Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: Josh Bleecher Snyder <josharian@gmail.com>,
	vascomalmeida@sapo.pt,
	"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Bug report: $program_name in error message
Date: Mon, 19 Dec 2016 12:50:59 -0800	[thread overview]
Message-ID: <xmqqfuljod70.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <xmqqk2avodi1.fsf@gitster.mtv.corp.google.com> (Junio C. Hamano's message of "Mon, 19 Dec 2016 12:44:22 -0800")

Junio C Hamano <gitster@pobox.com> writes:

> Comparing these changes that involve "\$variable" ...
>
>  	dashless=$(basename -- "$0" | sed -e 's/-/ /')
>  	usage() {
> -		die "usage: $dashless $USAGE"
> +		die "$(eval_gettext "usage: \$dashless \$USAGE")"
> ... and these that appear in the same patch ...
>
> @@ -190,13 +193,16 @@ cd_to_toplevel () {
>  require_work_tree_exists () {
>  	if test "z$(git rev-parse --is-bare-repository)" != zfalse
>  	then
> -		die "fatal: $0 cannot be used without a working tree."
> +		program_name=$0
> +		die "$(gettext "fatal: \$program_name cannot be used without a working tree.")"
> ...
>  
> tells me that the latter needs to be eval_gettext?

Just for fun:

    $ git grep -n '[^_]gettext .*\\\$'

shows three hits.  Two of them are from that one.

The other is at git-rebase--interactive.sh:440

Perhaps like this to fix.

-- >8 --
Subject: rebase -i: fix mistaken i18n

f2d17068fd ("i18n: rebase-interactive: mark comments of squash for
translation", 2016-06-17) attempted to apply sh-i18n and failed to
use $(eval_gettext "string with \$variable interpolation").

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 git-rebase--interactive.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 41fd374c72..96865b2375 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -437,7 +437,8 @@ update_squash_messages () {
 			}' <"$squash_msg".bak
 		} >"$squash_msg"
 	else
-		commit_message HEAD > "$fixup_msg" || die "$(gettext "Cannot write \$fixup_msg")"
+		commit_message HEAD >"$fixup_msg" ||
+		die "$(eval_gettext "Cannot write \$fixup_msg")"
 		count=2
 		{
 			printf '%s\n' "$comment_char $(gettext "This is a combination of 2 commits.")"

  reply	other threads:[~2016-12-19 20:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-18 20:36 Bug report: $program_name in error message Josh Bleecher Snyder
2016-12-18 21:34 ` Stefan Beller
2016-12-18 21:44   ` Josh Bleecher Snyder
2016-12-19 17:07     ` Stefan Beller
2016-12-19 20:44       ` Junio C Hamano
2016-12-19 20:50         ` Junio C Hamano [this message]
2016-12-19 23:33           ` Stefan Beller
2016-12-20 14:16           ` Vasco Almeida
2016-12-20 17:41             ` Junio C Hamano

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=xmqqfuljod70.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=josharian@gmail.com \
    --cc=sbeller@google.com \
    --cc=vascomalmeida@sapo.pt \
    /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