[darcs-users] return code for 'add' and stderr (was: Re: Escaping of hunks and file names)

Mark Stosberg mark at summersault.com
Mon Nov 8 03:36:28 UTC 2004


On 2004-11-07, Ralph Corderoy <ralph at inputplus.co.uk> wrote:
>> The problem here is that often one will run
>> 
>> darcs add *
>> 
>> trusting darcs to add only the relevant files.
>
> Only if one's a <Steve Wright>muppet</Steve Wright>.  Sorry, but that's
> a poor UI.  One that allows errors to go unreported.  Adding a file
> already added is an error.  Adding a file that doesn't exist is an
> error.  Both should appear on stderr and result in $? being non-zero.
> IMHO  ;-)  Humans appreciate it.  Other programs appreciate it.

I confirmed these complaints:

- 'add' appears to send it's errors to STDOUT, not STDERR
- 'add' appears to return true, even when there's an error:

$ ../darcs/darcs add missing  && echo 'true';

####

Ralph, would you be interested in helping to improve this?
You could add or update a test in the 'tests/' directory of the 
distribution to illustrate these two points. The tests are written
in shell or Perl

	Mark

-- 
http://mark.stosberg.com/ 





More information about the darcs-users mailing list