"archive not found" error from checkpresent
joeyh opened this issue · comments
checkpresent prints "archive not found" to stderr if a key is not found. This clutters up the git-annex display, in both the hook special remote, and the native glacier git-annex remote that I am currently writing. Could that instead be sent to stdout, or not printed at all?
Hi Joey,
I wasn't quite clear on what checkpresent
needed to do in an error condition. In particular, I wasn't happy for a command line tool to exit with a zero status without printing anything in the case that the file wasn't found, as I felt that this would be misleading to command line users.
I would have preferred the interface to use the same thing as grep -q
or something - 0 on found, 1 on not found, >1 on error, and EX_TEMPFAIL
(75) on retry-able error.
So I went with a guideline in my head from this (I think it comes from the GNU guidelines), that says that command line tools should by default do what is sensible for interactive command line users, and I felt that this would be to at least print a warning if I couldn't exit 1. And I sent the warning to stderr to avoid disrupting the operation itself of anything automatic that might be parsing the output.
I hope that explains my rationale. I'm not particularly happy with the result though, and I'd prefer that we rethink what a sensible API should be that can be both automatically used and also fit command line conventions.
For the scripted case, there's already a --quiet
case that will shut that up (and this is non-default so that the interactive default is what I think is more sensible for interactive users). So I think you can use --quiet
and it should work as you need.
I'd appreciate hearing your thoughts on this though. Does this work for you?
basak wrote:
For the scripted case, there's already a --quiet case that will shut that up
(and this is non-default so that the interactive default is what I think is
more sensible for interactive users). So I think you can use --quiet and it
should work as you need.I'd appreciate hearing your thoughts on this though. Does this work for you?
Ah, yes, that'll be ok. I do generally agree with you WRT return code
etc.
see shy jo