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.
--John
---------------------------------------------------------------------
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