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

Re: "svn info" good return code on bad URL

From: John Belmonte <john_at_neggie.net>
Date: 2005-10-12 13:48:45 CEST

Julian Foad wrote:
> Therefore, subject to further views on the matter, I propose we change
> to that system.
> Here are a few further thoughts on doing so.
> If warnings yield 1, should errors yield 2? It is difficult enough
> already for us to decide whether a given circumstance should be treated
> as an error or a warning. We can't reliably and objectively make a
> distinction in many cases, and to produce arbitrary distinctions
> wouldn't help script writers: to know how to handle any failure, they
> need to know exactly what the problem was, not just whether we regarded
> it as "error" or "warning". So errors should also (still) produce exit
> code 1.
> Do we need to hold off for backward compatibility? I don't know.
> Implementation details: this won't be trivial because we'll need to keep
> track of warnings that are, I think, in some cases produced down in the
> libraries. It might not be difficult, though.
> Some commands, such as those whose purpose is to compare or find or test
> something, can have more than one success status, and thus 2 or a higher
> number for the warning/error exit code. E.g. "svn diff" could have 0 if
> no differences found, 1 if differences found, 2 for warnings and/or errors.
> I might try to write a concrete proposal for this. We should state it
> in our user documentation.
> Apologies for the times I said we should return zero if there are only
> warnings. I did think about it at the time, and was sure of it, but I
> am now convinced otherwise. Any other views?

Hi Julian,

1) Please let's not do the "different return codes for warnings and
error" thing. I've had the experience trying to deal with the tool
"tidy" which does this, and it's very hard to work with, at least from
sh or bash. For example, if you want to capture the tool output with
command substitution (e.g. FOO=`svn info $URL`), there is no way (that
I've been able to find) to get the return code.

2) I disagree that an invalid URL "inside" a repository is only a
warning. As I've said, this is arbitrary from the point of view of the
client. If I'm scripting and all I have is the command line client and
a given URL, how do I determine if that URL is valid or not? In the
past I've used "svn ls", but "svn info" should be usable here to. If ls
returns an error for a URL, shouldn't info do the same? They both
return data about a file on directory node.


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 12 13:49:51 2005

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.