(Sorry about the title; I was trying to work within the character limit.)
When invoking git-annex metadata --batch --json --json-error-messages
, if an error occurs in response to some input — say, because the name of a nonexistent file was supplied (or, in my case, because the name of a file downloaded milliseconds ago in a parallel addurl process was supplied) — then git-annex metadata
will output "git-annex: not an annexed file: {filepath}" to standard error and immediately exit. Not only is this in contrast to what it seems --json-error-messages
should do, but the "exiting immediately" bit is in contrast to my understanding of how batch mode is supposed to work. Surely this should be fixed?
For consistency with other --batch, I've made it reply with a blank line when the input is not an annexed file.
Do note that --json-error-messages cannot cram every possible kind of error message into a json object. In particular, errors that occur at startup, and not when acting on a particular file or key, do not fit into the json schema.