From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#23076: 24.5; vc-git: add a new variable for log output coding system Date: Sat, 09 Apr 2016 15:50:04 +0300 Message-ID: <83egafhrpf.fsf@gnu.org> References: <56EFE033.7080900@gmail.com> <56F04527.6010901@gmail.com> <83fuv4s4cr.fsf@gnu.org> <57017E45.7050605@gmail.com> <83pou5o0uh.fsf@gnu.org> <5708F5CA.3080509@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1460206279 12277 80.91.229.3 (9 Apr 2016 12:51:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Apr 2016 12:51:19 +0000 (UTC) Cc: 23076@debbugs.gnu.org To: Nikolay Kudryavtsev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 09 14:51:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aosM9-0007We-7e for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Apr 2016 14:51:17 +0200 Original-Received: from localhost ([::1]:60275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aosM8-0005Nf-O5 for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Apr 2016 08:51:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aosLx-00055K-AI for bug-gnu-emacs@gnu.org; Sat, 09 Apr 2016 08:51:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aosLu-0007vM-33 for bug-gnu-emacs@gnu.org; Sat, 09 Apr 2016 08:51:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aosLt-0007vI-Vk for bug-gnu-emacs@gnu.org; Sat, 09 Apr 2016 08:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1aosLt-0004Kd-OJ for bug-gnu-emacs@gnu.org; Sat, 09 Apr 2016 08:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Apr 2016 12:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23076 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23076-submit@debbugs.gnu.org id=B23076.146020625316633 (code B ref 23076); Sat, 09 Apr 2016 12:51:01 +0000 Original-Received: (at 23076) by debbugs.gnu.org; 9 Apr 2016 12:50:53 +0000 Original-Received: from localhost ([127.0.0.1]:55241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aosLk-0004KD-UX for submit@debbugs.gnu.org; Sat, 09 Apr 2016 08:50:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aosLj-0004K1-3U for 23076@debbugs.gnu.org; Sat, 09 Apr 2016 08:50:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aosLa-0007sp-MY for 23076@debbugs.gnu.org; Sat, 09 Apr 2016 08:50:45 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aosLa-0007sl-Iy; Sat, 09 Apr 2016 08:50:42 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1565 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aosLZ-0004Tt-Tv; Sat, 09 Apr 2016 08:50:42 -0400 In-reply-to: <5708F5CA.3080509@gmail.com> (message from Nikolay Kudryavtsev on Sat, 9 Apr 2016 15:30:02 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:116272 Archived-At: > From: Nikolay Kudryavtsev > Cc: 23076@debbugs.gnu.org > Date: Sat, 9 Apr 2016 15:30:02 +0300 > > My suggestion was based on the idea that introducing a new variable is > guaranteed to not break anyone's setup. > > Solution 1 seems to be more dangerous in this regard. How can it break someone's setup, if using the current system codepage is the _only_ way of invoking programs from Emacs on MS-Windows? If someone has setup that doesn't already follow this, their setup is already broken. > Also #1 seems inferior to #2 for this case - what if you don't have > control over system non-Unicode encoding? Are we talking about MS-Windows here? If so, no control of non-Unicode encoding is needed, we only need to _obey_ that encoding. Emacs always knows what that encoding is, so we just need to use it. Am I missing something? > Let's say someone wants to commit org-mode notes in his native > language, from a workplace, where he has no admin rights for the > machine and no ability to change that windows setting. That's > probably a rare case, but still, seems like something that may > happen. The solutions I proposed don't require changing any system-wide settings. They just _use_ the _existing_ settings to encode non-ASCII characters passed to Git via its command-line arguments. Submitting the commit message via a temporary file doesn't need to use the system codepage, it should use UTF-8, which allows to use almost any character in any language. > I also did some testing of #2 and noted this thing - the current git > behaves somewhat weirdly in regards with git commitencoding and message > files. That is: > 1. Let's say your message.txt is encoded in windows-1251. Trying to > commit it with "git commit -F message.txt" would result in a broken > commit and this: > > Warning: commit message did not conform to UTF-8. > > You may want to amend it after fixing the message, or set the config > > variable i18n.commitencoding to the encoding your project uses. Files submitted via -F should always be in UTF-8. If we adopt #2, Emacs will encode the message in UTF-8 when it writes the file which will then be submitted to Git via -F. > 2. Let's try doing so and set commitencoding to windows-1251 and commit > again. Now we get no warning, but our message is a badly coded mess, > though differently from the previous step, so it did something extra > while encoding the message. > 3. Even when our commitencoding = windows-1251 committing message.txt in > utf-8 works fine. > > So, it seems like we want to always use utf-8 for messages. Yes, and that's what I had in mind for alternative #2. So given these clarifications, which alternative is preferable, in your opinion?