git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "David Burström" <davidburstrom@spotify.com>, git@vger.kernel.org
Subject: Re: [PATCH 3/3] sha1-name: mark get_oid() error messages for translation
Date: Thu, 30 Jan 2020 02:17:00 -0500	[thread overview]
Message-ID: <20200130071700.GB2189233@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqqimkudjmt.fsf@gitster-ct.c.googlers.com>

On Wed, Jan 29, 2020 at 01:42:50PM -0800, Junio C Hamano wrote:

> >> -	fatal: Path '$2$3' $4, but not ${5:-$SQ$3$SQ}.
> >> -	Did you mean '$1:$2$3'${2:+ aka $SQ$1:./$3$SQ}?
> >> +	fatal: path '$2$3' $4, but not ${5:-$SQ$3$SQ}
> >> +	hint: Did you mean '$1:$2$3'${2:+ aka $SQ$1:./$3$SQ}?
> >>  	EOF
> >>  	test_cmp expected error
> >
> > ...this obviously would not allow GIT_TEST_GETTEXT_POISON test to
> > pass.  And ...

Hrmph. I know I tested with GETTEXT_POISON, but you are obviously right
that this doesn't pass. I must have botched something in one of my
rebase passes at the end.

Thanks for catching it, but...

> I'll queue this band-aid on top before making my last pushout for
> the day.  Even with poisoned i18n/l10n, die(_(msg)) gives "fatal:"
> prefix at the beginning, so that is what test_did_you_mean would
> expect to see from a passing test under GIT_TEST_GETTEXT_POISON.
> 
> The other hunk is about a test that greps in "error".

I think we can do this much more simply, by just using i18ncmp:

diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index c2b5125c12..62085a89e3 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -12,7 +12,7 @@ test_did_you_mean ()
 	fatal: path '$2$3' $4, but not ${5:-$SQ$3$SQ}
 	hint: Did you mean '$1:$2$3'${2:+ aka $SQ$1:./$3$SQ}?
 	EOF
-	test_cmp expected error
+	test_i18ncmp expected error
 }
 
 HASH_file=

(we'd still need the s/grep/test_i18ngrep/ in your second hunk).

-Peff

  reply	other threads:[~2020-01-30  7:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 12:45 Bug or unexpected behaviour in git show <rev>:a\b David Burström
2020-01-24 19:01 ` Jeff King
2020-01-24 19:27   ` Junio C Hamano
2020-01-25  0:00     ` Jeff King
2020-01-25 13:21       ` David Burström
2020-01-27 18:47       ` Junio C Hamano
2020-01-25  0:05   ` Jeff King
2020-01-25  0:06     ` [PATCH 1/3] t1400: avoid "test" string comparisons Jeff King
2020-01-25  0:06     ` [PATCH 2/3] t1506: drop space after redirection operator Jeff King
2020-01-25  0:13     ` [PATCH 3/3] sha1-name: mark get_oid() error messages for translation Jeff King
2020-01-29 21:30       ` Junio C Hamano
2020-01-29 21:42         ` Junio C Hamano
2020-01-30  7:17           ` Jeff King [this message]
2020-01-30 19:16             ` Junio C Hamano
2020-01-31  0:15               ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20200130071700.GB2189233@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=davidburstrom@spotify.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).