From: Junio C Hamano <gitster@pobox.com>
To: Vasco Almeida <vascomalmeida@sapo.pt>
Cc: Stefan Beller <sbeller@google.com>,
Josh Bleecher Snyder <josharian@gmail.com>,
"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Bug report: $program_name in error message
Date: Tue, 20 Dec 2016 09:41:16 -0800 [thread overview]
Message-ID: <xmqqd1gmlcqr.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1482243418.2029.10.camel@sapo.pt> (Vasco Almeida's message of "Tue, 20 Dec 2016 13:16:58 -0100")
Vasco Almeida <vascomalmeida@sapo.pt> writes:
> Thanks for the report and letting me know.
> Yes, these were mistakes and lack of attention mine. It was supposed to
> call 'eval_gettext' rather than 'gettext' when \$variable interpolation
> is needed.
Thanks.
As both of the offending commits (d323c6b641 & f2d17068fd) were part
of the topic that was merged at 2703572b3a ("Merge branch
'va/i18n-even-more'", 2016-07-13), I'll queue this single patch on
top of 2703572b3a^2 (i.e. the tip of the topic).
-- >8 --
Subject: [PATCH] i18n: fix misconversion in shell scripts
An earlier series that was merged at 2703572b3a ("Merge branch
'va/i18n-even-more'", 2016-07-13) failed to use $(eval_gettext
"string with \$variable interpolation") and instead used gettext in
a few places, and ended up showing the variable names in the
message, e.g.
$ git submodule
fatal: $program_name cannot be used without a working tree.
Catch these mistakes with
$ git grep -n '[^_]gettext .*\\\$'
and fix them all to use eval_gettext instead.
Reported-by: Josh Bleecher Snyder
Acked-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
git-rebase--interactive.sh | 3 ++-
git-sh-setup.sh | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index a545d92c26..c5806859f0 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -467,7 +467,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.")"
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 2eda134800..c7b2a95463 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -194,14 +194,14 @@ require_work_tree_exists () {
if test "z$(git rev-parse --is-bare-repository)" != zfalse
then
program_name=$0
- die "$(gettext "fatal: \$program_name cannot be used without a working tree.")"
+ die "$(eval_gettext "fatal: \$program_name cannot be used without a working tree.")"
fi
}
require_work_tree () {
test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true || {
program_name=$0
- die "$(gettext "fatal: \$program_name cannot be used without a working tree.")"
+ die "$(eval_gettext "fatal: \$program_name cannot be used without a working tree.")"
}
}
--
2.11.0-416-g1351c11cce
prev parent reply other threads:[~2016-12-20 17:41 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
2016-12-19 23:33 ` Stefan Beller
2016-12-20 14:16 ` Vasco Almeida
2016-12-20 17:41 ` 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=xmqqd1gmlcqr.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