[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Incorrect diff generation using SVN "internal" diff method

From: Stefan Sperling <stsp_at_elego.de>
Date: Fri, 5 Dec 2008 14:28:33 +0000

On Fri, Dec 05, 2008 at 03:35:31PM +0200, Sergey Proskurnya wrote:
> Hi,
>
> I've faced with problem trying to create unified pacth file
> using internal "svn diff". The GNU "patch" utility
> fails to apply that patch with the following message:
> "
> patching file src/server-java/app/nextapp/echo/app/HttpImageReference.java
> patching file
> src/server-java/app/nextapp/echo/app/ResourceImageReference.java
> missing header for unified diff at line 47 of patch
> can't find file to patch at input line 47
> Perhaps you used the wrong -p or --strip option?

> I've attached those two .patch files, see "diff_patches.zip".
> You can see, they are really differ in several places.

Most significantly, the gnu diff uses windows line-endings
and the svn diff uses unix-style line-endings.

svn diff tries to generate the correct eol style automatically,
and can be confused in some cases.

Perhaps your patch program expects windows line-endings?
Try running the svn diff through a newline converter to see if
patch will eat it then.

I would also try playing with options such as --ignore-eol-style
and the svn:eol-style property to see if it's possible to get svn
to produce a usuable diff by default. (I'm not sure if svn diff
heeds the eol-style property, I could not find an answer during
a quick glance into the source.)

Stefan

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=980126

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2008-12-05 16:20:41 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.