{"thread":{"id":"31316","subject":"eval_gettextln does not work correctly?","startedAt":"2012-08-22T14:10:39Z","lastAt":"2012-08-22T19:38:29Z","messageCount":4,"participants":["Nguyen Thai Ngoc Duy","Jonathan Nieder","Nguyễn Thái Ngọc Duy","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"197582","messageId":"CACsJy8C4pcAj48sBOATZY21AgE5TdWysY6x-S6Xw8mWfQ9F4CA@mail.gmail.com","threadId":"31316","inReplyTo":null,"subject":"eval_gettextln does not work correctly?","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-08-22T14:10:39Z","receivedAt":"2012-08-22T14:10:39Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"I was running git with preloadable_libintl.so to catch unmarked\nstrings and I saw this\n\ndomain \"git\"\nmsgid \"The copy of the patch that failed is found in:\\n\"\n\"   /home/pclouds/w/git/t/trash\ndirectory.t4254-am-corrupt/.git/rebase-apply/patch\"\nmsgstr \"\"\n\nwhich means git performed a lookup on that string. It is from git-am.sh:\n\neval_gettextln \"The copy of the patch that failed is found in:\n   $dotest/patch\"\n\nI suppose it should look up \"...  $dotest/patch\" instead (i.e. no\nvariable expansion). Something is wrong here? I have a few local\npatches on top of master, but none of them touches gettext shell\nfunctions.\n-- \nDuy\n"},{"id":"197583","messageId":"20120822141726.GA674@mannheim-rule.local","threadId":"31316","inReplyTo":"CACsJy8C4pcAj48sBOATZY21AgE5TdWysY6x-S6Xw8mWfQ9F4CA@mail.gmail.com","subject":"Re: eval_gettextln does not work correctly?","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-08-22T14:17:26Z","receivedAt":"2012-08-22T14:17:26Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Nguyen Thai Ngoc Duy wrote:\n\n> which means git performed a lookup on that string. It is from git-am.sh:\n>\n> eval_gettextln \"The copy of the patch that failed is found in:\n>    $dotest/patch\"\n\nGood catch.  It should use single-quotes.\n"},{"id":"197584","messageId":"1345646883-18746-1-git-send-email-pclouds@gmail.com","threadId":"31316","inReplyTo":"20120822141726.GA674@mannheim-rule.local","subject":"[PATCH] am: quote string for translation before passing to eval_gettextln","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-08-22T14:48:03Z","receivedAt":"2012-08-22T14:48:03Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"If it's not quoted, the string is expanded before it gets looked up in\ngettext database and obviously nothing is returned.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n On Wed, Aug 22, 2012 at 9:17 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n > Nguyen Thai Ngoc Duy wrote:\n >\n >> which means git performed a lookup on that string. It is from git-am.sh:\n >>\n >> eval_gettextln \"The copy of the patch that failed is found in:\n >>    $dotest/patch\"\n >\n > Good catch.  It should use single-quotes.\n\n Yep. Verified. Also checked that no other places have this problem.\n xgettext probably detects this too. Without this patch it does not\n collect this string. With this patch, it does.\n\n git-am.sh | 4 ++--\n 1 tập tin đã bị thay đổi, 2 được thêm vào(+), 2 bị xóa(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex bd9620c..c682d34 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -855,8 +855,8 @@ did you forget to use 'git add'?\"\n \t\teval_gettextln 'Patch failed at $msgnum $FIRSTLINE'\n \t\tif test \"$(git config --bool advice.amworkdir)\" != false\n \t\tthen\n-\t\t\teval_gettextln \"The copy of the patch that failed is found in:\n-   $dotest/patch\"\n+\t\t\teval_gettextln 'The copy of the patch that failed is found in:\n+   $dotest/patch'\n \t\tfi\n \t\tstop_here_user_resolve $this\n \tfi\n-- \n1.7.12.rc2.18.g61b472e\n"},{"id":"197650","messageId":"7vipca7m4q.fsf@alter.siamese.dyndns.org","threadId":"31316","inReplyTo":"1345646883-18746-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH] am: quote string for translation before passing to eval_gettextln","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-08-22T19:38:29Z","receivedAt":"2012-08-22T19:38:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:\n\n> If it's not quoted, the string is expanded before it gets looked up in\n> gettext database and obviously nothing is returned.\n>\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n> ...\n>  Yep. Verified. Also checked that no other places have this problem.\n>  xgettext probably detects this too. Without this patch it does not\n>  collect this string. With this patch, it does.\n\nWill queue; thanks.\n\n>\n>  git-am.sh | 4 ++--\n>  1 tập tin đã bị thay đổi, 2 được thêm vào(+), 2 bị xóa(-)\n>\n> diff --git a/git-am.sh b/git-am.sh\n> index bd9620c..c682d34 100755\n> --- a/git-am.sh\n> +++ b/git-am.sh\n> @@ -855,8 +855,8 @@ did you forget to use 'git add'?\"\n>  \t\teval_gettextln 'Patch failed at $msgnum $FIRSTLINE'\n>  \t\tif test \"$(git config --bool advice.amworkdir)\" != false\n>  \t\tthen\n> -\t\t\teval_gettextln \"The copy of the patch that failed is found in:\n> -   $dotest/patch\"\n> +\t\t\teval_gettextln 'The copy of the patch that failed is found in:\n> +   $dotest/patch'\n>  \t\tfi\n>  \t\tstop_here_user_resolve $this\n>  \tfi\n"}]}