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

Re: BAD! 'svn diff' exits with 0 when some difference exists.

From: Peter Samuelson <peter_at_p12n.org>
Date: 2006-08-19 18:24:46 CEST

[Ben Collins-Sussman]
> I think this is intentional; when the 'svn' binary returns 0, it
> means "no error happened", and non-zero means "an error happened".
> It's certainly not an error to print out a difference! I might argue
> that 'cvs diff' is being a bit strange when it does this.

This has come up before (issue #2513), and it's been noted that the
Unix utility 'diff' also returns 1 for differences found, 2 for error.
So it's not CVS being weird, it's Unix diff being weird and CVS playing
along.

I think it'd be better for svn diff to agree with diff and cvs diff,
but I don't know whether that would break your 1.x compatibility
contract.

> >If 'svn diff' always return 0, it will be programmatically hard to
> >know when difference occurs and stop the make system.

> How about just looking at stdout? If anything is printed to stdout,
> there's a difference. Doesn't that make more sense anyway?

Alternatively, 'svn status' is intended to be machine-parseable.

Received on Sat Aug 19 18:25:18 2006

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

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