From patchwork Thu Dec 5 15:02:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?5Yqg6Jek5LiA5Y2a?= X-Patchwork-Id: 11274917 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EBDD51593 for ; Thu, 5 Dec 2019 15:03:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3BC324249 for ; Thu, 5 Dec 2019 15:03:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ksysllc.onmicrosoft.com header.i=@ksysllc.onmicrosoft.com header.b="kghFEs3k" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729587AbfLEPDA (ORCPT ); Thu, 5 Dec 2019 10:03:00 -0500 Received: from mail-eopbgr1300041.outbound.protection.outlook.com ([40.107.130.41]:10560 "EHLO APC01-HK2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729099AbfLEPDA (ORCPT ); Thu, 5 Dec 2019 10:03:00 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mf8UZVWQvncnXYnCK3yhP3exRuhNcKQGfgdgOUY3CuF94+l2Xyp8UVlp5wV+z25uYSj6JxSeuV6qg7j/j0wgc9wRyMt8IT+O05SaWEk/6Pvy5HuFYK2zt6rPN8Mm/kLAYjtB1A2c7fuP1sPTahjxkfl2C6dLHFI/MTKqZsCK6vmsMH8JsTgQPRH2VunM61zEIP/Y/bNK9RW5ET8qy2mV+OjfGwf3BNMG+UCbCz4KWAMRfduU5eq3dPzfmAHpQFDIWx3+lBzf2p1GNodXUiLY23MYXhzhShomW41Ia/ElTkAv0JtE5QM/WzGfjQYDeR8e1oq+6j9t5iZqdqC8uuVK4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wDd6stELXWOzSsY4alAQH+pUpYv9YJhwzEYBwMmT9VE=; b=AMqUuh5aeu0gVDICaNaW4AbDja9fdPwiDf/cZOrUK0+Mb/MNxjWLG5c55zGWIX7vs2JtCVnpOk9bH83M03AHzhJ2wDupKgP8zKjzps1khWGkBErMeX7GQKyDzu4add89mCHJIL2Sw0j/mi0z1PNX6Is44ATG6zmyyPkjoxDP9ll3sP/3s4feTKlnyUnnspjxXNqScR/0wEqSjBk4O0HgnwUlaCKds8oL8IJviYxQ2QptPC9S4p+XUfU1B2Tl69LrzocRUoHasPL3AN89IHPW+7Iu3/+9z5SCpBp+M72GDz4mfOoz+CyXkqni22+VCoodQKtMXEmnCCxZ9C0Or6b7Xg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ksysllc.co.jp; dmarc=pass action=none header.from=ksysllc.co.jp; dkim=pass header.d=ksysllc.co.jp; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ksysllc.onmicrosoft.com; s=selector2-ksysllc-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wDd6stELXWOzSsY4alAQH+pUpYv9YJhwzEYBwMmT9VE=; b=kghFEs3kmnUnBtWGTHQINvMD1ehoE5X8NppjHyLxYxR8GUklt7Cvq9SXXw6gBmg2M7dsUHmklBOzh+MgrXtV0Cf+Ncxsr24OCwJ9GpzBVqi9eDPEux6j78QMSAlrfmHdpT8QL/ieCntc7QvA661L1sn7qa1Ev1ji/hiViCq2+n0= Received: from TY2PR01MB2427.jpnprd01.prod.outlook.com (20.177.100.73) by TY2PR01MB4890.jpnprd01.prod.outlook.com (20.179.171.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.18; Thu, 5 Dec 2019 15:02:15 +0000 Received: from TY2PR01MB2427.jpnprd01.prod.outlook.com ([fe80::b074:84bd:8776:a29f]) by TY2PR01MB2427.jpnprd01.prod.outlook.com ([fe80::b074:84bd:8776:a29f%7]) with mapi id 15.20.2516.014; Thu, 5 Dec 2019 15:02:15 +0000 From: =?utf-8?b?5Yqg6Jek5LiA5Y2a?= To: "git@vger.kernel.org" Subject: [PATCH] gitk branch name encoding utf-8 probrem Thread-Topic: [PATCH] gitk branch name encoding utf-8 probrem Thread-Index: AdWq0cuhgH7WTTbHQwq0du7Qsjt4IQAIHpWAACI8mhA= Date: Thu, 5 Dec 2019 15:02:15 +0000 Message-ID: References: <20191204222921.GB195537@google.com> In-Reply-To: <20191204222921.GB195537@google.com> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=kato-k@ksysllc.co.jp; x-originating-ip: [123.223.66.231] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0aa1a0ab-8b39-4163-169d-08d779941d81 x-ms-traffictypediagnostic: TY2PR01MB4890: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:421; x-forefront-prvs: 02426D11FE x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(39830400003)(346002)(366004)(136003)(396003)(13464003)(189003)(199004)(71190400001)(186003)(508600001)(71200400001)(7696005)(8936002)(966005)(14454004)(76116006)(66556008)(33656002)(26005)(5660300002)(53546011)(6506007)(64756008)(66946007)(14444005)(66446008)(99286004)(52536014)(9686003)(102836004)(66476007)(81156014)(74316002)(85182001)(76176011)(11346002)(1730700003)(55016002)(5640700003)(2906002)(305945005)(81166006)(86362001)(8676002)(6916009)(25786009)(316002);DIR:OUT;SFP:1101;SCL:1;SRVR:TY2PR01MB4890;H:TY2PR01MB2427.jpnprd01.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: ksysllc.co.jp does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ZMFBmahMVOmVXNK2qhuc4dMflem1BeWALfbKNg/RHMwEi6UO3sq4wb/gqk2ZSe332yHBP5CNodsqrf/10FfIjZE+OhAM7fCUOX5gh6pA6rW7JTVHxG6DODi4wkes8EMO3dgGWUK1mO8O/m78vcBHENWsjjhb3JoIna58Z+gknQ7O3HabDGbqYVy8/vuibj/xQ9nVfZk/4jro/629RpkXt+uxE3A+hVm58BeN1vuI+Ld7T0WDrB01j0KtRty9edci8RMXNmut/JEOi3qTSr99ELNRKXOtgSNxSu3bwCgicqxEQUf4Q75YhoM5xeXq+OaEmVH8D5NvwppLLU8ZDd6Y1Wxu+4t6TLnDvSWE6wmBCmEtyB4YBxILkoCMprCdD9fo3HXk04KiMAfg9qkrX0yEMWl0F2/+BV0Zgf0ujxg7dvNQudzgowfnd9cEZmWng6cHyLQ3web2aiajKuPNklrijloSsWYwQKHjaDXoJuU7dn2sMoICqm3+idcblU/eKAFyfTNhFgoCiYBiHi9HQlmCQxmL/jS4hlFWs0sbvDY+Uqs= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: ksysllc.co.jp X-MS-Exchange-CrossTenant-Network-Message-Id: 0aa1a0ab-8b39-4163-169d-08d779941d81 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2019 15:02:15.2305 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: e2e801e1-1bfd-4c29-8e88-a6b5a79038d8 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bJu2XA/1mv5k7oezyWSBBwlFujs5ADXfWNHCxswxD6DkfPTnb5Jue/Zs3/XXzgKz0tVB1ErtZPTu7zmK5wInSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR01MB4890 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: 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 --- gitk | 4 ++++ 1 file changed, 4 insertions(+) -- See this pull request https://github.com/kkato233/gitk/pull/4 -----Original Message----- From: Jonathan Nieder Sent: Thursday, December 5, 2019 7:29 AM To: 加藤一博 Cc: git@vger.kernel.org; Paul Mackerras 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] 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]