From 51c7fbb1a2e6e10282943fb2b4ec168e0842f66d Mon Sep 17 00:00:00 2001 From: ybbxk Date: Mon, 28 Jul 2014 18:14:04 +0800 Subject: [PATCH 1/4] Update commit.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决commit中有中文时的提交出错 --- commit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit.py b/commit.py index 972e97c8..c1b61499 100644 --- a/commit.py +++ b/commit.py @@ -121,7 +121,7 @@ def message_done(self, message): message_file.close() self.message_file = message_file # and actually commit - with open(message_file.name, 'r') as fp: + with open(message_file.name, 'r', encoding='utf-8') as fp: self.run_command(['git', 'commit', '-F', '-', self.extra_options], self.commit_done, working_dir=self.working_dir, stdin=fp.read()) From 6a3a46b8c486a6ba25297039e17b26ae74f57248 Mon Sep 17 00:00:00 2001 From: ybbxk Date: Mon, 28 Jul 2014 18:37:59 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug=EF=BC=8Cphython3?= =?UTF-8?q?=E7=9A=84api=E6=9C=89=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit.py b/commit.py index c1b61499..b318c8a0 100644 --- a/commit.py +++ b/commit.py @@ -121,7 +121,7 @@ def message_done(self, message): message_file.close() self.message_file = message_file # and actually commit - with open(message_file.name, 'r', encoding='utf-8') as fp: + with open(message_file.name, 'r', -1, encoding='utf-8') as fp: self.run_command(['git', 'commit', '-F', '-', self.extra_options], self.commit_done, working_dir=self.working_dir, stdin=fp.read()) From 38af22086af8179080c35b7314e11fc2d522038d Mon Sep 17 00:00:00 2001 From: ybbxk Date: Mon, 28 Jul 2014 18:47:09 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=94=B9=E4=B8=BAgbk=EF=BC=8C=E7=9C=8B?= =?UTF-8?q?=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit.py b/commit.py index b318c8a0..2d8fcfef 100644 --- a/commit.py +++ b/commit.py @@ -121,7 +121,7 @@ def message_done(self, message): message_file.close() self.message_file = message_file # and actually commit - with open(message_file.name, 'r', -1, encoding='utf-8') as fp: + with open(message_file.name, 'r', -1, encoding='gbk') as fp: self.run_command(['git', 'commit', '-F', '-', self.extra_options], self.commit_done, working_dir=self.working_dir, stdin=fp.read()) From 75f1896aa6e2761f0dde2a913ff490afd942d0a9 Mon Sep 17 00:00:00 2001 From: ybbxk Date: Mon, 28 Jul 2014 18:51:56 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=8E=A5=E7=9D=80=E7=94=A8utf8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit.py b/commit.py index 2d8fcfef..b318c8a0 100644 --- a/commit.py +++ b/commit.py @@ -121,7 +121,7 @@ def message_done(self, message): message_file.close() self.message_file = message_file # and actually commit - with open(message_file.name, 'r', -1, encoding='gbk') as fp: + with open(message_file.name, 'r', -1, encoding='utf-8') as fp: self.run_command(['git', 'commit', '-F', '-', self.extra_options], self.commit_done, working_dir=self.working_dir, stdin=fp.read())