{"thread":{"id":"52398","subject":"[PATCH] gitk: fix branch name encoding error on gitk","startedAt":"2019-12-07T00:32:30Z","lastAt":"2019-12-15T05:33:31Z","messageCount":3,"participants":["加藤一博","Junio C Hamano","Paul Mackerras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"387652","messageId":"20191207003203.9612-1-kato-k@ksysllc.co.jp","threadId":"52398","inReplyTo":null,"subject":"[PATCH] gitk: fix branch name encoding error on gitk","fromName":"加藤一博","fromEmail":"kato-k@ksysllc.co.jp","sentAt":"2019-12-07T00:32:25Z","receivedAt":"2019-12-07T00:32:30Z","isPatch":true,"sender":{"key":"kato-k@ksysllc.co.jp","avatar":"https://avatars.githubusercontent.com/u/5441449?v=4"},"body":"From: Kazuhiro Kato <kazuhiro.kato@hotmail.co.jp>\n\nAfter \"git checkout -b '漢字'\" to create a branch with UTF-8\ncharacter in it, \"gitk\" shows the branch name incorrectly, as it\nforgets to turn the bytes read from the \"git show-ref\" command\ninto Unicode characters.\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-- \n2.20.1.windows.1\n\n"},{"id":"387821","messageId":"xmqqlfrlux1k.fsf@gitster-ct.c.googlers.com","threadId":"52398","inReplyTo":"20191207003203.9612-1-kato-k@ksysllc.co.jp","subject":"Re: [PATCH] gitk: fix branch name encoding error on gitk","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-12-09T19:19:19Z","receivedAt":"2019-12-09T19:19:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"[jc: pinging the gitk maintainer]\n\n加藤一博 <kato-k@ksysllc.co.jp> writes:\n\n> From: Kazuhiro Kato <kazuhiro.kato@hotmail.co.jp>\n\nKato-san, do you prefer this address, over ksysllc address?  Either\nway, we prefer to see it match the address used on the signed-off-by\nline below.\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 turn the bytes read from the \"git show-ref\" command\n> into Unicode characters.\n>\n> Signed-off-by: Kazuhiro Kato <kato-k@ksysllc.co.jp>\n> ---\n>  gitk | 4 ++++\n>  1 file changed, 4 insertions(+)\n\nThanks.\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"},{"id":"388222","messageId":"20191215042931.GB12512@blackberry","threadId":"52398","inReplyTo":"20191207003203.9612-1-kato-k@ksysllc.co.jp","subject":"Re: [PATCH] gitk: fix branch name encoding error on gitk","fromName":"Paul Mackerras","fromEmail":"paulus@ozlabs.org","sentAt":"2019-12-15T04:29:31Z","receivedAt":"2019-12-15T05:33:31Z","isPatch":true,"sender":{"key":"paulus@ozlabs.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Sat, Dec 07, 2019 at 12:32:25AM +0000, 加藤一博 wrote:\n> From: Kazuhiro Kato <kazuhiro.kato@hotmail.co.jp>\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 turn the bytes read from the \"git show-ref\" command\n> into Unicode characters.\n> \n> Signed-off-by: Kazuhiro Kato <kato-k@ksysllc.co.jp>\n\nThanks, applied.\n\nPaul.\n"}]}