{"thread":{"id":"42917","subject":"[PATCH] t5510: become resilient to GETTEXT_POISON","startedAt":"2016-07-25T09:33:53Z","lastAt":"2016-07-26T20:13:27Z","messageCount":6,"participants":["Vasco Almeida","Junio C Hamano","Duy Nguyen","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"292088","messageId":"1469439068-2724-1-git-send-email-vascomalmeida@sapo.pt","threadId":"42917","inReplyTo":null,"subject":"[PATCH] t5510: become resilient to GETTEXT_POISON","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-07-25T09:31:08Z","receivedAt":"2016-07-25T09:33:53Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Replace gettext poison text with appropriate values to be able to cut\nthe right output of git fetch command for comparison.\n\nThe first gettext poison falls from the previous line into the next\nbecause the poison does not add a newline, so we must replace it with\nnothing.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n t/t5510-fetch.sh | 10 ++++++++--\n 1 file changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex 6bd4853..b261223 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -694,7 +694,10 @@ test_expect_success 'fetch aligned output' '\n \t(\n \t\tcd full-output &&\n \t\tgit -c fetch.output=full fetch origin 2>&1 | \\\n-\t\t\tgrep -e \"->\" | cut -c 22- >../actual\n+\t\t\tgrep -e \"->\" | \\\n+\t\t\tsed -e \"/master/ s/# GETTEXT POISON #//\" \\\n+\t\t\t    -e \"/tag/ s/# GETTEXT POISON #/[new tag]        /\" | \\\n+\t\t\tcut -c 22- >../actual\n \t) &&\n \tcat >expect <<-\\EOF &&\n \tmaster               -> origin/master\n@@ -709,7 +712,10 @@ test_expect_success 'fetch compact output' '\n \t(\n \t\tcd compact &&\n \t\tgit -c fetch.output=compact fetch origin 2>&1 | \\\n-\t\t\tgrep -e \"->\" | cut -c 22- >../actual\n+\t\t\tgrep -e \"->\" | \\\n+\t\t\tsed -e \"/master/ s/# GETTEXT POISON #//\" \\\n+\t\t\t    -e \"/extraa/ s/# GETTEXT POISON #/[new tag]        /\" | \\\n+\t\t\tcut -c 22- >../actual\n \t) &&\n \tcat >expect <<-\\EOF &&\n \tmaster     -> origin/*\n-- \n2.7.4\n\n"},{"id":"292095","messageId":"CAPc5daVV8EkMXWeTiZN9bEXXAejmbDbT9L7SNCc4jNtXYVomLQ@mail.gmail.com","threadId":"42917","inReplyTo":"1469439068-2724-1-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH] t5510: become resilient to GETTEXT_POISON","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-07-25T15:16:34Z","receivedAt":"2016-07-25T15:16:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"On Mon, Jul 25, 2016 at 2:31 AM, Vasco Almeida <vascomalmeida@sapo.pt> wrote:\n> Replace gettext poison text with appropriate values to be able to cut\n> the right output of git fetch command for comparison.\n\nHmm, as these tests are _all_ about human-readable output, it probably is\nsufficient to skip them using prerequiste, I would think. We do not want each\nindividual test to have too intimate knowledge on how POISON strings look\nlike.\n"},{"id":"292099","messageId":"CACsJy8BLTdsUqN-jUXUmX+9npja9H5rO8svM18YptrxtJ7W64w@mail.gmail.com","threadId":"42917","inReplyTo":"CAPc5daVV8EkMXWeTiZN9bEXXAejmbDbT9L7SNCc4jNtXYVomLQ@mail.gmail.com","subject":"Re: [PATCH] t5510: become resilient to GETTEXT_POISON","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-07-25T16:07:59Z","receivedAt":"2016-07-25T16:08:34Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Jul 25, 2016 at 5:16 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> On Mon, Jul 25, 2016 at 2:31 AM, Vasco Almeida <vascomalmeida@sapo.pt> wrote:\n>> Replace gettext poison text with appropriate values to be able to cut\n>> the right output of git fetch command for comparison.\n>\n> Hmm, as these tests are _all_ about human-readable output, it probably is\n> sufficient to skip them using prerequiste, I would think. We do not want each\n> individual test to have too intimate knowledge on how POISON strings look\n> like.\n\nYeah these tests are about alignment,  they are probably useless\nanyway after the text is poisoned (and has the same length).\n-- \nDuy\n"},{"id":"292200","messageId":"1469537934-16676-1-git-send-email-vascomalmeida@sapo.pt","threadId":"42917","inReplyTo":"1469439068-2724-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH] t5510: skip tests under GETTEXT_POISON build","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-07-26T12:58:54Z","receivedAt":"2016-07-26T12:59:29Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Skip tests when running under GETTEXT_POISON build and run them with\nC_LOCALE_OUTPUT prerequisite.\n\nThese tests are irrelevant under GETTEXT_POISON because they test text\noutput alignment which GETTEXT_POISON turns useless.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n t/t5510-fetch.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex 6bd4853..668c54b 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -688,7 +688,7 @@ test_expect_success 'fetching with auto-gc does not lock up' '\n \t)\n '\n \n-test_expect_success 'fetch aligned output' '\n+test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '\n \tgit clone . full-output &&\n \ttest_commit looooooooooooong-tag &&\n \t(\n@@ -703,7 +703,7 @@ test_expect_success 'fetch aligned output' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success 'fetch compact output' '\n+test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '\n \tgit clone . compact &&\n \ttest_commit extraaa &&\n \t(\n-- \n2.7.4\n\n"},{"id":"292235","messageId":"xmqq4m7c2ve8.fsf@gitster.mtv.corp.google.com","threadId":"42917","inReplyTo":"1469537934-16676-1-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH] t5510: skip tests under GETTEXT_POISON build","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-07-26T16:53:35Z","receivedAt":"2016-07-26T16:55:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Vasco Almeida <vascomalmeida@sapo.pt> writes:\n\n> Skip tests when running under GETTEXT_POISON build and run them with\n> C_LOCALE_OUTPUT prerequisite.\n>\n> These tests are irrelevant under GETTEXT_POISON because they test text\n> output alignment which GETTEXT_POISON turns useless.\n>\n> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n> ---\n>  t/t5510-fetch.sh | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\n> index 6bd4853..668c54b 100755\n> --- a/t/t5510-fetch.sh\n> +++ b/t/t5510-fetch.sh\n> @@ -688,7 +688,7 @@ test_expect_success 'fetching with auto-gc does not lock up' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'fetch aligned output' '\n> +test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '\n>  \tgit clone . full-output &&\n>  \ttest_commit looooooooooooong-tag &&\n>  \t(\n> @@ -703,7 +703,7 @@ test_expect_success 'fetch aligned output' '\n>  \ttest_cmp expect actual\n>  '\n>  \n> -test_expect_success 'fetch compact output' '\n> +test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '\n>  \tgit clone . compact &&\n>  \ttest_commit extraaa &&\n>  \t(\n\nMakes sense, will queue.\n\nThis is a tangent, but it may make sense for us to start thinking\nabout retiring one of the two prerequisites, GETTEXT_POISON and\nC_LOCALE_OUTPUT.  Back when 5e9637c6 (i18n: add infrastructure for\ntranslating Git with gettext, 2011-11-18) introduced the former,\ntest_have_prereq did not support a negated prerequisite, so the\ncommit added GETTEXT_POISON prerequisite; if we had the modern\ntest_have_prereq, we would have written\n\n    test_expect_success GETTEXT_POISON '...'\n\nthat appear in t0205 as\n\n    test_expect_success !C_LOCALE_OUTPUT '...'\n\nI would think.\n"},{"id":"292256","messageId":"CACBZZX4r5jax62oVYFsWONkyREshipGC8AFu8yfr6B7y9bMQDQ@mail.gmail.com","threadId":"42917","inReplyTo":"xmqq4m7c2ve8.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] t5510: skip tests under GETTEXT_POISON build","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2016-07-26T20:11:25Z","receivedAt":"2016-07-26T20:13:27Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Jul 26, 2016 at 6:53 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> [...] Back when 5e9637c6 (i18n: add infrastructure for\n> translating Git with gettext, 2011-11-18) introduced the former,\n> test_have_prereq did not support a negated prerequisite, so the\n> commit added GETTEXT_POISON prerequisite; if we had the modern\n> test_have_prereq, we would have written\n>\n>     test_expect_success GETTEXT_POISON '...'\n>\n> that appear in t0205 as\n>\n>     test_expect_success !C_LOCALE_OUTPUT '...'\n>\n> I would think.\n\nMaybe the names of the test prerequisites should be merged. I can't\nthink of a rea\n\nAs for the GETTEXT_POISON facility in general, I haven't worked much\nif at all on the i18n toolchain since I initially wrote the gettext\nsupport so I think at this point it's for others to say whether stuff\nlike this is useful.\n\nBut for what it's worth the v1.7.4.1-65-gbb946bb commit explains\nbetter what it's for:\n\n    This is a debugging aid for people who are working on the i18n part of\n    the system, to make sure that they are not marking plumbing messages\n    that should never be translated with _().\n\nI.e. so the person gettext-izing something can actively spot issues\nwith marking strings for translations right away.\n"}]}