unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Marcin Borkowski <mbork@mbork.pl>
Cc: rrt@sc3d.org, 18236@debbugs.gnu.org
Subject: bug#18236: diff-apply-hunk interacts poorly with line endings
Date: Wed, 17 Feb 2016 18:39:38 +0200	[thread overview]
Message-ID: <83twl7uw8l.fsf@gnu.org> (raw)
In-Reply-To: <87oabfz6xj.fsf@mbork.pl> (message from Marcin Borkowski on Wed,  17 Feb 2016 16:35:04 +0100)

> From: Marcin Borkowski <mbork@mbork.pl>
> Date: Wed, 17 Feb 2016 16:35:04 +0100
> Cc: 18236@debbugs.gnu.org
> 
> On 2014-08-10, at 17:34, Reuben Thomas <rrt@sc3d.org> wrote:
> 
> > I'm using Emacs 24.3. Consider the following two files:
> >
> > foo:
> > ----cut here----
> > This is a small test file.
> > It has DOS line endings.
> > ----cut here----
> >
> > bar:
> > ----cut here----
> > This is a small test file. 
> > It too has DOS line endings. 
> > ----cut here----
> >
> > Save them with DOS line endings, and
> >
> > diff foo bar > foo.patch
> > cp foo bar
> >
> > Visit foo.patch. When I do that, each line ends in ^M.
> >
> > Now, in the patch buffer, M-x diff-apply-hunk. Note that the ^Ms have been added to the lines. Writing the buffer and examination with "hd" reveals that each line now ends
> > \r\r\n.
> >
> > It seems what's happened here is that diff-mode doesn't try to diagnose the character encoding of the patch file.
> 
> Hi all,
> 
> confirmed on GNU Emacs 25.1.50.2 (commit 4ccd268).

When I try doing that, I get an error message.  Is the recipe
complete?  Also, does this happen on a Posix host or on a Windows box?
If the former, I won't expect each line in the patch file to end with
a ^M, only the lines that came from the files being diffed.

I'm confused.






  reply	other threads:[~2016-02-17 16:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-10 15:34 bug#18236: diff-apply-hunk interacts poorly with line endings Reuben Thomas
2016-02-17 15:35 ` Marcin Borkowski
2016-02-17 16:39   ` Eli Zaretskii [this message]
2016-02-17 19:59     ` Reuben Thomas
2016-02-17 20:14       ` Eli Zaretskii
2016-02-20 12:16         ` Eli Zaretskii
2016-02-20 12:32           ` Reuben Thomas
2016-02-20 12:50             ` Eli Zaretskii
2016-02-21 10:09               ` Marcin Borkowski
2016-02-21 15:56                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83twl7uw8l.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=18236@debbugs.gnu.org \
    --cc=mbork@mbork.pl \
    --cc=rrt@sc3d.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).