From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#20892: 25.0.50; Applying vc-diff hunks on CRLF tracked files Date: Wed, 24 Jun 2015 10:52:52 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1435157603 21558 80.91.229.3 (24 Jun 2015 14:53:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Jun 2015 14:53:23 +0000 (UTC) Cc: 20892@debbugs.gnu.org To: joaotavora@gmail.com (=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 24 16:53:12 2015 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 1Z7m34-0004xM-MZ for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Jun 2015 16:53:10 +0200 Original-Received: from localhost ([::1]:51119 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7m34-0004vz-7w for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Jun 2015 10:53:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7m30-0004vu-K0 for bug-gnu-emacs@gnu.org; Wed, 24 Jun 2015 10:53:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7m2x-0004qu-3O for bug-gnu-emacs@gnu.org; Wed, 24 Jun 2015 10:53:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7m2x-0004ql-16 for bug-gnu-emacs@gnu.org; Wed, 24 Jun 2015 10:53:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z7m2w-0001qs-Bm for bug-gnu-emacs@gnu.org; Wed, 24 Jun 2015 10:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Jun 2015 14:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20892 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20892-submit@debbugs.gnu.org id=B20892.14351575817111 (code B ref 20892); Wed, 24 Jun 2015 14:53:02 +0000 Original-Received: (at 20892) by debbugs.gnu.org; 24 Jun 2015 14:53:01 +0000 Original-Received: from localhost ([127.0.0.1]:56562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z7m2u-0001qc-Sw for submit@debbugs.gnu.org; Wed, 24 Jun 2015 10:53:01 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:4750) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z7m2s-0001qP-PV for 20892@debbugs.gnu.org; Wed, 24 Jun 2015 10:52:59 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A1FgA731xV/3+MCkxcgxCEAoVVu0CEfoJNBAICgTw7EgEBAQEBAQGBCkEFg10BAQRWIxALNBIUGA2IY88jAQEBAQEFAgEfizqFBQeELQWLRJNTkhSCFIFFI2GBBSEfgW4igngBAQE X-IPAS-Result: A0A1FgA731xV/3+MCkxcgxCEAoVVu0CEfoJNBAICgTw7EgEBAQEBAQGBCkEFg10BAQRWIxALNBIUGA2IY88jAQEBAQEFAgEfizqFBQeELQWLRJNTkhSCFIFFI2GBBSEfgW4igngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="128173366" Original-Received: from 76-10-140-127.dsl.teksavvy.com (HELO ceviche.home) ([76.10.140.127]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Jun 2015 10:52:53 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 8DBA3660F3; Wed, 24 Jun 2015 10:52:52 -0400 (EDT) In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Wed, 24 Jun 2015 12:29:05 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104301 Archived-At: > - (insert (car new))) > + (insert (decode-coding-string (car new) > + buffer-file-coding-system))) The diff-mode buffer will usually already be decoded (i.e. it contains chars rather than bytes, and for example your name should appear as "Jo=E3o" rather than as "Joo"). So calling decode-coding-string on it unconditionally can't be right. In some cases, the diff-mode buffer will have undecoded bytes (because the auto-detection failed, common when the diff is involves various encodings), in which case decode-coding-string could make sense. In other cases, only the EOL is faulty (typically because the diff tool itself output LF while the files contain CRLF), in which case we should use something else which just strips the CRs. Of course, in yet other cases, the diff itself adds/removes CRs, in which case stripping them would be an error. So, Emacs could/should do something about your use-case, but it has to be careful first to double-check that it's really your use-case and not some other case. Stefan