* [PATCH] gitk branch name encoding utf-8 probrem
@ 2019-12-04 18:36 加藤一博
2019-12-04 22:29 ` Jonathan Nieder
0 siblings, 1 reply; 6+ messages in thread
From: 加藤一博 @ 2019-12-04 18:36 UTC (permalink / raw)
To: git@vger.kernel.org
Hello.
Here is a patch to gitk branch name utf-8 probrem.
See issue
https://github.com/kkato233/gitk/issues/1
and fix it
https://github.com/kkato233/gitk/pull/2
---
diff --git a/gitk b/gitk
index abe4805..3f61a5b 100755
--- a/gitk
+++ b/gitk
@@ -1780,11 +1780,15 @@ proc readrefs {} {
global otherrefids idotherrefs mainhead mainheadid
global selecthead selectheadid
global hideremotes
+ global tclencoding
foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
unset -nocomplain $v
}
set refd [open [list | git show-ref -d] r]
+ if {$tclencoding != {}} {
+ fconfigure $refd -encoding $tclencoding
+ }
while {[gets $refd line] >= 0} {
if {[string index $line 40] ne " "} continue
set id [string range $line 0 39]
--
--
kato-k@ksysllc.co.jp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] gitk branch name encoding utf-8 probrem
2019-12-04 18:36 [PATCH] gitk branch name encoding utf-8 probrem 加藤一博
@ 2019-12-04 22:29 ` Jonathan Nieder
2019-12-05 15:02 ` 加藤一博
0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Nieder @ 2019-12-04 22:29 UTC (permalink / raw)
To: 加藤一博; +Cc: git@vger.kernel.org, Paul Mackerras
(cc-ing Paul, gitk expert)
Hi!
加藤一博 wrote:
> Here is a patch to gitk branch name utf-8 probrem.
Thanks for reporting it. Can you provide a short summary here of
the problem that we can use for a self-contained description in the
commit log? See
https://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#describe-changes
for more on this subject.
May we also have your sign-off? See
https://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#sign-off
for what this means.
Thanks and hope that helps,
Jonathan
> See issue
> https://github.com/kkato233/gitk/issues/1
> and fix it
> https://github.com/kkato233/gitk/pull/2
>
>
> ---
>
> diff --git a/gitk b/gitk
> index abe4805..3f61a5b 100755
> --- a/gitk
> +++ b/gitk
> @@ -1780,11 +1780,15 @@ proc readrefs {} {
> global otherrefids idotherrefs mainhead mainheadid
> global selecthead selectheadid
> global hideremotes
> + global tclencoding
>
> foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
> unset -nocomplain $v
> }
> set refd [open [list | git show-ref -d] r]
> + if {$tclencoding != {}} {
> + fconfigure $refd -encoding $tclencoding
> + }
> while {[gets $refd line] >= 0} {
> if {[string index $line 40] ne " "} continue
> set id [string range $line 0 39]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] gitk branch name encoding utf-8 probrem
2019-12-04 22:29 ` Jonathan Nieder
@ 2019-12-05 15:02 ` 加藤一博
2019-12-05 20:28 ` Junio C Hamano
0 siblings, 1 reply; 6+ messages in thread
From: 加藤一博 @ 2019-12-05 15:02 UTC (permalink / raw)
To: git@vger.kernel.org
fix branch name encoding error on gitk.
git checkout -b '漢字'
gitk show branch name broken like this '貍「蟄'
fix this problem.
Signed-off-by: Kazuhiro Kato <kato-k@ksysllc.co.jp>
---
gitk | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gitk b/gitk
index abe4805..3f61a5b 100755
--- a/gitk
+++ b/gitk
@@ -1780,11 +1780,15 @@ proc readrefs {} {
global otherrefids idotherrefs mainhead mainheadid
global selecthead selectheadid
global hideremotes
+ global tclencoding
foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
unset -nocomplain $v
}
set refd [open [list | git show-ref -d] r]
+ if {$tclencoding != {}} {
+ fconfigure $refd -encoding $tclencoding
+ }
while {[gets $refd line] >= 0} {
if {[string index $line 40] ne " "} continue
set id [string range $line 0 39]
--
See this pull request
https://github.com/kkato233/gitk/pull/4
-----Original Message-----
From: Jonathan Nieder <jrnieder@gmail.com>
Sent: Thursday, December 5, 2019 7:29 AM
To: 加藤一博 <kato-k@ksysllc.co.jp>
Cc: git@vger.kernel.org; Paul Mackerras <paulus@ozlabs.org>
Subject: Re: [PATCH] gitk branch name encoding utf-8 probrem
(cc-ing Paul, gitk expert)
Hi!
加藤一博 wrote:
> Here is a patch to gitk branch name utf-8 probrem.
Thanks for reporting it. Can you provide a short summary here of
the problem that we can use for a self-contained description in the
commit log? See
https://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#describe-changes
for more on this subject.
May we also have your sign-off? See
https://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#sign-off
for what this means.
Thanks and hope that helps,
Jonathan
> See issue
> https://github.com/kkato233/gitk/issues/1
> and fix it
> https://github.com/kkato233/gitk/pull/2
>
>
> ---
>
> diff --git a/gitk b/gitk
> index abe4805..3f61a5b 100755
> --- a/gitk
> +++ b/gitk
> @@ -1780,11 +1780,15 @@ proc readrefs {} {
> global otherrefids idotherrefs mainhead mainheadid
> global selecthead selectheadid
> global hideremotes
> + global tclencoding
>
> foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
> unset -nocomplain $v
> }
> set refd [open [list | git show-ref -d] r]
> + if {$tclencoding != {}} {
> + fconfigure $refd -encoding $tclencoding
> + }
> while {[gets $refd line] >= 0} {
> if {[string index $line 40] ne " "} continue
> set id [string range $line 0 39]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] gitk branch name encoding utf-8 probrem
2019-12-05 15:02 ` 加藤一博
@ 2019-12-05 20:28 ` Junio C Hamano
2019-12-05 20:40 ` Pratyush Yadav
2019-12-05 20:50 ` Pratyush Yadav
0 siblings, 2 replies; 6+ messages in thread
From: Junio C Hamano @ 2019-12-05 20:28 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git@vger.kernel.org, 加藤一博
加藤一博 <kato-k@ksysllc.co.jp> writes:
> fix branch name encoding error on gitk.
>
> git checkout -b '漢字'
> gitk show branch name broken like this '貍「蟄'
> fix this problem.
Paul (the gitk maintainer), the patch text itself does look
reasonable.
After "git checkout -b '漢字'" to create a branch with UTF-8
character in it, "gitk" shows the branch name incorrectly, as it
forgets to turns the bytes read from the "git show-ref" command
into Unicode characters.
is how I would phrase the log message.
Thanks.
>
> Signed-off-by: Kazuhiro Kato <kato-k@ksysllc.co.jp>
> ---
> gitk | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/gitk b/gitk
> index abe4805..3f61a5b 100755
> --- a/gitk
> +++ b/gitk
> @@ -1780,11 +1780,15 @@ proc readrefs {} {
> global otherrefids idotherrefs mainhead mainheadid
> global selecthead selectheadid
> global hideremotes
> + global tclencoding
>
> foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
> unset -nocomplain $v
> }
> set refd [open [list | git show-ref -d] r]
> + if {$tclencoding != {}} {
> + fconfigure $refd -encoding $tclencoding
> + }
> while {[gets $refd line] >= 0} {
> if {[string index $line 40] ne " "} continue
> set id [string range $line 0 39]
> --
>
> See this pull request
> https://github.com/kkato233/gitk/pull/4
>
> -----Original Message-----
> From: Jonathan Nieder <jrnieder@gmail.com>
> Sent: Thursday, December 5, 2019 7:29 AM
> To: 加藤一博 <kato-k@ksysllc.co.jp>
> Cc: git@vger.kernel.org; Paul Mackerras <paulus@ozlabs.org>
> Subject: Re: [PATCH] gitk branch name encoding utf-8 probrem
>
> (cc-ing Paul, gitk expert)
> Hi!
>
> 加藤一博 wrote:
>
>> Here is a patch to gitk branch name utf-8 probrem.
>
> Thanks for reporting it. Can you provide a short summary here of
> the problem that we can use for a self-contained description in the
> commit log? See
> https://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#describe-changes
> for more on this subject.
>
> May we also have your sign-off? See
> https://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#sign-off
> for what this means.
>
> Thanks and hope that helps,
> Jonathan
>
>> See issue
>> https://github.com/kkato233/gitk/issues/1
>> and fix it
>> https://github.com/kkato233/gitk/pull/2
>>
>>
>> ---
>>
>> diff --git a/gitk b/gitk
>> index abe4805..3f61a5b 100755
>> --- a/gitk
>> +++ b/gitk
>> @@ -1780,11 +1780,15 @@ proc readrefs {} {
>> global otherrefids idotherrefs mainhead mainheadid
>> global selecthead selectheadid
>> global hideremotes
>> + global tclencoding
>>
>> foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
>> unset -nocomplain $v
>> }
>> set refd [open [list | git show-ref -d] r]
>> + if {$tclencoding != {}} {
>> + fconfigure $refd -encoding $tclencoding
>> + }
>> while {[gets $refd line] >= 0} {
>> if {[string index $line 40] ne " "} continue
>> set id [string range $line 0 39]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gitk branch name encoding utf-8 probrem
2019-12-05 20:28 ` Junio C Hamano
@ 2019-12-05 20:40 ` Pratyush Yadav
2019-12-05 20:50 ` Pratyush Yadav
1 sibling, 0 replies; 6+ messages in thread
From: Pratyush Yadav @ 2019-12-05 20:40 UTC (permalink / raw)
To: Junio C Hamano
Cc: Paul Mackerras, git@vger.kernel.org,
加藤一博
On 05/12/19 12:28PM, Junio C Hamano wrote:
> 加藤一博 <kato-k@ksysllc.co.jp> writes:
>
> > fix branch name encoding error on gitk.
> >
> > git checkout -b '漢字'
> > gitk show branch name broken like this '貍「蟄'
> > fix this problem.
>
> Paul (the gitk maintainer), the patch text itself does look
> reasonable.
>
> After "git checkout -b '漢字'" to create a branch with UTF-8
> character in it, "gitk" shows the branch name incorrectly, as it
> forgets to turns the bytes read from the "git show-ref" command
Minor typo: s/turns/turn/
> into Unicode characters.
>
> is how I would phrase the log message.
>
> Thanks.
--
Regards,
Pratyush Yadav
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gitk branch name encoding utf-8 probrem
2019-12-05 20:28 ` Junio C Hamano
2019-12-05 20:40 ` Pratyush Yadav
@ 2019-12-05 20:50 ` Pratyush Yadav
1 sibling, 0 replies; 6+ messages in thread
From: Pratyush Yadav @ 2019-12-05 20:50 UTC (permalink / raw)
To: 加藤一博
Cc: Paul Mackerras, git@vger.kernel.org, Junio C Hamano
Hi 加藤一博,
On 05/12/19 12:28PM, Junio C Hamano wrote:
> 加藤一博 <kato-k@ksysllc.co.jp> writes:
>
> > fix branch name encoding error on gitk.
> >
> > git checkout -b '漢字'
> > gitk show branch name broken like this '貍「蟄'
> > fix this problem.
>
> Paul (the gitk maintainer), the patch text itself does look
> reasonable.
>
> After "git checkout -b '漢字'" to create a branch with UTF-8
> character in it, "gitk" shows the branch name incorrectly, as it
> forgets to turns the bytes read from the "git show-ref" command
> into Unicode characters.
This commit message would work for the git-gui patch as well (change
"gitk" to "git-gui").
> is how I would phrase the log message.
>
> Thanks.
--
Regards,
Pratyush Yadav
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-12-05 20:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-04 18:36 [PATCH] gitk branch name encoding utf-8 probrem 加藤一博
2019-12-04 22:29 ` Jonathan Nieder
2019-12-05 15:02 ` 加藤一博
2019-12-05 20:28 ` Junio C Hamano
2019-12-05 20:40 ` Pratyush Yadav
2019-12-05 20:50 ` Pratyush Yadav
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).