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

Re: svn diff --diff-cmd=diff fails if there is a modified binary file

From: Peter Cech <cech_at_kooaba.com>
Date: Tue, 13 Oct 2009 14:49:18 +0200

On Oct 12, 2009, at 6:44 PM, Stefan Sperling wrote:

> On Mon, Oct 12, 2009 at 06:21:29PM +0200, Peter Cech wrote:
>> Hello,
>>
>> the diff command (part of coreutils IIRC) returns status 2 if there
>> is
>> a difference in binary files (status 1 means a difference in text
>> files). Subversion apparently only accepts return status 0 and 1.
>> Attempt to retrieve a diff from repository
>>
>> svn diff --diff-cmd=diff -c 3916 svn://localhost/
>>
>> yields an error:
>>
>> svn: 'diff' returned 2
>
> That's not portable. E.g. OpenBSD's diff returns >1 to indicate
> that "an error occured".

Thanks, I did not know that.

> You might want to use a wrapper script around GNU diff which
> interprets
> the exit code and transforms it to either 0 or 1.

Good idea, much better than patching subversion.

>> The attached patch fixes the issue for me. Does it look like right/
>> complete way of fixing this issue?
>
> Looks like you forgot to attach it.

Happens to me frequently :( Anyway, your suggestion with wrapper
script makes it irrelevant.

Thanks!

Peter

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2407079
Received on 2009-10-14 02:55:17 CEST

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