git-annex/doc
Joey Hess 80f1354685
metadata --batch: Avoid crashing when a non-annexed file is input
Turns out that CommandStart actions do not have their exceptions caught,
which is why the giveup was causing a crash. Mostly these actions
do not do very much work on their own, but it does seem possible there
are other commands whose CommandStart also throws an exception.

So, my first attempt at a fix was to catch those exceptions. But,
--json-error-messages then causes a difficulty, because in order to output
a json error message, an action needs to have been started; that sets up
the json object that the error message will be included in a field of.

While it would be possible to output an object with just an error field,
this would be json output of a format that the user has no reason to
expect, that happens only in an exceptional circumstance. That is something
I have always wanted to avoid with the json output; while git-annex man
pages don't document what the json looks like, the output has always
been made to be self-describing. Eg, it includes "error-messages":[]
even when there's no errors.

With that ruled out, it doesn't seem a good idea to catch CommandStart
exceptions and display the error to stderr when --json-error-messages
is set. And so I don't know if it makes sense to catch exceptions from that
at all. Maybe I'd have a different opinion if --json-error-messages did not
exist though.

So instead, output a blank line like other batch commands do.
This also leaves open the possibility of implementing support for matching
object with metadata --json, which would also want to output a blank line
when the input didn't match.

Sponsored-by: Dartmouth College's DANDI project
2021-11-01 13:40:43 -04:00
..
android
Android
assistant
automatic_conflict_resolution
backends
bare_repositories
bugs metadata --batch: Avoid crashing when a non-annexed file is input 2021-11-01 13:40:43 -04:00
chunking
coding_style
contribute
copies
design document how to resume downloads 2021-10-11 12:40:16 -04:00
devblog devblog 2021-08-03 17:14:06 -04:00
direct_mode
download
encryption
footer
forum comment 2021-10-27 14:18:19 -04:00
future_proofing
git-annex-add
git-annex-addurl
git-annex-adjust
git-annex-checkpresentkey
git-annex-config
git-annex-copy
git-annex-direct
git-annex-drop
git-annex-enableremote
git-annex-find
git-annex-import
git-annex-importfeed
git-annex-lookupkey
git-annex-metadata
git-annex-move
git-annex-p2p
git-annex-preferred-content
git-annex-reinject
git-annex-rmurl
git-annex-setpresentkey
git-annex-sync
git-annex-test
git-annex-unannex
git-annex-undo
git-annex-uninit
git-annex-unlock
git-annex-unused
git-annex-whereis
how_it_works Added a comment 2021-08-18 21:07:12 +00:00
install remove xmpp mention 2021-10-19 12:26:22 -04:00
internals
license
links
metadata
news add news item for git-annex 8.20211028 2021-10-28 12:01:31 -04:00
not
polls
preferred_content
profiling
projects
required_content
scalability
security
special_remotes When retrival from a chunked remote fails, display the error that occurred when downloading the chunk 2021-10-14 12:45:05 -04:00
stickers
submodules
sync
templates
testimonials
thanks update 2021-10-05 10:43:27 -04:00
tips 2021-10-22 22:13:46 +00:00
todo avoid redundant freezeContent call 2021-10-27 14:18:10 -04:00
trust
tuning
upgrades
use_case
users
videos
walkthrough comment 2021-09-21 13:23:57 -04:00
workflow
Android.mdwn
assistant.mdwn
automatic_conflict_resolution.mdwn
backends.mdwn
bare_repositories.mdwn
bugs.mdwn
builds.mdwn
chunking.mdwn
coding_style.mdwn
comments.mdwn
contact.mdwn
contribute.mdwn
copies.mdwn
design.mdwn
devblog.mdwn
direct_mode.mdwn
distributed_version_control.mdwn
download.mdwn
encryption.mdwn
favicon.ico
forum.mdwn
future_proofing.mdwn
git-annex-add.mdwn
git-annex-addunused.mdwn
git-annex-addurl.mdwn
git-annex-adjust.mdwn
git-annex-assistant.mdwn
git-annex-benchmark.mdwn
git-annex-calckey.mdwn
git-annex-checkpresentkey.mdwn
git-annex-common-options.mdwn
git-annex-config.mdwn
git-annex-contentlocation.mdwn
git-annex-copy.mdwn --batch-keys 2021-08-25 14:21:12 -04:00
git-annex-dead.mdwn
git-annex-describe.mdwn
git-annex-diffdriver.mdwn
git-annex-direct.mdwn
git-annex-drop.mdwn --batch-keys 2021-08-25 14:21:12 -04:00
git-annex-dropkey.mdwn
git-annex-dropunused.mdwn
git-annex-edit.mdwn
git-annex-enable-tor.mdwn
git-annex-enableremote.mdwn
git-annex-examinekey.mdwn
git-annex-expire.mdwn
git-annex-export.mdwn
git-annex-filter-branch.mdwn
git-annex-find.mdwn --batch-keys 2021-08-25 14:21:12 -04:00
git-annex-findref.mdwn
git-annex-fix.mdwn
git-annex-forget.mdwn
git-annex-fromkey.mdwn
git-annex-fsck.mdwn --batch-keys 2021-08-25 14:21:12 -04:00
git-annex-fuzztest.mdwn
git-annex-get.mdwn --batch-keys 2021-08-25 14:21:12 -04:00
git-annex-group.mdwn
git-annex-groupwanted.mdwn
git-annex-import.mdwn sync, merge: Added --allow-unrelated-histories option 2021-07-19 12:14:26 -04:00
git-annex-importfeed.mdwn
git-annex-indirect.mdwn
git-annex-info.mdwn
git-annex-init.mdwn
git-annex-initremote.mdwn
git-annex-inprogress.mdwn note about encryption/chunking 2021-10-18 11:11:24 -04:00
git-annex-list.mdwn
git-annex-lock.mdwn
git-annex-log.mdwn --batch-keys 2021-08-25 14:21:12 -04:00
git-annex-lookupkey.mdwn
git-annex-map.mdwn
git-annex-matchexpression.mdwn
git-annex-matching-expression.mdwn
git-annex-matching-options.mdwn --batch-keys 2021-08-25 14:21:12 -04:00
git-annex-merge.mdwn sync, merge: Added --allow-unrelated-histories option 2021-07-19 12:14:26 -04:00
git-annex-metadata.mdwn metadata --batch: Avoid crashing when a non-annexed file is input 2021-11-01 13:40:43 -04:00
git-annex-migrate.mdwn
git-annex-mincopies.mdwn
git-annex-mirror.mdwn --batch-keys 2021-08-25 14:21:12 -04:00
git-annex-move.mdwn --batch-keys 2021-08-25 14:21:12 -04:00
git-annex-multicast.mdwn
git-annex-numcopies.mdwn
git-annex-p2p.mdwn
git-annex-post-receive.mdwn
git-annex-pre-commit.mdwn
git-annex-preferred-content.mdwn
git-annex-proxy.mdwn
git-annex-readpresentkey.mdwn
git-annex-registerurl.mdwn
git-annex-reinit.mdwn
git-annex-reinject.mdwn
git-annex-rekey.mdwn
git-annex-remotedaemon.mdwn
git-annex-renameremote.mdwn
git-annex-repair.mdwn
git-annex-required.mdwn
git-annex-resolvemerge.mdwn
git-annex-rmurl.mdwn
git-annex-schedule.mdwn
git-annex-semitrust.mdwn
git-annex-setkey.mdwn
git-annex-setpresentkey.mdwn
git-annex-shell.mdwn remove git-annex-shell compat code 2021-10-11 15:36:51 -04:00
git-annex-smudge.mdwn
git-annex-status.mdwn
git-annex-sync.mdwn sync, merge: Added --allow-unrelated-histories option 2021-07-19 12:14:26 -04:00
git-annex-test.mdwn
git-annex-testremote.mdwn
git-annex-transferkey.mdwn
git-annex-transferkeys.mdwn
git-annex-transferrer.mdwn
git-annex-trust.mdwn
git-annex-unannex.mdwn
git-annex-undo.mdwn
git-annex-ungroup.mdwn
git-annex-uninit.mdwn
git-annex-unlock.mdwn
git-annex-unregisterurl.mdwn
git-annex-untrust.mdwn
git-annex-unused.mdwn improve docs for refspec format 2021-09-21 13:19:57 -04:00
git-annex-upgrade.mdwn
git-annex-vadd.mdwn
git-annex-vcycle.mdwn
git-annex-version.mdwn
git-annex-vfilter.mdwn
git-annex-vicfg.mdwn
git-annex-view.mdwn
git-annex-vpop.mdwn split out common options to its own page and mention it on each subcommand page 2021-05-10 15:00:13 -04:00
git-annex-wanted.mdwn
git-annex-watch.mdwn
git-annex-webapp.mdwn
git-annex-whereis.mdwn --batch-keys 2021-08-25 14:21:12 -04:00
git-annex-whereused.mdwn
git-annex.mdwn improved bwrate limiting implementation 2021-09-22 15:27:16 -04:00
git-remote-tor-annex.mdwn
git-union-merge.mdwn
how_it_works.mdwn
index.mdwn
install.mdwn
internals.mdwn
license.mdwn
location_tracking.mdwn
logo-old-bw.svg
logo-old.png
logo-old.svg
logo-old_small.png
logo.mdwn
logo.svg
logo_16x16.png
logo_32x32.png
logo_small.png
meta.mdwn
metadata.mdwn
news.mdwn
not.mdwn
polls.mdwn
preferred_content.mdwn
privacy.mdwn
profiling.mdwn
projects.mdwn
publicrepos.mdwn
related_software.mdwn
repomap.png
required_content.mdwn
scalability.mdwn
security.mdwn
shortcuts.mdwn
sidebar.mdwn
sitemap.mdwn
special_remotes.mdwn
stickers.mdwn
submodules.mdwn
summary.mdwn
sync.mdwn
testimonials.mdwn
thanks.mdwn
tips.mdwn
todo.mdwn
transferring_data.mdwn
trust.mdwn
tuning.mdwn
upgrades.mdwn
users.mdwn
videos.mdwn
walkthrough.mdwn
workflow.mdwn