{"thread":{"id":"34231","subject":"[PATCH] t7400: test of UTF-8 submodule names pass under Mac OS","startedAt":"2013-06-20T14:58:48Z","lastAt":"2013-06-20T19:01:05Z","messageCount":2,"participants":["Torsten Bögershausen","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"221490","messageId":"201306201658.50174.tboegi@web.de","threadId":"34231","inReplyTo":null,"subject":"[PATCH] t7400: test of UTF-8 submodule names pass under Mac OS","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-06-20T14:58:48Z","receivedAt":"2013-06-20T14:58:48Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"submodules with names using UTF-8 need core.precomposeunicode true\nunder Mac OS X, set it in the TC.\n\nImprove the portability:\nNot all shells on all OS may understand literal UTF-8 strings.\nUse a help variable filled by printf, as we do it in e.g. t0050.\n\n\"strange names\" can be called UTF-8, rephrase the heading\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\nI wasn't fast enough to catch it on pu:\nfg/submodule-non-ascii-path\n\n t/t7400-submodule-basic.sh | 13 ++++++++-----\n 1 file changed, 8 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh\nindex 0376370..fedfa5b 100755\n--- a/t/t7400-submodule-basic.sh\n+++ b/t/t7400-submodule-basic.sh\n@@ -889,16 +889,19 @@ test_expect_success 'submodule deinit fails when submodule has a .git directory\n \ttest -n \"$(git config --get-regexp \"submodule\\.example\\.\")\"\n '\n \n-test_expect_success 'submodule with strange name works \"å äö\"' '\n-\tmkdir \"å äö\" &&\n+svname=$(printf '\\303\\245 \\303\\244\\303\\266')\n+test_expect_success 'submodule with UTF-8 name' '\n+\tmkdir \"$svname\" &&\n \t(\n-\t\tcd \"å äö\" &&\n+\t\tcd \"$svname\" &&\n \t\tgit init &&\n \t\ttouch sub\n \t\tgit add sub\n \t\tgit commit -m \"init sub\"\n \t)\n-\tgit submodule add \"/å äö\" &&\n-\ttest -n \"$(git submodule | grep \"å äö\")\"\n+\tgit config core.precomposeunicode true &&\n+\tgit submodule add /\"$svname\" &&\n+\tgit submodule >&2 &&\n+\ttest -n \"$(git submodule | grep \"$svname\")\"\n '\n test_done\n-- \n1.8.3\n"},{"id":"221503","messageId":"7vwqpotxn2.fsf@alter.siamese.dyndns.org","threadId":"34231","inReplyTo":"201306201658.50174.tboegi@web.de","subject":"Re: [PATCH] t7400: test of UTF-8 submodule names pass under Mac OS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-20T19:01:05Z","receivedAt":"2013-06-20T19:01: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> submodules with names using UTF-8 need core.precomposeunicode true\n> under Mac OS X, set it in the TC.\n\nI take that TC stands for test case?\n\n> +test_expect_success 'submodule with UTF-8 name' '\n> +\tmkdir \"$svname\" &&\n>  \t(\n> -\t\tcd \"å äö\" &&\n> +\t\tcd \"$svname\" &&\n>  \t\tgit init &&\n>  \t\ttouch sub\n>  \t\tgit add sub\n>  \t\tgit commit -m \"init sub\"\n>  \t)\n\nWhile we are at it, let's fix this broken && chain.\n\n> -\tgit submodule add \"/å äö\" &&\n> -\ttest -n \"$(git submodule | grep \"å äö\")\"\n> +\tgit config core.precomposeunicode true &&\n\nand use test_config here.\n\n> +\tgit submodule add /\"$svname\" &&\n> +\tgit submodule >&2 &&\n> +\ttest -n \"$(git submodule | grep \"$svname\")\"\n>  '\n>  test_done\n\nWill queue with an obvious fix-up.  Thanks for catching.\n\n-- >8 --\nFrom: Torsten Bögershausen <tboegi@web.de>\n\nsubmodules with names using UTF-8 need core.precomposeunicode true\nunder Mac OS X, set it in the test case.\n\nImprove the portability:\n\n  - Not all shells on all OS may understand literal UTF-8 strings.\n  - Use a help variable filled by printf, as we do it in e.g. t0050.\n\n\"strange names\" can be called UTF-8, rephrase the heading.\n\nWhile at it, unbreak &&-chain in the test, and use test_config.\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t7400-submodule-basic.sh | 19 +++++++++++--------\n 1 file changed, 11 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh\nindex d5743ee..7e23421 100755\n--- a/t/t7400-submodule-basic.sh\n+++ b/t/t7400-submodule-basic.sh\n@@ -868,16 +868,19 @@ test_expect_success 'submodule deinit fails when submodule has a .git directory\n \ttest -n \"$(git config --get-regexp \"submodule\\.example\\.\")\"\n '\n \n-test_expect_success 'submodule with strange name works \"å äö\"' '\n-\tmkdir \"å äö\" &&\n+test_expect_success 'submodule with UTF-8 name' '\n+\tsvname=$(printf \"\\303\\245 \\303\\244\\303\\266\") &&\n+\tmkdir \"$svname\" &&\n \t(\n-\t\tcd \"å äö\" &&\n+\t\tcd \"$svname\" &&\n \t\tgit init &&\n-\t\ttouch sub\n-\t\tgit add sub\n+\t\t>sub &&\n+\t\tgit add sub &&\n \t\tgit commit -m \"init sub\"\n-\t)\n-\tgit submodule add \"/å äö\" &&\n-\ttest -n \"$(git submodule | grep \"å äö\")\"\n+\t) &&\n+\ttest_config core.precomposeunicode true &&\n+\tgit submodule add ./\"$svname\" &&\n+\tgit submodule >&2 &&\n+\ttest -n \"$(git submodule | grep \"$svname\")\"\n '\n test_done\n-- \n1.8.3.1-674-g24fae08\n"}]}