Re: [PATCH 1/2] blame.c: Add translation to warning about failed revision walk
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 12, 2014, 16:57 UTC
- Message-ID
- <xmqqppg563xl.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1407706406-30455-1-git-send-email-stefanbeller@gmail.com>
Stefan Beller <stefanbeller@gmail.com> writes:
> blame belonging to the group of > ancillaryinterrogators and not to plumbinginterrogators > should have localized error messages?
Unless running under --porcelain option to be driven by scripts, we expect that we are talking to a human user, so using "_(msg)" is very much appropriate for that case.
A possibly problematic script might do something like this:
git blame --porcelain "$1" 2>&1 |
awk "$awkScript"and the $awkScript may check the input lines that do not match the expected pattern the output lines from the command follow and act on them, though. _(msg) is unwelcome to such a script [*1*].
I suspect the above problem is likely to be theoretical. People would be more sloppy and write this instead:
git blame --porcelain "$1" |
awk "$awkScript"and let the problem pass unnoticed, affecting the later parts of their processing ;-). And "_(msg)", not "msg", would help.
[Footnote]
*1* ... and with possible interleaving of output that came to the standard output and the standard error, such parsing by $awkScript would not be a reliable way to do this anyway. A truly careful one has to be written along the lines of:
git blame --porcelain "$1" >"$tmp" &&
awk "$awkScript" <"$tmp"anyway.
Show 18 quoted lines
> Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
> ---
> builtin/blame.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/blame.c b/builtin/blame.c
> index 17d30d0..ca4ba6f 100644
> --- a/builtin/blame.c
> +++ b/builtin/blame.c
> @@ -2700,7 +2700,7 @@ parse_done:
> * uninteresting.
> */
> if (prepare_revision_walk(&revs))
> - die("revision walk setup failed");
> + die(_("revision walk setup failed"));
>
> if (is_null_sha1(sb.final->object.sha1)) {
> o = sb.final->util;