unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Markus Triska <markus.triska@gmx.at>
Cc: emacs-pretest-bug@gnu.org
Subject: Re: 23.0.60; diff-apply-hunk new line at end of file
Date: Thu, 24 Apr 2008 21:37:46 -0400	[thread overview]
Message-ID: <jwvbq3yu384.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <20080424232339.93F8382CEF3@mt-computer.local> (Markus Triska's message of "Fri, 25 Apr 2008 01:23:39 +0200 (CEST)")

> diff --git a/t.txt b/t.txt
> index f27f040..27bd94f 100644
> --- a/t.txt
> +++ b/t.txt
> @@ -1 +1,2 @@
>  first line.
> +

> (available from: http://www.logic.at/prolog/t.patch )

> and, in the same directory, t.txt with the following content:

> first line.

> (available from: http://www.logic.at/prolog/t.txt )

> and do C-c C-a on the first and only hunk of t.patch, the patch is
> applied. When I then do C-c C-a, another new line is unexpectedly
> inserted at the end of t.txt. Arbitrarily many, if repeated.

Why would that be a bug?  The patch doesn't say that it is at the end of
the file, so all it says is "add an empty line after the line `first
line'".  You may argue that the lack of context is an indication that
it's meant to be at the end-of-file, but that lack of context may be due
to something else.

Furthermore, the same kind of problem can happen even with 3-lines of
context, such that after applying the patch, the new file's content
still contains the pattern required for the patch be applied.


        Stefan




      parent reply	other threads:[~2008-04-25  1:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-24 23:23 23.0.60; diff-apply-hunk new line at end of file Markus Triska
2008-04-24 23:42 ` Miles Bader
2008-04-25  0:22   ` Markus Triska
2008-04-25  0:38     ` Markus Triska
2008-04-25  1:37 ` Stefan Monnier [this message]

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=jwvbq3yu384.fsf-monnier+emacsbugreports@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=markus.triska@gmx.at \
    /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).