{"thread":{"id":"52386","subject":"[PATCH] gitk branch name encoding utf-8 probrem","startedAt":"2019-12-04T18:37:03Z","lastAt":"2019-12-05T20:51:01Z","messageCount":6,"participants":["加藤一博","Jonathan Nieder","Junio C Hamano","Pratyush Yadav"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"387501","messageId":"TY2PR01MB24271C32E2FD9FD8C27CA8C2CA5D0@TY2PR01MB2427.jpnprd01.prod.outlook.com","threadId":"52386","inReplyTo":null,"subject":"[PATCH] gitk branch name encoding utf-8 probrem","fromName":"加藤一博","fromEmail":"kato-k@ksysllc.co.jp","sentAt":"2019-12-04T18:36:57Z","receivedAt":"2019-12-04T18:37:03Z","isPatch":true,"sender":{"key":"kato-k@ksysllc.co.jp","avatar":"https://avatars.githubusercontent.com/u/5441449?v=4"},"body":"Hello.\n\nHere is a patch to gitk branch name utf-8 probrem.\n\nSee issue\nhttps://github.com/kkato233/gitk/issues/1\nand fix it \nhttps://github.com/kkato233/gitk/pull/2\n\n\n---\n\ndiff --git a/gitk b/gitk\nindex abe4805..3f61a5b 100755\n--- a/gitk\n+++ b/gitk\n@@ -1780,11 +1780,15 @@ proc readrefs {} {\n     global otherrefids idotherrefs mainhead mainheadid\n     global selecthead selectheadid\n     global hideremotes\n+    global tclencoding\n\n     foreach v {tagids idtags headids idheads otherrefids idotherrefs} {\n        unset -nocomplain $v\n     }\n     set refd [open [list | git show-ref -d] r]\n+    if {$tclencoding != {}} {\n+       fconfigure $refd -encoding $tclencoding\n+    }\n     while {[gets $refd line] >= 0} {\n        if {[string index $line 40] ne \" \"} continue\n        set id [string range $line 0 39]\n--\n\n--\nkato-k@ksysllc.co.jp\n\n"},{"id":"387530","messageId":"20191204222921.GB195537@google.com","threadId":"52386","inReplyTo":"TY2PR01MB24271C32E2FD9FD8C27CA8C2CA5D0@TY2PR01MB2427.jpnprd01.prod.outlook.com","subject":"Re: [PATCH] gitk branch name encoding utf-8 probrem","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2019-12-04T22:29:21Z","receivedAt":"2019-12-04T22:29:26Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(cc-ing Paul, gitk expert)\nHi!\n\n加藤一博 wrote:\n\n> Here is a patch to gitk branch name utf-8 probrem.\n\nThanks for reporting it.  Can you provide a short summary here of\nthe problem that we can use for a self-contained description in the\ncommit log?  See\nhttps://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#describe-changes\nfor more on this subject.\n\nMay we also have your sign-off?  See\nhttps://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#sign-off\nfor what this means.\n\nThanks and hope that helps,\nJonathan\n\n> See issue\n> https://github.com/kkato233/gitk/issues/1\n> and fix it \n> https://github.com/kkato233/gitk/pull/2\n> \n> \n> ---\n> \n> diff --git a/gitk b/gitk\n> index abe4805..3f61a5b 100755\n> --- a/gitk\n> +++ b/gitk\n> @@ -1780,11 +1780,15 @@ proc readrefs {} {\n>      global otherrefids idotherrefs mainhead mainheadid\n>      global selecthead selectheadid\n>      global hideremotes\n> +    global tclencoding\n> \n>      foreach v {tagids idtags headids idheads otherrefids idotherrefs} {\n>         unset -nocomplain $v\n>      }\n>      set refd [open [list | git show-ref -d] r]\n> +    if {$tclencoding != {}} {\n> +       fconfigure $refd -encoding $tclencoding\n> +    }\n>      while {[gets $refd line] >= 0} {\n>         if {[string index $line 40] ne \" \"} continue\n>         set id [string range $line 0 39]\n"},{"id":"387559","messageId":"TY2PR01MB2427631CC07116A662AF3D38CA5C0@TY2PR01MB2427.jpnprd01.prod.outlook.com","threadId":"52386","inReplyTo":"20191204222921.GB195537@google.com","subject":"[PATCH] gitk branch name encoding utf-8 probrem","fromName":"加藤一博","fromEmail":"kato-k@ksysllc.co.jp","sentAt":"2019-12-05T15:02:15Z","receivedAt":"2019-12-05T15:03:02Z","isPatch":true,"sender":{"key":"kato-k@ksysllc.co.jp","avatar":"https://avatars.githubusercontent.com/u/5441449?v=4"},"body":"\nfix branch name encoding error on gitk.\n\ngit checkout -b '漢字'\ngitk show branch name broken like this '貍｢蟄'\nfix this problem.\n\nSigned-off-by: Kazuhiro Kato <kato-k@ksysllc.co.jp>\n---\n gitk | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/gitk b/gitk\nindex abe4805..3f61a5b 100755\n--- a/gitk\n+++ b/gitk\n@@ -1780,11 +1780,15 @@ proc readrefs {} {\n     global otherrefids idotherrefs mainhead mainheadid\n     global selecthead selectheadid\n     global hideremotes\n+    global tclencoding\n \n     foreach v {tagids idtags headids idheads otherrefids idotherrefs} {\n \tunset -nocomplain $v\n     }\n     set refd [open [list | git show-ref -d] r]\n+    if {$tclencoding != {}} {\n+\tfconfigure $refd -encoding $tclencoding\n+    }\n     while {[gets $refd line] >= 0} {\n \tif {[string index $line 40] ne \" \"} continue\n \tset id [string range $line 0 39]\n--\n\nSee this pull request\nhttps://github.com/kkato233/gitk/pull/4\n\n-----Original Message-----\nFrom: Jonathan Nieder <jrnieder@gmail.com> \nSent: Thursday, December 5, 2019 7:29 AM\nTo: 加藤一博 <kato-k@ksysllc.co.jp>\nCc: git@vger.kernel.org; Paul Mackerras <paulus@ozlabs.org>\nSubject: Re: [PATCH] gitk branch name encoding utf-8 probrem\n\n(cc-ing Paul, gitk expert)\nHi!\n\n加藤一博 wrote:\n\n> Here is a patch to gitk branch name utf-8 probrem.\n\nThanks for reporting it.  Can you provide a short summary here of\nthe problem that we can use for a self-contained description in the\ncommit log?  See\nhttps://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#describe-changes\nfor more on this subject.\n\nMay we also have your sign-off?  See\nhttps://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#sign-off\nfor what this means.\n\nThanks and hope that helps,\nJonathan\n\n> See issue\n> https://github.com/kkato233/gitk/issues/1\n> and fix it \n> https://github.com/kkato233/gitk/pull/2\n> \n> \n> ---\n> \n> diff --git a/gitk b/gitk\n> index abe4805..3f61a5b 100755\n> --- a/gitk\n> +++ b/gitk\n> @@ -1780,11 +1780,15 @@ proc readrefs {} {\n>      global otherrefids idotherrefs mainhead mainheadid\n>      global selecthead selectheadid\n>      global hideremotes\n> +    global tclencoding\n> \n>      foreach v {tagids idtags headids idheads otherrefids idotherrefs} {\n>         unset -nocomplain $v\n>      }\n>      set refd [open [list | git show-ref -d] r]\n> +    if {$tclencoding != {}} {\n> +       fconfigure $refd -encoding $tclencoding\n> +    }\n>      while {[gets $refd line] >= 0} {\n>         if {[string index $line 40] ne \" \"} continue\n>         set id [string range $line 0 39]\n"},{"id":"387580","messageId":"xmqqimmuzfe1.fsf@gitster-ct.c.googlers.com","threadId":"52386","inReplyTo":"TY2PR01MB2427631CC07116A662AF3D38CA5C0@TY2PR01MB2427.jpnprd01.prod.outlook.com","subject":"Re: [PATCH] gitk branch name encoding utf-8 probrem","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-12-05T20:28:06Z","receivedAt":"2019-12-05T20:28:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"加藤一博 <kato-k@ksysllc.co.jp> writes:\n\n> fix branch name encoding error on gitk.\n>\n> git checkout -b '漢字'\n> gitk show branch name broken like this '貍｢蟄'\n> fix this problem.\n\nPaul (the gitk maintainer), the patch text itself does look\nreasonable.\n\n    After \"git checkout -b '漢字'\" to create a branch with UTF-8\n    character in it, \"gitk\" shows the branch name incorrectly, as it\n    forgets to turns the bytes read from the \"git show-ref\" command\n    into Unicode characters.\n\nis how I would phrase the log message.\n\nThanks.\n\n>\n> Signed-off-by: Kazuhiro Kato <kato-k@ksysllc.co.jp>\n> ---\n>  gitk | 4 ++++\n>  1 file changed, 4 insertions(+)\n>\n> diff --git a/gitk b/gitk\n> index abe4805..3f61a5b 100755\n> --- a/gitk\n> +++ b/gitk\n> @@ -1780,11 +1780,15 @@ proc readrefs {} {\n>      global otherrefids idotherrefs mainhead mainheadid\n>      global selecthead selectheadid\n>      global hideremotes\n> +    global tclencoding\n>  \n>      foreach v {tagids idtags headids idheads otherrefids idotherrefs} {\n>  \tunset -nocomplain $v\n>      }\n>      set refd [open [list | git show-ref -d] r]\n> +    if {$tclencoding != {}} {\n> +\tfconfigure $refd -encoding $tclencoding\n> +    }\n>      while {[gets $refd line] >= 0} {\n>  \tif {[string index $line 40] ne \" \"} continue\n>  \tset id [string range $line 0 39]\n> --\n>\n> See this pull request\n> https://github.com/kkato233/gitk/pull/4\n>\n> -----Original Message-----\n> From: Jonathan Nieder <jrnieder@gmail.com> \n> Sent: Thursday, December 5, 2019 7:29 AM\n> To: 加藤一博 <kato-k@ksysllc.co.jp>\n> Cc: git@vger.kernel.org; Paul Mackerras <paulus@ozlabs.org>\n> Subject: Re: [PATCH] gitk branch name encoding utf-8 probrem\n>\n> (cc-ing Paul, gitk expert)\n> Hi!\n>\n> 加藤一博 wrote:\n>\n>> Here is a patch to gitk branch name utf-8 probrem.\n>\n> Thanks for reporting it.  Can you provide a short summary here of\n> the problem that we can use for a self-contained description in the\n> commit log?  See\n> https://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#describe-changes\n> for more on this subject.\n>\n> May we also have your sign-off?  See\n> https://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#sign-off\n> for what this means.\n>\n> Thanks and hope that helps,\n> Jonathan\n>\n>> See issue\n>> https://github.com/kkato233/gitk/issues/1\n>> and fix it \n>> https://github.com/kkato233/gitk/pull/2\n>> \n>> \n>> ---\n>> \n>> diff --git a/gitk b/gitk\n>> index abe4805..3f61a5b 100755\n>> --- a/gitk\n>> +++ b/gitk\n>> @@ -1780,11 +1780,15 @@ proc readrefs {} {\n>>      global otherrefids idotherrefs mainhead mainheadid\n>>      global selecthead selectheadid\n>>      global hideremotes\n>> +    global tclencoding\n>> \n>>      foreach v {tagids idtags headids idheads otherrefids idotherrefs} {\n>>         unset -nocomplain $v\n>>      }\n>>      set refd [open [list | git show-ref -d] r]\n>> +    if {$tclencoding != {}} {\n>> +       fconfigure $refd -encoding $tclencoding\n>> +    }\n>>      while {[gets $refd line] >= 0} {\n>>         if {[string index $line 40] ne \" \"} continue\n>>         set id [string range $line 0 39]\n"},{"id":"387581","messageId":"20191205204046.waceacp5b3t5djrc@yadavpratyush.com","threadId":"52386","inReplyTo":"xmqqimmuzfe1.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] gitk branch name encoding utf-8 probrem","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-12-05T20:40:46Z","receivedAt":"2019-12-05T20:40:56Z","isPatch":true,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"On 05/12/19 12:28PM, Junio C Hamano wrote:\n> 加藤一博 <kato-k@ksysllc.co.jp> writes:\n> \n> > fix branch name encoding error on gitk.\n> >\n> > git checkout -b '漢字'\n> > gitk show branch name broken like this '貍｢蟄'\n> > fix this problem.\n> \n> Paul (the gitk maintainer), the patch text itself does look\n> reasonable.\n> \n>     After \"git checkout -b '漢字'\" to create a branch with UTF-8\n>     character in it, \"gitk\" shows the branch name incorrectly, as it\n>     forgets to turns the bytes read from the \"git show-ref\" command\n\nMinor typo: s/turns/turn/\n\n>     into Unicode characters.\n> \n> is how I would phrase the log message.\n> \n> Thanks.\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"387583","messageId":"20191205205052.aaw4q57y2hlzghgd@yadavpratyush.com","threadId":"52386","inReplyTo":"xmqqimmuzfe1.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] gitk branch name encoding utf-8 probrem","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-12-05T20:50:52Z","receivedAt":"2019-12-05T20:51:01Z","isPatch":true,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"Hi 加藤一博,\n\nOn 05/12/19 12:28PM, Junio C Hamano wrote:\n> 加藤一博 <kato-k@ksysllc.co.jp> writes:\n> \n> > fix branch name encoding error on gitk.\n> >\n> > git checkout -b '漢字'\n> > gitk show branch name broken like this '貍｢蟄'\n> > fix this problem.\n> \n> Paul (the gitk maintainer), the patch text itself does look\n> reasonable.\n> \n>     After \"git checkout -b '漢字'\" to create a branch with UTF-8\n>     character in it, \"gitk\" shows the branch name incorrectly, as it\n>     forgets to turns the bytes read from the \"git show-ref\" command\n>     into Unicode characters.\n\nThis commit message would work for the git-gui patch as well (change \n\"gitk\" to \"git-gui\").\n \n> is how I would phrase the log message.\n> \n> Thanks.\n\n-- \nRegards,\nPratyush Yadav\n"}]}