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

Re: Return status of `svn diff'

From: Matt Kraai <kraai_at_alumni.cmu.edu>
Date: 2003-05-08 23:51:13 CEST

On Thu, May 08, 2003 at 04:37:02PM -0500, Ben Collins-Sussman wrote:
> "Stefan Monnier" <monnier+gmane.comp.version-control.subversion.devel/news/@rum.cs.yale.edu> writes:
>
> > Is there any particular reason why `svn diff' does not return a 0/1
> > status similar to plain `diff' (i.e. indicating whether or not there
> > was any actual difference) ?
> >
> > If it is just accidental, could it be changed ?
>
> The svn client program returns 1 to indicate an error happened, just
> like most programs do. It would be really strange and inconsistent,
> IMO, to have 'return 1' mean something completely different just
> because you invoked the 'diff' subcommand.

The Single Unix Specification, Version 2 diff manual page states:

 EXIT STATUS

      The following exit values are returned:

      0
        No differences were found.

      1
        Differences were found.

>1
        An error occurred.

From the CVS manual:

    If CVS is successful, it returns a successful status; if there
 is an error, it prints an error message and returns a failure
 status. The one exception to this is the `cvs diff' command. It
 will return a successful status if it found no differences, or a
 failure status if there were differences or if there was an
 error. Because this behavior provides no good way to detect
 errors, in the future it is possible that `cvs diff' will be
 changed to behave like the other CVS commands.

-- 
Matt Kraai <kraai@alumni.cmu.edu>
Debian GNU/Linux Peon
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu May 8 23:52:11 2003

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.