{"thread":{"id":"29844","subject":"[PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","startedAt":"2012-03-05T19:39:15Z","lastAt":"2012-03-13T19:32:56Z","messageCount":25,"participants":["Torsten Bögershausen","Junio C Hamano","Ævar Arnfjörð Bjarmason","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"186135","messageId":"201203052039.16893.tboegi@web.de","threadId":"29844","inReplyTo":null,"subject":"[PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-03-05T19:39:15Z","receivedAt":"2012-03-05T19:39:15Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"t0204 tries to use a ISO-8859-1 locale and expects that characters\noutside the ISO-8859-1 code range are converted in \"question marks\".\n\nThe gettext under Mac OS X ignores the ISO-8859-1 locale and uses\nUTF-8 anyway.\n\nFixed even whitespace in this very test case.\n\nLet the test pass when UTF-8 is returned.\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n This is a suggestion to make t0204--gettext-reencode-sanity.sh to pass under Mac OSX\n The tests checks if unicode characters outside ISO-8859-1 are converted into '?'.\n The Mac OS X version of gettext does not seem to support ISO-8859-1 at all.\n Even if we set the locale to ISO-8859-1, UTF-8 is used anyway.\n\n\n t/t0204-gettext-reencode-sanity.sh |   16 +++++++++++-----\n 1 files changed, 11 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh\nindex 189af90..78f0889 100755\n--- a/t/t0204-gettext-reencode-sanity.sh\n+++ b/t/t0204-gettext-reencode-sanity.sh\n@@ -27,16 +27,22 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UT\n '\n \n test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes' '\n-    LANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" gettext \"TEST: Old English Runes\" >runes &&\n+\tLANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" gettext \"TEST: Old English Runes\" >runes &&\n \n \tif grep \"^TEST: Old English Runes$\" runes\n \tthen\n \t\tsay \"Your system can not handle this complexity and returns the string as-is\"\n \telse\n-\t\t# Both Solaris and GNU libintl will return this stream of\n-\t\t# question marks, so it is s probably portable enough\n-\t\tprintf \"TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????\" >runes-expect &&\n-\t\ttest_cmp runes-expect runes\n+\t\tif grep \"^TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ\" runes\n+\t\tthen\n+\t\t\t# Mac OS supports only UTF-8, even if we want ISO-8859-1 we get UTF-8\n+\t\t\tsay \"Your system handles only utf-8\"\n+\t\telse\n+\t\t\t# Both Solaris and GNU libintl will return this stream of\n+\t\t\t# question marks, so it is s probably portable enough\n+\t\t\tprintf \"TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????\" >runes-expect &&\n+\t\t\ttest_cmp runes-expect runes\n+\t\tfi\n \tfi\n '\n \n-- \n1.7.9.rc2\n"},{"id":"186141","messageId":"7vzkbuzss7.fsf@alter.siamese.dyndns.org","threadId":"29844","inReplyTo":"201203052039.16893.tboegi@web.de","subject":"Re: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-05T20:39:36Z","receivedAt":"2012-03-05T20:39:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\nSwapping to: and cc: as Torsten is not the primary \"guilty party\" on\nthis one.\n\n> t0204 tries to use a ISO-8859-1 locale and expects that characters\n> outside the ISO-8859-1 code range are converted in \"question marks\".\n>\n> The gettext under Mac OS X ignores the ISO-8859-1 locale and uses\n> UTF-8 anyway.\n> ...\n> Let the test pass when UTF-8 is returned.\n\nThis is insane.  Is passing this test *that* important to the point\nthat you would need to change the passing criteria, instead of\nfixing the behaviour of the code being tested?\n\nIt looks like these tests prepare *.mo files based on UTF-8 *.po\nfiles, and ask the system iconv machinery to show them in UTF-8 and\nnon UTF-8 locales.  And the conversion is an impossible one in this\ncase, as the messages won't fit in iso-8859-1.\n\nSome platforms may be capable of noticing that and fill them with\nquestion marks, and some others may notice the impossible request\nbut do something other than \"question marks\", and yet some others\nmay not even notice iso-8859-1 is requested and spit out the\noriginal UTF-8 verbatim.\n\nI do not see any reason to insist that their fallback behaviour must\nbe to fill them with question marks.  In other words, I simply do\nnot see the point of this test and the original \"pass runs of\nquestion\" to begin with, and this patch makes things even worse.\n\nWhy not get rid of this single test that only tries to check the\noutput for an impossible request?\n\nÆvar, am I missing something?\n"},{"id":"186337","messageId":"CACBZZX4P=JSdP_vLOMx5r3R+YO8SMSs5W8+vf2DMibKMwBx_Vg@mail.gmail.com","threadId":"29844","inReplyTo":"7vzkbuzss7.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2012-03-07T21:03:49Z","receivedAt":"2012-03-07T21:03:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Mar 5, 2012 at 21:39, Junio C Hamano <gitster@pobox.com> wrote:\n> I do not see any reason to insist that their fallback behaviour must\n> be to fill them with question marks.  In other words, I simply do\n> not see the point of this test and the original \"pass runs of\n> question\" to begin with, and this patch makes things even worse.\n>\n> Why not get rid of this single test that only tries to check the\n> output for an impossible request?\n>\n> Ævar, am I missing something?\n\nSorry about the late reply, I think if anything it needs to be\nexpanded beyond its current scope.\n\nOur gettext implementation is peculiar in two ways:\n\n * We support 3 different languages, one of which (Perl) is supported\n   through a non-GNU package.\n\n * We have this fantastic hack in gettext.c's init_gettext_charset to\n   deal with a glibc bug.\n\nI think in particular re-encoding works completely differently under\nthe Perl i18n library than it does with GNU gettext (and we don't have\ntests for this) and instead of just dropping unknown characters under\nnon-UTF-8 locales on some platforms everything may turn into complete\ngibberish.\n\nWhen I added this test this was what I was planning to smoke\nout. Different behaviors on different platforms. In this case the OSX\nbehavior seems benign, but I'd much rather patch the test to detect\nOSX rather than removing it entirely, maybe other obscure operating\nsystems (Aix, HP/UX etc.) will behave differently.\n\nWe still don't really have any use of the i18n feature, i.e. we\nhaven't had translations submitted yet, and thus don't have any\nusers. I think it's important to be pro-active about trying to spot\nany issues that might affect end users before they happen.\n"},{"id":"186340","messageId":"7vfwdkm6xs.fsf@alter.siamese.dyndns.org","threadId":"29844","inReplyTo":"CACBZZX4P=JSdP_vLOMx5r3R+YO8SMSs5W8+vf2DMibKMwBx_Vg@mail.gmail.com","subject":"Re: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-07T21:34:23Z","receivedAt":"2012-03-07T21:34:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> I think in particular re-encoding works completely differently under\n> the Perl i18n library than it does with GNU gettext (and we don't have\n> tests for this) and instead of just dropping unknown characters under\n> non-UTF-8 locales on some platforms everything may turn into complete\n> gibberish.\n>\n> When I added this test this was what I was planning to smoke\n> out. Different behaviors on different platforms. In this case the OSX\n> behavior seems benign,...\n\nI am not sure where you are drawing the line between \"complete\ngibberish\" and \"incorrect transliteration\", but if you mean by\n\"gibberish\" something that makes user's terminal go berserk,\nspitting out UTF-8 when the reader has asked for and is expecting\nLatin-1 is already throwing \"gibberish\", so Mac OS X should fail the\ntest, I would think.\n\nBut for this particular test case, it is even worse, as the test is\nasking to do an impossible task to the transliteration machinery, so\nit is not even \"gibberish\" test.  If the input caused the program to\nterminate without an error but without producing an output, that\nwon't be \"gibberish\" case, but should that be treated as \"success\"?\n\n> I think it's important to be pro-active about trying to spot\n> any issues that might affect end users before they happen.\n\nThe goal is noble, but asking the platform to perform an impossible\ntask and subjectively judging if the failure mode is acceptable is\nnot the way to do so, I would have to say.\n"},{"id":"186341","messageId":"CACBZZX4q0Da=H=-fO86f2YN+CmE25QfEgAp8Efmdyf65CGckiQ@mail.gmail.com","threadId":"29844","inReplyTo":"7vfwdkm6xs.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2012-03-07T21:43:10Z","receivedAt":"2012-03-07T21:43:10Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Mar 7, 2012 at 22:34, Junio C Hamano <gitster@pobox.com> wrote:\n>> I think it's important to be pro-active about trying to spot\n>> any issues that might affect end users before they happen.\n>\n> The goal is noble, but asking the platform to perform an impossible\n> task and subjectively judging if the failure mode is acceptable is\n> not the way to do so, I would have to say.\n\nI leave it up to you whether you want to accept the patch to remove\nit, but with it included we at least *know* what the failure modes\nare, since we get user reports about it.\n\nThat's the reason I put it in there to begin with. Because I have no\nidea how all these pieces play together with systems in the wild, and\nI'd like to pro-actively find out about that.\n"},{"id":"186343","messageId":"7v4nu0m5tb.fsf@alter.siamese.dyndns.org","threadId":"29844","inReplyTo":"CACBZZX4q0Da=H=-fO86f2YN+CmE25QfEgAp8Efmdyf65CGckiQ@mail.gmail.com","subject":"Re: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-07T21:58:40Z","receivedAt":"2012-03-07T21:58:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> On Wed, Mar 7, 2012 at 22:34, Junio C Hamano <gitster@pobox.com> wrote:\n>>> I think it's important to be pro-active about trying to spot\n>>> any issues that might affect end users before they happen.\n>>\n>> The goal is noble, but asking the platform to perform an impossible\n>> task and subjectively judging if the failure mode is acceptable is\n>> not the way to do so, I would have to say.\n>\n> I leave it up to you whether you want to accept the patch to remove\n> it, but with it included we at least *know* what the failure modes\n> are, since we get user reports about it.\n>\n> That's the reason I put it in there to begin with. Because I have no\n> idea how all these pieces play together with systems in the wild, and\n> I'd like to pro-actively find out about that.\n\nAre we talking about the same specific test?\n\nWhat you said above all makes sense and I agreed that it is a noble\ngoal, *if* and only if the test is about the case we *expect* to\nwork.  This particular one prepares a message that cannot possibly\nbe transliterated to iso-8859-1 and asks the system to show it.\n\nWhat scenario do you have in mind that we (or the end user for that\nmatter) might benefit by having this test?  What would be the next\nstep for us, when this test finds yet another mode of breakage that\nspews out a different kind of garbage other than runs of \"?\", the\nkey used to query the message catalog (\"TEST: Old English Runes\"),\nor the raw value stored in the message catalog (runes in UTF-8)?\n"},{"id":"186344","messageId":"CACBZZX6W=-ZchaCsLGdpZ420L_9=w8AHD8BNVb7XV5M-hc0Qhg@mail.gmail.com","threadId":"29844","inReplyTo":"7v4nu0m5tb.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2012-03-07T22:04:43Z","receivedAt":"2012-03-07T22:04:43Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"2012/3/7 Junio C Hamano <gitster@pobox.com>:\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>\n>> On Wed, Mar 7, 2012 at 22:34, Junio C Hamano <gitster@pobox.com> wrote:\n>>>> I think it's important to be pro-active about trying to spot\n>>>> any issues that might affect end users before they happen.\n>>>\n>>> The goal is noble, but asking the platform to perform an impossible\n>>> task and subjectively judging if the failure mode is acceptable is\n>>> not the way to do so, I would have to say.\n>>\n>> I leave it up to you whether you want to accept the patch to remove\n>> it, but with it included we at least *know* what the failure modes\n>> are, since we get user reports about it.\n>>\n>> That's the reason I put it in there to begin with. Because I have no\n>> idea how all these pieces play together with systems in the wild, and\n>> I'd like to pro-actively find out about that.\n>\n> Are we talking about the same specific test?\n>\n> What you said above all makes sense and I agreed that it is a noble\n> goal, *if* and only if the test is about the case we *expect* to\n> work.  This particular one prepares a message that cannot possibly\n> be transliterated to iso-8859-1 and asks the system to show it.\n>\n> What scenario do you have in mind that we (or the end user for that\n> matter) might benefit by having this test?\n\nE.g. if we find out that their implementation of gettext panics\ninstead of showing question marks that means we'd have to pay special\nattention to that platform.\n\nAnyway, I admit that this is an obscure edge case. I really just like\nthe idea of having complete knowledge (which we'll have in time since\nwe get ported everywhere) about how the various aspects of our i18n\nimplementation work.\n\nHaving that information doesn't cost us a lot, in this case we can\njust amend the test to assert that on OSX the output should be the\nsame as under the UTF-8 output.\n"},{"id":"186357","messageId":"7vd38okmp0.fsf@alter.siamese.dyndns.org","threadId":"29844","inReplyTo":"CACBZZX6W=-ZchaCsLGdpZ420L_9=w8AHD8BNVb7XV5M-hc0Qhg@mail.gmail.com","subject":"Re: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-07T23:36:59Z","receivedAt":"2012-03-07T23:36:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> Having that information doesn't cost us a lot, in this case we can\n> just amend the test to assert that on OSX the output should be the\n> same as under the UTF-8 output.\n\nKnown modes of error behaviour are to show:\n\n - runs of \"?\", saying \"I dunno\";\n\n - the key used to query the message catalog (\"TEST: Old English\n   Runes\"), saying \"I don't do i18n\"; or\n\n - the raw value stored in the message catalog (runes in UTF-8).\n\nand each makes sort-of sense in its own way.\n\nI would be OK if the patch read like the attached, but I do not\nthink treating the \"show key\" and \"stuff with ?\" case differently\nlike the original code did makes any sense.\n\nIt may be better to clarify in the \"say\" comment that this test is\nnot about finding if the user's system is *broken* but about seeing\nif the \"undefined\" behaviour upon user error is one that we\nrecognize, though.\n\n t/t0204-gettext-reencode-sanity.sh |   21 +++++++++++++--------\n 1 file changed, 13 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh\nindex 189af90..8911e93 100755\n--- a/t/t0204-gettext-reencode-sanity.sh\n+++ b/t/t0204-gettext-reencode-sanity.sh\n@@ -7,6 +7,7 @@ test_description=\"Gettext reencoding of our *.po/*.mo files works\"\n \n . ./lib-gettext.sh\n \n+RUNES=\"TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ\"\n \n test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic' '\n     printf \"TILRAUN: Halló Heimur!\" >expect &&\n@@ -15,7 +16,7 @@ test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo\n '\n \n test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes' '\n-    printf \"TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ\" >expect &&\n+    printf \"%s\" \"$RUNES\" >expect &&\n     LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"TEST: Old English Runes\" >actual &&\n     test_cmp expect actual\n '\n@@ -28,15 +29,19 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UT\n \n test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes' '\n     LANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" gettext \"TEST: Old English Runes\" >runes &&\n-\n-\tif grep \"^TEST: Old English Runes$\" runes\n+\trunes=$(cat runes) &&\n+\tif test \"z$runes\" = \"zTEST: Old English Runes\"\n+\tthen\n+\t\tsay \"Your system gives back the key to message catalog for an impossible request\"\n+\telif test \"z$runes\" = \"zTILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????\"\n+\tthen\n+\t\tsay \"Your system replaces an impossible character with ?\"\n+ \telif test \"z$runes\" = \"z$RUNES\"\n \tthen\n-\t\tsay \"Your system can not handle this complexity and returns the string as-is\"\n+\t\tsay \"Your system gives back the raw message for an impossible request\"\n \telse\n-\t\t# Both Solaris and GNU libintl will return this stream of\n-\t\t# question marks, so it is s probably portable enough\n-\t\tprintf \"TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????\" >runes-expect &&\n-\t\ttest_cmp runes-expect runes\n+\t\tsay \"We error behaviour your system shows\"\n+\t\tfalse\n \tfi\n '\n \n"},{"id":"186362","messageId":"7vmx7sj7vo.fsf@alter.siamese.dyndns.org","threadId":"29844","inReplyTo":"7vd38okmp0.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-07T23:42:19Z","receivedAt":"2012-03-07T23:42:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> +\t\tsay \"We error behaviour your system shows\"\n> +\t\tfalse\n\nTypo--\"We do not recognize the error behaviour your system shows\"\nor something.\n"},{"id":"186375","messageId":"4F5849AE.1070807@web.de","threadId":"29844","inReplyTo":"7vd38okmp0.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-03-08T05:54:54Z","receivedAt":"2012-03-08T05:54:54Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 08.03.12 00:36, Junio C Hamano wrote:\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n> \n>> Having that information doesn't cost us a lot, in this case we can\n>> just amend the test to assert that on OSX the output should be the\n>> same as under the UTF-8 output.\n> \n> Known modes of error behaviour are to show:\n> \n>  - runs of \"?\", saying \"I dunno\";\n> \n>  - the key used to query the message catalog (\"TEST: Old English\n>    Runes\"), saying \"I don't do i18n\"; or\n> \n>  - the raw value stored in the message catalog (runes in UTF-8).\n> \n> and each makes sort-of sense in its own way.\n> \n> I would be OK if the patch read like the attached, but I do not\n> think treating the \"show key\" and \"stuff with ?\" case differently\n> like the original code did makes any sense.\n> \n> It may be better to clarify in the \"say\" comment that this test is\n> not about finding if the user's system is *broken* but about seeing\n> if the \"undefined\" behaviour upon user error is one that we\n> recognize, though.\n> \n>  t/t0204-gettext-reencode-sanity.sh |   21 +++++++++++++--------\n>  1 file changed, 13 insertions(+), 8 deletions(-)\n> \n> diff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh\n> index 189af90..8911e93 100755\n> --- a/t/t0204-gettext-reencode-sanity.sh\n> +++ b/t/t0204-gettext-reencode-sanity.sh\n> @@ -7,6 +7,7 @@ test_description=\"Gettext reencoding of our *.po/*.mo files works\"\n>  \n>  . ./lib-gettext.sh\n>  \n> +RUNES=\"TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ\"\n>  \n>  test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic' '\n>      printf \"TILRAUN: Halló Heimur!\" >expect &&\n> @@ -15,7 +16,7 @@ test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo\n>  '\n>  \n>  test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes' '\n> -    printf \"TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ\" >expect &&\n> +    printf \"%s\" \"$RUNES\" >expect &&\n>      LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"TEST: Old English Runes\" >actual &&\n>      test_cmp expect actual\n>  '\n> @@ -28,15 +29,19 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UT\n>  \n>  test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes' '\n>      LANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" gettext \"TEST: Old English Runes\" >runes &&\n> -\n> -\tif grep \"^TEST: Old English Runes$\" runes\n> +\trunes=$(cat runes) &&\n> +\tif test \"z$runes\" = \"zTEST: Old English Runes\"\n> +\tthen\n> +\t\tsay \"Your system gives back the key to message catalog for an impossible request\"\n> +\telif test \"z$runes\" = \"zTILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????\"\n> +\tthen\n> +\t\tsay \"Your system replaces an impossible character with ?\"\n> + \telif test \"z$runes\" = \"z$RUNES\"\n>  \tthen\n> -\t\tsay \"Your system can not handle this complexity and returns the string as-is\"\n> +\t\tsay \"Your system gives back the raw message for an impossible request\"\n>  \telse\n> -\t\t# Both Solaris and GNU libintl will return this stream of\n> -\t\t# question marks, so it is s probably portable enough\n> -\t\tprintf \"TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????\" >runes-expect &&\n> -\t\ttest_cmp runes-expect runes\n> +\t\tsay \"We error behaviour your system shows\"\n> +\t\tfalse\n>  \tfi\n>  '\n>  \n> \n> \n> \n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\nWith that patch the t0204 test is passed.\n\n(based on 1.7.10-rc0).\n\n And all the other tests passed as well.\n\n/Torsten\n\n\n\nApplying: Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX\n/Users/tb/projects/git/git_git/.git/rebase-apply/patch:35: space before tab in indent.\n        elif test \"z$runes\" = \"z$RUNES\"\nwarning: 1 line adds whitespace errors.\n~/projects/git/git_git> cd t\n~/projects/git/git_git/t> ./t0204-gettext-reencode-sanity.sh\n# lib-gettext: No is_IS UTF-8 locale available\n# lib-gettext: No is_IS ISO-8859-1 locale available\nok 1 # skip gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic (missing GETTEXT_LOCALE)\nok 2 # skip gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes (missing GETTEXT_LOCALE)\nok 3 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic (missing GETTEXT_ISO_LOCALE)\nok 4 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes (missing GETTEXT_ISO_LOCALE)\nok 5 # skip gettext: Fetching a UTF-8 msgid -> UTF-8 (missing GETTEXT_LOCALE)\nok 6 # skip gettext: Fetching a UTF-8 msgid -> ISO-8859-1 (missing GETTEXT_ISO_LOCALE)\nok 7 # skip gettext.c: git init UTF-8 -> UTF-8 (missing GETTEXT_LOCALE)\nok 8 # skip gettext.c: git init UTF-8 -> ISO-8859-1 (missing GETTEXT_ISO_LOCALE)\n# passed all 8 test(s)\n1..8\n"},{"id":"186386","messageId":"4F585E70.90302@viscovery.net","threadId":"29844","inReplyTo":"4F5849AE.1070807@web.de","subject":"Re: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2012-03-08T07:23:28Z","receivedAt":"2012-03-08T07:23:28Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 3/8/2012 6:54, schrieb Torsten Bögershausen:\n> On 08.03.12 00:36, Junio C Hamano wrote:\n>>  test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes' '\n\n> ok 4 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes (missing GETTEXT_ISO_LOCALE)\n         ^^^^\nHuh? How can you have tripped over this test in the first place? The\nprerequisite did not change in Junio's patch. Why was the test not skipped\nbefore you started this thread with your own patch?\n\n-- Hannes\n"},{"id":"186400","messageId":"2412B623-E91D-44E6-8E08-97AE8CD9B978@web.de","threadId":"29844","inReplyTo":"4F585E70.90302@viscovery.net","subject":"Re: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-03-08T09:21:43Z","receivedAt":"2012-03-08T09:21:43Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\nAm 08.03.2012 um 08:23 schrieb Johannes Sixt:\n\n> Am 3/8/2012 6:54, schrieb Torsten Bögershausen:\n>> On 08.03.12 00:36, Junio C Hamano wrote:\n>>> test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes' '\n> \n>> ok 4 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes (missing GETTEXT_ISO_LOCALE)\n>         ^^^^\n> Huh? How can you have tripped over this test in the first place? The\n> prerequisite did not change in Junio's patch. Why was the test not skipped\n> before you started this thread with your own patch?\n> \n> -- Hannes\n> \n\nHm, \nthings are getting confusing.\n\nAfter re-booting the machine, cloning git ... I get the following on a clean 1.7.10-rc0 (without Junios patch):\n\ntb@birne:~/projects/git/git_clean/t> ./t0204-gettext-reencode-sanity.sh \n# lib-gettext: No is_IS UTF-8 locale available\n# lib-gettext: No is_IS ISO-8859-1 locale available\nok 1 # skip gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic (missing GETTEXT_LOCALE)\nok 2 # skip gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes (missing GETTEXT_LOCALE)\nok 3 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic (missing GETTEXT_ISO_LOCALE)\nok 4 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes (missing GETTEXT_ISO_LOCALE)\nok 5 # skip gettext: Fetching a UTF-8 msgid -> UTF-8 (missing GETTEXT_LOCALE)\nok 6 # skip gettext: Fetching a UTF-8 msgid -> ISO-8859-1 (missing GETTEXT_ISO_LOCALE)\nok 7 # skip gettext.c: git init UTF-8 -> UTF-8 (missing GETTEXT_LOCALE)\nok 8 # skip gettext.c: git init UTF-8 -> ISO-8859-1 (missing GETTEXT_ISO_LOCALE)\n# passed all 8 test(s)\n1..8\n\non 5e9637c629702e3d41ad01d95956d1835  the log looks like this:\n\n\ntb@birne:~/projects/git/git_clean/t> ./t0204-gettext-reencode-sanity.sh \n# lib-gettext: Found 'is_IS.UTF-8' as an is_IS UTF-8 locale\n# lib-gettext: Found 'is_IS.ISO8859-1' as an is_IS ISO-8859-1 locale\nok 1 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic\nok 2 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes\nok 3 - gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic\nok 4 - gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes\nok 5 - gettext: Fetching a UTF-8 msgid -> UTF-8\nok 6 - gettext: Fetching a UTF-8 msgid -> ISO-8859-1\nok 7 - gettext.c: git init UTF-8 -> UTF-8\nok 8 - gettext.c: git init UTF-8 -> ISO-8859-1\n# passed all 8 test(s)\n1..8\ntb@birne:~/projects/git/git_clean/t> \n\n\nAt the moment I would like to say sorry for the noise.\nIf somebody is interested. I can dig into details later this evening (european time) \n/Torsten\n"},{"id":"186428","messageId":"4F58A0F2.5020400@web.de","threadId":"29844","inReplyTo":"2412B623-E91D-44E6-8E08-97AE8CD9B978@web.de","subject":"Re: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-03-08T12:07:14Z","receivedAt":"2012-03-08T12:07:14Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 08.03.12 10:21, Torsten Bögershausen wrote:\n> \n> Am 08.03.2012 um 08:23 schrieb Johannes Sixt:\n> \n>> Am 3/8/2012 6:54, schrieb Torsten Bögershausen:\n>>> On 08.03.12 00:36, Junio C Hamano wrote:\n>>>> test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes' '\n>>\n>>> ok 4 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes (missing GETTEXT_ISO_LOCALE)\n>>         ^^^^\n>> Huh? How can you have tripped over this test in the first place? The\n>> prerequisite did not change in Junio's patch. Why was the test not skipped\n>> before you started this thread with your own patch?\n>>\n>> -- Hannes\n>>\n> \n> Hm, \n> things are getting confusing.\n> \n> After re-booting the machine, cloning git ... I get the following on a clean 1.7.10-rc0 (without Junios patch):\n> \n> tb@birne:~/projects/git/git_clean/t> ./t0204-gettext-reencode-sanity.sh \n> # lib-gettext: No is_IS UTF-8 locale available\n> # lib-gettext: No is_IS ISO-8859-1 locale available\n> ok 1 # skip gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic (missing GETTEXT_LOCALE)\n> ok 2 # skip gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes (missing GETTEXT_LOCALE)\n> ok 3 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic (missing GETTEXT_ISO_LOCALE)\n> ok 4 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes (missing GETTEXT_ISO_LOCALE)\n> ok 5 # skip gettext: Fetching a UTF-8 msgid -> UTF-8 (missing GETTEXT_LOCALE)\n> ok 6 # skip gettext: Fetching a UTF-8 msgid -> ISO-8859-1 (missing GETTEXT_ISO_LOCALE)\n> ok 7 # skip gettext.c: git init UTF-8 -> UTF-8 (missing GETTEXT_LOCALE)\n> ok 8 # skip gettext.c: git init UTF-8 -> ISO-8859-1 (missing GETTEXT_ISO_LOCALE)\n> # passed all 8 test(s)\n> 1..8\n> \n> on 5e9637c629702e3d41ad01d95956d1835  the log looks like this:\n> \n> \n> tb@birne:~/projects/git/git_clean/t> ./t0204-gettext-reencode-sanity.sh \n> # lib-gettext: Found 'is_IS.UTF-8' as an is_IS UTF-8 locale\n> # lib-gettext: Found 'is_IS.ISO8859-1' as an is_IS ISO-8859-1 locale\n> ok 1 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic\n> ok 2 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes\n> ok 3 - gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic\n> ok 4 - gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes\n> ok 5 - gettext: Fetching a UTF-8 msgid -> UTF-8\n> ok 6 - gettext: Fetching a UTF-8 msgid -> ISO-8859-1\n> ok 7 - gettext.c: git init UTF-8 -> UTF-8\n> ok 8 - gettext.c: git init UTF-8 -> ISO-8859-1\n> # passed all 8 test(s)\n> 1..8\n> tb@birne:~/projects/git/git_clean/t> \n> \n> \n> At the moment I would like to say sorry for the noise.\n> If somebody is interested. I can dig into details later this evening (european time) \n> /Torsten\n\nHere we have the change from t0204-gettext-reencode-sanity.sh beeing passed \ninto all tests being skipped under Mac OS X:\n\n42f16113ee87ff667fef3a821e:\n# lib-gettext: Found 'is_IS.UTF-8' as an is_IS UTF-8 locale\n# lib-gettext: Found 'is_IS.ISO8859-1' as an is_IS ISO-8859-1 locale\nok 1 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic\nok 2 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes\nok 3 - gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic\nok 4 - gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes\nok 5 - gettext: Fetching a UTF-8 msgid -> UTF-8\nok 6 - gettext: Fetching a UTF-8 msgid -> ISO-8859-1\nok 7 - gettext.c: git init UTF-8 -> UTF-8\nok 8 - gettext.c: git init UTF-8 -> ISO-8859-1\n# passed all 8 test(s)\n1..8\n\nad17ea73477012bfe1027a8a999e9e2d9f62145:\n# lib-gettext: No is_IS UTF-8 locale available\n# lib-gettext: No is_IS ISO-8859-1 locale available\nok 1 # skip gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic (missing GETTEXT_LOCALE)\nok 2 # skip gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes (missing GETTEXT_LOCALE)\nok 3 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic (missing GETTEXT_ISO_LOCALE)\nok 4 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes (missing GETTEXT_ISO_LOCALE)\nok 5 # skip gettext: Fetching a UTF-8 msgid -> UTF-8 (missing GETTEXT_LOCALE)\nok 6 # skip gettext: Fetching a UTF-8 msgid -> ISO-8859-1 (missing GETTEXT_ISO_LOCALE)\nok 7 # skip gettext.c: git init UTF-8 -> UTF-8 (missing GETTEXT_LOCALE)\nok 8 # skip gettext.c: git init UTF-8 -> ISO-8859-1 (missing GETTEXT_ISO_LOCALE)\n# passed all 8 test(s)\n\n\ncommit ad17ea734770126bfe1027a8a999e9e2d9f62145\nAuthor: Alex Riesen <raa.lkml@gmail.com>\nDate:   Mon Jan 23 14:04:29 2012 -0800\n\n    add a Makefile switch to avoid gettext translation in shell scripts\n    \n    Some systems have gettext.sh (GNU gettext) installed, but it is either\n    broken or misconfigured in such a way so its output is not usable.  In\n    case the users of these systems are unable or not interested in fixing\n    them, setting the new Makefile switch should help:\n    \n        make USE_GETTEXT_SCHEME=fallthrough\n    \n    This will replace the translation routines with fallthrough versions,\n    that does not use gettext from the platform.\n    \n    Signed-off-by: Alex Riesen <raa.lkml@gmail.com>\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\n:100644 100644 9470a1034396a5f3ee36c5d0e6ffc54e21bb3820 a0f2464a9b647fcd6b817e9bb86b7f79190acb01 M      Makefile\n:100644 100644 6648bd3726f18c95de5737663fae652cadac0003 d5fae993b0c093bdd07079101df303c2c74deae3 M      git-sh-i18n.sh\n"},{"id":"186591","messageId":"7vlin94dbc.fsf_-_@alter.siamese.dyndns.org","threadId":"29844","inReplyTo":"7vd38okmp0.fsf@alter.siamese.dyndns.org","subject":"Re*: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-09T22:30:47Z","receivedAt":"2012-03-09T22:30:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I would be OK if the patch read like the attached, but I do not\n> think treating the \"show key\" and \"stuff with ?\" case differently\n> like the original code did makes any sense.\n\nOk, here is a re-roll with proper-ish log message.  I've tested this\nonly in one of my VMs with is_IS locale (which happened to be Fedora\n15).\n\n-- >8 --\nSubject: [PATCH] t0204: clarify the \"observe undefined behaviour\" test\n\nThis test asks for an impossible conversion to the system by\npreparing an UTF-8 translation with characters that cannot be\nexpressed in ISO-8859-1, and then asking the message shown in\nISO-8859-1.  Even though the behaviour against such a request is\nundefined, it may be interesting to see what the system does, and\nthe purpose of this test is to see if there are platforms that\nexhibit behaviour that we haven't seen.\n\nThe original recognized two known modes of behaviour:\n\n - the key used to query the message catalog (\"TEST: Old English\n   Runes\"), saying \"I cannot do that i18n\".\n - impossible characters replaced with ASCII \"?\", saying \"I punt\".\n\nbut they were treated totally differently.  The test simply issued\nan informational message \"Your system punts on this one\" for the\nfirst error mode, while it diagnosed the latter as \"Your system is\ngood; you pass!\".\n\nIt turns out that Mac OS X exhibits a third mode of error behaviour,\nto spew out the raw value stored in the message catalog.  The test\ndiagnosed this behaviour as \"broken\", but it is merely trying to do\nits best to respond to an impossible request by saying \"I punt\" in a\nway that is slightly different from the second one.\n\nUpdate the offending test to make it clear what is (and is not)\nbeing tested, update the code structure so that newly discovered\nerror mode can easily be added to it later, and reword the message\nthat comes from a failing case to clarify that it is not the system\nthat is broken when it fails, but merely that the behaviour is not\nsomething we have seen.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t0204-gettext-reencode-sanity.sh |   37 ++++++++++++++++++++++--------------\n 1 file changed, 23 insertions(+), 14 deletions(-)\n\ndiff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh\nindex 189af90..8437e51 100755\n--- a/t/t0204-gettext-reencode-sanity.sh\n+++ b/t/t0204-gettext-reencode-sanity.sh\n@@ -7,6 +7,10 @@ test_description=\"Gettext reencoding of our *.po/*.mo files works\"\n \n . ./lib-gettext.sh\n \n+# The constants used in a tricky observation for undefined behaviour\n+RUNES=\"TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ\"\n+PUNTS=\"TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????\"\n+MSGKEY=\"TEST: Old English Runes\"\n \n test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic' '\n     printf \"TILRAUN: Halló Heimur!\" >expect &&\n@@ -15,8 +19,8 @@ test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo\n '\n \n test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes' '\n-    printf \"TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ\" >expect &&\n-    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"TEST: Old English Runes\" >actual &&\n+    printf \"%s\" \"$RUNES\" >expect &&\n+    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"$MSGKEY\" >actual &&\n     test_cmp expect actual\n '\n \n@@ -26,18 +30,23 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UT\n     test_cmp expect actual\n '\n \n-test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes' '\n-    LANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" gettext \"TEST: Old English Runes\" >runes &&\n-\n-\tif grep \"^TEST: Old English Runes$\" runes\n-\tthen\n-\t\tsay \"Your system can not handle this complexity and returns the string as-is\"\n-\telse\n-\t\t# Both Solaris and GNU libintl will return this stream of\n-\t\t# question marks, so it is s probably portable enough\n-\t\tprintf \"TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????\" >runes-expect &&\n-\t\ttest_cmp runes-expect runes\n-\tfi\n+test_expect_success GETTEXT_ISO_LOCALE 'gettext: impossible ISO-8859-1 output' '\n+\tLANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" gettext \"$MSGKEY\" >runes &&\n+\tcase \"$(cat runes)\" in\n+\t\"$MSGKEY\")\n+\t\tsay \"Your system gives back the key to message catalog\"\n+\t\t;;\n+\t\"$PUNTS\")\n+\t\tsay \"Your system replaces an impossible character with ?\"\n+\t\t;;\n+\t\"$RUNES\")\n+\t\tsay \"Your system gives back the raw message for an impossible request\"\n+\t\t;;\n+\t*)\n+\t\tsay \"We never saw the error behaviour your system exhibits\"\n+\t\tfalse\n+\t\t;;\n+\tesac\n '\n \n test_expect_success GETTEXT_LOCALE 'gettext: Fetching a UTF-8 msgid -> UTF-8' '\n-- \n1.7.10.rc0.32.g00187\n"},{"id":"186635","messageId":"4F5BD585.5050007@web.de","threadId":"29844","inReplyTo":"7vlin94dbc.fsf_-_@alter.siamese.dyndns.org","subject":"Re: Re*: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-03-10T22:28:21Z","receivedAt":"2012-03-10T22:28:21Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 03/09/2012 11:30 PM, Junio C Hamano wrote:\n> Junio C Hamano<gitster@pobox.com>  writes:\n>\n>> I would be OK if the patch read like the attached, but I do not\n>> think treating the \"show key\" and \"stuff with ?\" case differently\n>> like the original code did makes any sense.\n> Ok, here is a re-roll with proper-ish log message.  I've tested this\n> only in one of my VMs with is_IS locale (which happened to be Fedora\n> 15).\n>\n> -- >8 --\n> Subject: [PATCH] t0204: clarify the \"observe undefined behaviour\" test\n>\n> This test asks for an impossible conversion to the system by\n> preparing an UTF-8 translation with characters that cannot be\n> expressed in ISO-8859-1, and then asking the message shown in\n> ISO-8859-1.  Even though the behaviour against such a request is\n> undefined, it may be interesting to see what the system does, and\n> the purpose of this test is to see if there are platforms that\n> exhibit behaviour that we haven't seen.\n>\n> The original recognized two known modes of behaviour:\n>\n>   - the key used to query the message catalog (\"TEST: Old English\n>     Runes\"), saying \"I cannot do that i18n\".\n>   - impossible characters replaced with ASCII \"?\", saying \"I punt\".\n>\n> but they were treated totally differently.  The test simply issued\n> an informational message \"Your system punts on this one\" for the\n> first error mode, while it diagnosed the latter as \"Your system is\n> good; you pass!\".\n>\n> It turns out that Mac OS X exhibits a third mode of error behaviour,\n> to spew out the raw value stored in the message catalog.  The test\n> diagnosed this behaviour as \"broken\", but it is merely trying to do\n> its best to respond to an impossible request by saying \"I punt\" in a\n> way that is slightly different from the second one.\n>\n> Update the offending test to make it clear what is (and is not)\n> being tested, update the code structure so that newly discovered\n> error mode can easily be added to it later, and reword the message\n> that comes from a failing case to clarify that it is not the system\n> that is broken when it fails, but merely that the behaviour is not\n> something we have seen.\n>\n> Signed-off-by: Junio C Hamano<gitster@pobox.com>\n> ---\n>   t/t0204-gettext-reencode-sanity.sh |   37 ++++++++++++++++++++++--------------\n>   1 file changed, 23 insertions(+), 14 deletions(-)\n>\n> diff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh\n> index 189af90..8437e51 100755\n> --- a/t/t0204-gettext-reencode-sanity.sh\n> +++ b/t/t0204-gettext-reencode-sanity.sh\n> @@ -7,6 +7,10 @@ test_description=\"Gettext reencoding of our *.po/*.mo files works\"\n>\n>   . ./lib-gettext.sh\n>\n> +# The constants used in a tricky observation for undefined behaviour\n> +RUNES=\"TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ\"\n> +PUNTS=\"TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????\"\n> +MSGKEY=\"TEST: Old English Runes\"\n>\n>   test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic' '\n>       printf \"TILRAUN: Halló Heimur!\">expect&&\n> @@ -15,8 +19,8 @@ test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo\n>   '\n>\n>   test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes' '\n> -    printf \"TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ\">expect&&\n> -    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"TEST: Old English Runes\">actual&&\n> +    printf \"%s\" \"$RUNES\">expect&&\n> +    LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"$MSGKEY\">actual&&\n>       test_cmp expect actual\n>   '\n>\n> @@ -26,18 +30,23 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UT\n>       test_cmp expect actual\n>   '\n>\n> -test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes' '\n> -    LANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" gettext \"TEST: Old English Runes\">runes&&\n> -\n> -\tif grep \"^TEST: Old English Runes$\" runes\n> -\tthen\n> -\t\tsay \"Your system can not handle this complexity and returns the string as-is\"\n> -\telse\n> -\t\t# Both Solaris and GNU libintl will return this stream of\n> -\t\t# question marks, so it is s probably portable enough\n> -\t\tprintf \"TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????\">runes-expect&&\n> -\t\ttest_cmp runes-expect runes\n> -\tfi\n> +test_expect_success GETTEXT_ISO_LOCALE 'gettext: impossible ISO-8859-1 output' '\n> +\tLANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" gettext \"$MSGKEY\">runes&&\n> +\tcase \"$(cat runes)\" in\n> +\t\"$MSGKEY\")\n> +\t\tsay \"Your system gives back the key to message catalog\"\n> +\t\t;;\n> +\t\"$PUNTS\")\n> +\t\tsay \"Your system replaces an impossible character with ?\"\n> +\t\t;;\n> +\t\"$RUNES\")\n> +\t\tsay \"Your system gives back the raw message for an impossible request\"\n> +\t\t;;\n> +\t*)\n> +\t\tsay \"We never saw the error behaviour your system exhibits\"\n> +\t\tfalse\n> +\t\t;;\n> +\tesac\n>   '\n>\n>   test_expect_success GETTEXT_LOCALE 'gettext: Fetching a UTF-8 msgid ->  UTF-8' '\nHi Junio and all,\nThanks, the suggestion looks good to me.\n\nI want be able to test it, but there is one problem:\nI can not reproduce the original problem any more.\nI went through all commit, all my branches, run git bisect, restore old \nbackups:\nThe problem is gone.\n\nThen I diged into the test code. As Hannes pointed out, all test cases \nin t0204 are\nskipped.\nThis is not because Mac OS X does not have the island locale (it has),\nbut because GIT_INTERNAL_GETTEXT_SH_SCHEME\" = fallthrough.\n\nSide note: I will send an improved lib-gettext.sh as a suggested patch.\n\nBack to my setup:\nI realized, that there is i18n stuff installed by git under $HOME/share.\nCould that be a reason why I got that non-reproducable failure in t0204?\n\nAnd the skipped test cases seem to indicate that the gettext feature is\nnot working under Mac OS X?\n\nDoes anybody else have t0204 working and not skipped?\nAny hints are welcome.\n\n/Torsten\n"},{"id":"186639","messageId":"7vsjhfzlsw.fsf@alter.siamese.dyndns.org","threadId":"29844","inReplyTo":"4F5BD585.5050007@web.de","subject":"Re: Re*: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-11T06:36:15Z","receivedAt":"2012-03-11T06:36:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> This is not because Mac OS X does not have the island locale (it has),\n> but because GIT_INTERNAL_GETTEXT_SH_SCHEME\" = fallthrough.\n\nYou need to trace and see what happens in git-sh-i18n.sh then, I\nwould think.\n"},{"id":"186654","messageId":"4F5CC08C.90703@web.de","threadId":"29844","inReplyTo":"4F5BD585.5050007@web.de","subject":"Re: Re*: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-03-11T15:11:08Z","receivedAt":"2012-03-11T15:11:08Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 03/10/2012 11:28 PM, Torsten Bögershausen wrote:\n> On 03/09/2012 11:30 PM, Junio C Hamano wrote:\n>> Junio C Hamano<gitster@pobox.com> writes:\n>>\n>>> I would be OK if the patch read like the attached, but I do not\n>>> think treating the \"show key\" and \"stuff with ?\" case differently\n>>> like the original code did makes any sense.\n>> Ok, here is a re-roll with proper-ish log message. I've tested this\n>> only in one of my VMs with is_IS locale (which happened to be Fedora\n>> 15).\n>>\n>> -- >8 --\n>> Subject: [PATCH] t0204: clarify the \"observe undefined behaviour\" test\n>>\n>> This test asks for an impossible conversion to the system by\n>> preparing an UTF-8 translation with characters that cannot be\n>> expressed in ISO-8859-1, and then asking the message shown in\n>> ISO-8859-1. Even though the behaviour against such a request is\n>> undefined, it may be interesting to see what the system does, and\n>> the purpose of this test is to see if there are platforms that\n>> exhibit behaviour that we haven't seen.\n>>\n>> The original recognized two known modes of behaviour:\n>>\n>> - the key used to query the message catalog (\"TEST: Old English\n>> Runes\"), saying \"I cannot do that i18n\".\n>> - impossible characters replaced with ASCII \"?\", saying \"I punt\".\n>>\n>> but they were treated totally differently. The test simply issued\n>> an informational message \"Your system punts on this one\" for the\n>> first error mode, while it diagnosed the latter as \"Your system is\n>> good; you pass!\".\n>>\n>> It turns out that Mac OS X exhibits a third mode of error behaviour,\n>> to spew out the raw value stored in the message catalog. The test\n>> diagnosed this behaviour as \"broken\", but it is merely trying to do\n>> its best to respond to an impossible request by saying \"I punt\" in a\n>> way that is slightly different from the second one.\n>>\n>> Update the offending test to make it clear what is (and is not)\n>> being tested, update the code structure so that newly discovered\n>> error mode can easily be added to it later, and reword the message\n>> that comes from a failing case to clarify that it is not the system\n>> that is broken when it fails, but merely that the behaviour is not\n>> something we have seen.\n>>\n>> Signed-off-by: Junio C Hamano<gitster@pobox.com>\n>> ---\n>> t/t0204-gettext-reencode-sanity.sh | 37\n>> ++++++++++++++++++++++--------------\n>> 1 file changed, 23 insertions(+), 14 deletions(-)\n>>\n>> diff --git a/t/t0204-gettext-reencode-sanity.sh\n>> b/t/t0204-gettext-reencode-sanity.sh\n>> index 189af90..8437e51 100755\n>> --- a/t/t0204-gettext-reencode-sanity.sh\n>> +++ b/t/t0204-gettext-reencode-sanity.sh\n>> @@ -7,6 +7,10 @@ test_description=\"Gettext reencoding of our *.po/*.mo\n>> files works\"\n>>\n>> . ./lib-gettext.sh\n>>\n>> +# The constants used in a tricky observation for undefined behaviour\n>> +RUNES=\"TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ\n>> ᚹᛖᛥᚫ\"\n>> +PUNTS=\"TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ??\n>> ????\"\n>> +MSGKEY=\"TEST: Old English Runes\"\n>>\n>> test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our\n>> UTF-8 *.mo files / Icelandic' '\n>> printf \"TILRAUN: Halló Heimur!\">expect&&\n>> @@ -15,8 +19,8 @@ test_expect_success GETTEXT_LOCALE 'gettext:\n>> Emitting UTF-8 from our UTF-8 *.mo\n>> '\n>>\n>> test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our\n>> UTF-8 *.mo files / Runes' '\n>> - printf \"TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ\n>> ᚹᛖᛥᚫ\">expect&&\n>> - LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"TEST: Old English\n>> Runes\">actual&&\n>> + printf \"%s\" \"$RUNES\">expect&&\n>> + LANGUAGE=is LC_ALL=\"$is_IS_locale\" gettext \"$MSGKEY\">actual&&\n>> test_cmp expect actual\n>> '\n>>\n>> @@ -26,18 +30,23 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext:\n>> Emitting ISO-8859-1 from our UT\n>> test_cmp expect actual\n>> '\n>>\n>> -test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1\n>> from our UTF-8 *.mo files / Runes' '\n>> - LANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" gettext \"TEST: Old English\n>> Runes\">runes&&\n>> -\n>> - if grep \"^TEST: Old English Runes$\" runes\n>> - then\n>> - say \"Your system can not handle this complexity and returns the\n>> string as-is\"\n>> - else\n>> - # Both Solaris and GNU libintl will return this stream of\n>> - # question marks, so it is s probably portable enough\n>> - printf \"TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ??\n>> ????\">runes-expect&&\n>> - test_cmp runes-expect runes\n>> - fi\n>> +test_expect_success GETTEXT_ISO_LOCALE 'gettext: impossible\n>> ISO-8859-1 output' '\n>> + LANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" gettext \"$MSGKEY\">runes&&\n>> + case \"$(cat runes)\" in\n>> + \"$MSGKEY\")\n>> + say \"Your system gives back the key to message catalog\"\n>> + ;;\n>> + \"$PUNTS\")\n>> + say \"Your system replaces an impossible character with ?\"\n>> + ;;\n>> + \"$RUNES\")\n>> + say \"Your system gives back the raw message for an impossible request\"\n>> + ;;\n>> + *)\n>> + say \"We never saw the error behaviour your system exhibits\"\n>> + false\n>> + ;;\n>> + esac\n>> '\n>>\n>> test_expect_success GETTEXT_LOCALE 'gettext: Fetching a UTF-8 msgid ->\n>> UTF-8' '\n> Hi Junio and all,\n> Thanks, the suggestion looks good to me.\n>\n> I want be able to test it, but there is one problem:\n\nHere the results of my investigations:\na) git-sh-i18n is used by the test suite, not git-sh-i18n.sh\n    git-sh-i18n is generated from git-sh-i18n.sh when running make\n\nb) When running\n    make clean && make USE_GETTEXT_SCHEME=gnu && (cd t && make)\n   the log of t0204 looks like this:\n\n# lib-gettext: Found 'is_IS.UTF-8' as an is_IS UTF-8 locale\n# lib-gettext: Found 'is_IS.ISO8859-1' as an is_IS ISO-8859-1 locale\nok 1 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic\nok 2 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes\nok 3 - gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic\nok 4 - gettext: impossible ISO-8859-1 output\nok 5 - gettext: Fetching a UTF-8 msgid -> UTF-8\nok 6 - gettext: Fetching a UTF-8 msgid -> ISO-8859-1\nok 7 - gettext.c: git init UTF-8 -> UTF-8\nok 8 - gettext.c: git init UTF-8 -> ISO-8859-1\n# passed all 8 test(s)\n1..8\n===========\nWhen running\n./t0204-gettext-reencode-sanity.sh --verbose\nwe find the line\n\"Your system gives back the raw message for an impossible request\"\nin the log.\n\n\nSummary: test OK,\n\nMay I say\n\"Thanks for looking into it,\nplease go ahead with your suggested re-roll\" ?\n\n/Torsten\n"},{"id":"186663","messageId":"7vzkbnvt6m.fsf@alter.siamese.dyndns.org","threadId":"29844","inReplyTo":"4F5CC08C.90703@web.de","subject":"Re: Re*: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-11T19:22:41Z","receivedAt":"2012-03-11T19:22:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> Here the results of my investigations:\n> a) git-sh-i18n is used by the test suite, not git-sh-i18n.sh\n>    git-sh-i18n is generated from git-sh-i18n.sh when running make\n\nYeah, that is the correct behaviour.\n\n> b) When running\n>    make clean && make USE_GETTEXT_SCHEME=gnu && (cd t && make)\n>   the log of t0204 looks like this:\n> ...\n> Summary: test OK,\n\nNow, the last remaining issues appear to be these:\n\n * Is USE_GETTEXT_SCHEME=gnu the right thing for Mac OS X?  It may\n   make this test pass, but does it not break other things?  Does\n   Mac OS X come with a working gettext.sh to help i18n of shell\n   scripts?  Does it also give eval_gettext?\n\n * If so, Mac OS X users shouldn't have to say that from the command\n   line of \"make\". Do we need a Makefile update?\n\n * If not, what is the appropriate value for USE_GETTEXT_SCHEME on\n   Mac OS X?  If the answer is not \"fallthrough\", do we need a\n   Makefile update?\n\nThanks.\n"},{"id":"186670","messageId":"4F5D14CD.6080507@web.de","threadId":"29844","inReplyTo":"7vzkbnvt6m.fsf@alter.siamese.dyndns.org","subject":"Re: Re*: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-03-11T21:10:37Z","receivedAt":"2012-03-11T21:10:37Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 03/11/2012 08:22 PM, Junio C Hamano wrote:\n> Torsten Bögershausen<tboegi@web.de>  writes:\n>\n>> Here the results of my investigations:\n>> a) git-sh-i18n is used by the test suite, not git-sh-i18n.sh\n>>     git-sh-i18n is generated from git-sh-i18n.sh when running make\n>\n> Yeah, that is the correct behaviour.\n>\n>> b) When running\n>>     make clean&&  make USE_GETTEXT_SCHEME=gnu&&  (cd t&&  make)\n>>    the log of t0204 looks like this:\n>> ...\n>> Summary: test OK,\n>\n> Now, the last remaining issues appear to be these:\n>\n>   * Is USE_GETTEXT_SCHEME=gnu the right thing for Mac OS X?  It may\n>     make this test pass, but does it not break other things?  Does\n>     Mac OS X come with a working gettext.sh to help i18n of shell\n>     scripts?  Does it also give eval_gettext?\nWhen I remember it right, the following comes from the Fink installation \non my machine:\nwhich gettext\n/sw/bin/gettext\n\nwhich gettext.sh\n/sw/bin/gettext.sh\n\nNone of the machines here (Mac OS X, Ubuntu 10.04.4 LTS, OpenSuse 12.1)\nhas a eval_gettext\n\n>   * If so, Mac OS X users shouldn't have to say that from the command\n>     line of \"make\". Do we need a Makefile update?\nGood question.\nI couldn't find any setup of USE_GETTEXT_SCHEME in Makefile\n(except when NO_GETTEXT is set), do I need to run configure?\nSo far the Makefile worked for all my systems here.\n\n>\n>   * If not, what is the appropriate value for USE_GETTEXT_SCHEME on=\n>     Mac OS X?  If the answer is not \"fallthrough\", do we need a\n>     Makefile update?\nMy guess is that \"gettext_without_eval_gettext\" would be right\n(if we have Fink installed)\n\nBut again, what did I overlook in the Makefile?\nShould there be some hard coded default for e.g. Darwin?\nWith a switch when Fink is installed?\n"},{"id":"186672","messageId":"7vzkbmvmvx.fsf@alter.siamese.dyndns.org","threadId":"29844","inReplyTo":"4F5D14CD.6080507@web.de","subject":"Re: Re*: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-11T21:38:42Z","receivedAt":"2012-03-11T21:38:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> On 03/11/2012 08:22 PM, Junio C Hamano wrote:\n> ...\n>>   * Is USE_GETTEXT_SCHEME=gnu the right thing for Mac OS X?  It may\n>>     make this test pass, but does it not break other things?  Does\n>>     Mac OS X come with a working gettext.sh to help i18n of shell\n>>     scripts?  Does it also give eval_gettext?\n> When I remember it right, the following comes from the Fink\n> installation on my machine:\n> which gettext\n> /sw/bin/gettext\n>\n> which gettext.sh\n> /sw/bin/gettext.sh\n>\n> None of the machines here (Mac OS X, Ubuntu 10.04.4 LTS, OpenSuse 12.1)\n> has a eval_gettext\n\nNo, we do not expect a standalone eval_gettext program.  If you\ndot-source gettext.sh, some systems give you the eval_gettext shell\nfunction, while there are other systems that don't.  Gnu systems\nthat ship with /usr/bin/gettext.sh do give you eval_gettext while\nSolaris is known not to. I do not know what your system does, and\nthat was what the question was about.  What does this say there?\n\n\t$ (. gettext.sh; eval_gettext frotz; echo $?)\n\n>>   * If so, Mac OS X users shouldn't have to say that from the command\n>>     line of \"make\". Do we need a Makefile update?\n> Good question.\n> I couldn't find any setup of USE_GETTEXT_SCHEME in Makefile\n> (except when NO_GETTEXT is set), do I need to run configure?\n> So far the Makefile worked for all my systems here.\n\nYou shouldn't have to muck with autoconf around here. It is one of\nthe design goals of our Makefile to work out of the box on major\nplatforms as long as the prerequisites like POSIX compliant tools\nand use of GNU make are met. An optional configure support comes\ninto the picture only once we know what we want to have in the\nMakefile to be tweaked.\n\nAlso, as you noticed, even though we mention USE_GETTEXT_SCHEME in\nthe Makefile, no platforms with explicit support needs to tweak it;\nif git-sh-i18n.sh can figure out what to do without having to rely\non any tweak in the Makefile, we would prefer to keep it that way.\n\nWhat is curious about your system is that git-sh-i18n.sh should have\nfigured out that you want INTERNAL_GETTEXT_SH_SCHEME to be gnu by\nitself, without any need for \"make USE_GETTEXT_SCHEME=gnu\", with\nthese lines:\n\n                ...\n        elif type gettext.sh >/dev/null 2>&1\n        then\n                # GNU libintl's gettext.sh\n                GIT_INTERNAL_GETTEXT_SH_SCHEME=gnu\n        elif test ...\n\nas long as you have /sw/bin/gettext.sh on your PATH, that is.\n\nSo I am not sure what's broken.\n\n>>   * If not, what is the appropriate value for USE_GETTEXT_SCHEME on=\n>>     Mac OS X?  If the answer is not \"fallthrough\", do we need a\n>>     Makefile update?\n> My guess is that \"gettext_without_eval_gettext\" would be right\n> (if we have Fink installed)\n\nAre you sure that after dot-sourcing /sw/bin/gettext.sh, you do not\nhave eval_gettext?  If you do, then I think it can be set to gnu.\n\nÆvar, I am wondering if the auto-detection part of git-sh-i18n\nshould read more like this to make sure when we declare gnu we know\neval_gettext is available.  What do you think?\n\n git-sh-i18n.sh |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-sh-i18n.sh b/git-sh-i18n.sh\nindex d5fae99..a17688b 100644\n--- a/git-sh-i18n.sh\n+++ b/git-sh-i18n.sh\n@@ -27,7 +27,7 @@ then\n elif test -n \"$GIT_GETTEXT_POISON\"\n then\n \tGIT_INTERNAL_GETTEXT_SH_SCHEME=poison\n-elif type gettext.sh >/dev/null 2>&1\n+elif (. gettext.sh && eval_gettext frotz) >/dev/null 2>&1\n then\n \t# GNU libintl's gettext.sh\n \tGIT_INTERNAL_GETTEXT_SH_SCHEME=gnu\n"},{"id":"186678","messageId":"7vlin6v0aa.fsf@alter.siamese.dyndns.org","threadId":"29844","inReplyTo":"4F5CC08C.90703@web.de","subject":"Re: Re*: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-12T05:46:53Z","receivedAt":"2012-03-12T05:46:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> May I say\n> \"Thanks for looking into it,\n> please go ahead with your suggested re-roll\" ?\n\nAlthough I am not sure if we got everything right for your\nparticular platform, I think the patch I sent out to categorize\nthree-known plausible error behaviours is a much saner approach\nthan the current code, so I am fine with committing it.\n\nI am sort-of waiting for comments from Ævar, though.\n"},{"id":"186780","messageId":"4F5E6362.7050001@web.de","threadId":"29844","inReplyTo":"7vzkbmvmvx.fsf@alter.siamese.dyndns.org","subject":"Re: Re*: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-03-12T20:58:10Z","receivedAt":"2012-03-12T20:58:10Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"[snip]\n (. gettext.sh; eval_gettext frotz; echo $?)\nfrotz0\n\n> What is curious about your system is that git-sh-i18n.sh should have\n> figured out that you want INTERNAL_GETTEXT_SH_SCHEME to be gnu by\n> itself, without any need for \"make USE_GETTEXT_SCHEME=gnu\", with\n> these lines:\n> \n>                 ...\n>         elif type gettext.sh >/dev/null 2>&1\n>         then\n>                 # GNU libintl's gettext.sh\n>                 GIT_INTERNAL_GETTEXT_SH_SCHEME=gnu\n>         elif test ...\n> \n> as long as you have /sw/bin/gettext.sh on your PATH, that is.\n> \n> So I am not sure what's broken.\n=====================\nWhen I run the following scriptlet, \nextracted from git-sh-i18n\n=====================\n#!/bin/sh\nGIT_INTERNAL_GETTEXT_SH_SCHEME=fallthrough\nif test -n \"\"\nthen\n\tGIT_INTERNAL_GETTEXT_SH_SCHEME=\"\"\nelif test -n \"@@USE_FALLTHROUGH_GETTEXT_SCHEME@@$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\"\nthen\n\t\techo \": no probing necessary\"\nelif test -n \"$GIT_GETTEXT_POISON\"\nthen\n\techo GIT_INTERNAL_GETTEXT_SH_SCHEME=poison\nelif type gettext.sh >/dev/null 2>&1\nthen\n\t# GNU libintl's gettext.sh\n\techo GIT_INTERNAL_GETTEXT_SH_SCHEME=gnu\nelif test \"$(gettext -h 2>&1)\" = \"-h\"\nthen\n\t# gettext binary exists but no gettext.sh. likely to be a gettext\n\t# binary on a Solaris or something that is not GNU libintl and\n\t# lack eval_gettext.\n\techo GIT_INTERNAL_GETTEXT_SH_SCHEME=gettext_without_eval_gettext\nfi\n======================\nI get\n: no probing necessary\n=====================\n\nThe generated git-sh-i18n is identical under both Ubuntu and Mac OS X.\n(Except that Mac OS uses /Users instead of /home)\n\nAnd may be the diff between git-sh-i18n.sh and the generated git-sh-i18n can give a hint:\n\n diff git-sh-i18n.sh git-sh-i18n\n13c13\n<       TEXTDOMAINDIR=\"@@LOCALEDIR@@\"\n---\n>       TEXTDOMAINDIR=\"/Users/tb/share/locale\"\n21c21\n< if test -n \"@@USE_GETTEXT_SCHEME@@\"\n---\n> if test -n \"\"\n23c23\n<       GIT_INTERNAL_GETTEXT_SH_SCHEME=\"@@USE_GETTEXT_SCHEME@@\"\n---\n>       GIT_INTERNAL_GETTEXT_SH_SCHEME=\"\"\n"},{"id":"186785","messageId":"7vmx7lpl5a.fsf@alter.siamese.dyndns.org","threadId":"29844","inReplyTo":"4F5E6362.7050001@web.de","subject":"Re: Re*: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-12T21:25:05Z","receivedAt":"2012-03-12T21:25:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> [snip]\n>  (. gettext.sh; eval_gettext frotz; echo $?)\n> frotz0\n\nSo your system can claim \"gnu\".  The patch I sent earlier that\nreplaced \"type gettext.sh\" with something like the above should work\nalong that line.\n\n> I get\n> : no probing necessary\n\n> When I run the following scriptlet, \n> ...\n> elif test -n \"@@USE_FALLTHROUGH_GETTEXT_SCHEME@@$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\"\n> then\n> \t\techo \": no probing necessary\"\n\nGaah.  That should read as @@USE_GETTEXT_SCHEME@@, which would be\nreplaced by the Makefile to become either empty (if you run \"make\"\nwithout forcing USE_GETTEXT_SCHEME to any particular value).\n\nIt comes from ad17ea7 (add a Makefile switch to avoid gettext\ntranslation in shell scripts, 2012-01-23) but nobody replaces the\ntoken anywhere.\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/188706/focus=189016\nand comparing it with the original (focus=188827 in the same thread),\nwe can see that this was my mistake while re-rolling the patch.\n\n-- >8 --\nSubject: i18n: fix auto detection of gettext scheme for shell scripts\n\nA new code added by ad17ea7 (add a Makefile switch to avoid gettext\ntranslation in shell scripts, 2012-01-23) tried to optionally force\na gettext scheme to \"fallthrough\", but ended up forcing it to everybody.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-sh-i18n.sh |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-sh-i18n.sh b/git-sh-i18n.sh\nindex d5fae99..6a27f68 100644\n--- a/git-sh-i18n.sh\n+++ b/git-sh-i18n.sh\n@@ -21,7 +21,7 @@ GIT_INTERNAL_GETTEXT_SH_SCHEME=fallthrough\n if test -n \"@@USE_GETTEXT_SCHEME@@\"\n then\n \tGIT_INTERNAL_GETTEXT_SH_SCHEME=\"@@USE_GETTEXT_SCHEME@@\"\n-elif test -n \"@@USE_FALLTHROUGH_GETTEXT_SCHEME@@$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\"\n+elif test -n \"$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\"\n then\n \t: no probing necessary\n elif test -n \"$GIT_GETTEXT_POISON\"\n"},{"id":"186895","messageId":"4F5F9DD1.50907@web.de","threadId":"29844","inReplyTo":"7vmx7lpl5a.fsf@alter.siamese.dyndns.org","subject":"Re: Re*: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-03-13T19:19:45Z","receivedAt":"2012-03-13T19:19:45Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"> -- >8 --\n> Subject: i18n: fix auto detection of gettext scheme for shell scripts\n>\n> A new code added by ad17ea7 (add a Makefile switch to avoid gettext\n> translation in shell scripts, 2012-01-23) tried to optionally force\n> a gettext scheme to \"fallthrough\", but ended up forcing it to everybody.\n>\n> Signed-off-by: Junio C Hamano<gitster@pobox.com>\n> ---\n>   git-sh-i18n.sh |    2 +-\n>   1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/git-sh-i18n.sh b/git-sh-i18n.sh\n> index d5fae99..6a27f68 100644\n> --- a/git-sh-i18n.sh\n> +++ b/git-sh-i18n.sh\n> @@ -21,7 +21,7 @@ GIT_INTERNAL_GETTEXT_SH_SCHEME=fallthrough\n>   if test -n \"@@USE_GETTEXT_SCHEME@@\"\n>   then\n>   \tGIT_INTERNAL_GETTEXT_SH_SCHEME=\"@@USE_GETTEXT_SCHEME@@\"\n> -elif test -n \"@@USE_FALLTHROUGH_GETTEXT_SCHEME@@$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\"\n> +elif test -n \"$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\"\n>   then\n>   \t: no probing necessary\n>   elif test -n \"$GIT_GETTEXT_POISON\"\n> --\nThanks for the patch. Here are the results of t0204:\na) Suse 12.1\n# lib-gettext: Found 'is_IS.utf8' as an is_IS UTF-8 locale\n# lib-gettext: No is_IS ISO-8859-1 locale available\nok 1 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic\nok 2 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes\nok 3 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / \nIcelandic (missing GETTEXT_ISO_LOCALE)\nok 4 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / \nRunes (missing GETTEXT_ISO_LOCALE)\nok 5 - gettext: Fetching a UTF-8 msgid -> UTF-8\nok 6 # skip gettext: Fetching a UTF-8 msgid -> ISO-8859-1 (missing \nGETTEXT_ISO_LOCALE)\nok 7 - gettext.c: git init UTF-8 -> UTF-8\nok 8 # skip gettext.c: git init UTF-8 -> ISO-8859-1 (missing \nGETTEXT_ISO_LOCALE)\n# passed all 8 test(s)\n1..8\n====================\nb) Ubuntu 10.4:\ntb@maxi:~/projects/git/tb/t$ ./t0204-gettext-reencode-sanity.sh\n# lib-gettext: No is_IS UTF-8 locale available\n# lib-gettext: No is_IS ISO-8859-1 locale available\nok 1 # skip gettext: Emitting UTF-8 from our UTF-8 *.mo files / \nIcelandic (missing GETTEXT_LOCALE)\nok 2 # skip gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes \n(missing GETTEXT_LOCALE)\nok 3 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / \nIcelandic (missing GETTEXT_ISO_LOCALE)\nok 4 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / \nRunes (missing GETTEXT_ISO_LOCALE)\nok 5 # skip gettext: Fetching a UTF-8 msgid -> UTF-8 (missing \nGETTEXT_LOCALE)\nok 6 # skip gettext: Fetching a UTF-8 msgid -> ISO-8859-1 (missing \nGETTEXT_ISO_LOCALE)\nok 7 # skip gettext.c: git init UTF-8 -> UTF-8 (missing GETTEXT_LOCALE)\nok 8 # skip gettext.c: git init UTF-8 -> ISO-8859-1 (missing \nGETTEXT_ISO_LOCALE)\n# passed all 8 test(s)\n1..8\n==============\nc) Mac OS\n# lib-gettext: Found 'is_IS.UTF-8' as an is_IS UTF-8 locale\n# lib-gettext: Found 'is_IS.ISO8859-1' as an is_IS ISO-8859-1 locale\nok 1 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic\nok 2 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes\nok 3 - gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic\nnot ok - 4 gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes\n#\n#           LANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" gettext \"TEST: Old \nEnglish Runes\" >runes &&\n#\n#               if grep \"^TEST: Old English Runes$\" runes\n#               then\n#                       say \"Your system can not handle this complexity \nand returns the string as-is\"\n#               else\n#                       # Both Solaris and GNU libintl will return this \nstream of\n#                       # question marks, so it is s probably portable \nenough\n#                       printf \"TILRAUN: ?? ???? ??? ?? ???? ?? ??? \n????? ??????????? ??? ?? ????\" >runes-expect &&\n#                       test_cmp runes-expect runes\n#               fi\n#\nok 5 - gettext: Fetching a UTF-8 msgid -> UTF-8\nok 6 - gettext: Fetching a UTF-8 msgid -> ISO-8859-1\nok 7 - gettext.c: git init UTF-8 -> UTF-8\nok 8 - gettext.c: git init UTF-8 -> ISO-8859-1\n# failed 1 among 8 test(s)\n1..8\n==============\n(But that was expected, wasn't it? I added your original t0204 patch on \ntop of that, and here we go:\n==============\n# lib-gettext: Found 'is_IS.UTF-8' as an is_IS UTF-8 locale\n# lib-gettext: Found 'is_IS.ISO8859-1' as an is_IS ISO-8859-1 locale\nok 1 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic\nok 2 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes\nok 3 - gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic\nok 4 - gettext: impossible ISO-8859-1 output\nok 5 - gettext: Fetching a UTF-8 msgid -> UTF-8\nok 6 - gettext: Fetching a UTF-8 msgid -> ISO-8859-1\nok 7 - gettext.c: git init UTF-8 -> UTF-8\nok 8 - gettext.c: git init UTF-8 -> ISO-8859-1\n# passed all 8 test(s)\n1..8\n/Torsten\n"},{"id":"186896","messageId":"7vobs0uwif.fsf@alter.siamese.dyndns.org","threadId":"29844","inReplyTo":"4F5F9DD1.50907@web.de","subject":"Re: Re*: [PATCH/RFC] Change t0204-gettext-reencode-sanity.sh to pass under Mac OSX","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-13T19:32:56Z","receivedAt":"2012-03-13T19:32:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n>> -- >8 --\n>> Subject: i18n: fix auto detection of gettext scheme for shell scripts\n>> ...\n> Thanks for the patch. Here are the results of t0204:\n\nSo in short, \"everything looks peachy with the patch\" seems to be the\nconclusion.\n\nThanks.\n"}]}