+git-annex (8.20211029) UNRELEASED; urgency=medium
+
+ * metadata --batch: Avoid crashing when a non-annexed file is input,
+ instead output a blank line like other batch commands do.
+
+ -- Joey Hess <id@joeyh.name> Mon, 01 Nov 2021 13:19:46 -0400
+
git-annex (8.20211028) upstream; urgency=medium
* Removed support for accessing git remotes that use versions of
JSONOutput _ -> ifM limited
( giveup "combining --batch with file matching options is not currently supported"
, batchInput fmt parseJSONInput
- (commandAction . startBatch)
+ (commandAction . batchCommandStart . startBatch)
)
_ -> giveup "--batch is currently only supported in --json mode"
mk <- lookupKey f
case mk of
Just k -> go k (mkActionItem (k, AssociatedFile (Just f)))
- Nothing -> giveup $ "not an annexed file: " ++ fromRawFilePath f
+ Nothing -> return Nothing
Right k -> go k (mkActionItem k)
where
go k ai = starting "metadata" ai si $ do
[[!meta author=jwodder]]
[[!tag projects/dandi]]
+
+> [[fixed|done]] --[[Joey]]
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2021-11-01T16:27:48Z"
+ content="""
+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.
+"""]]
enable `--json` along with `--batch`.
In batch mode, git-annex reads lines from stdin, which contain
- JSON objects. It replies to each input with an output JSON object.
+ JSON objects. It replies to each input annexed file
+ with an output JSON object. (But if the file is not an annexed file,
+ an empty line will be output.)
The format of the JSON sent to git-annex can be the same as the JSON that
it outputs. Or, a simplified version. Only the "file" (or "key") field
{"file":"foo","fields":{"author":[]}}
- Note that matching options do not affect the files that are
- processed when in batch mode.
-
* Also the [[git-annex-common-options]](1) can be used.
# EXAMPLES