fix: Support --json and --json-error-messages
And triaged out some commands that don't need to support these options. Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
This commit is contained in:
parent
46c7c30140
commit
f20c8b087e
5 changed files with 39 additions and 16 deletions
|
@ -37,7 +37,7 @@ git-annex (10.20230408) UNRELEASED; urgency=medium
|
||||||
of core.sharedRepository and umask.
|
of core.sharedRepository and umask.
|
||||||
* initremote: Avoid creating a remote that is not encrypted when gpg is
|
* initremote: Avoid creating a remote that is not encrypted when gpg is
|
||||||
broken.
|
broken.
|
||||||
* log, rmurl, unannex: Support --json and --json-error-messages.
|
* fix, log, rmurl, unannex: Support --json and --json-error-messages.
|
||||||
* log: When --raw-date is used, display only seconds from the epoch, as
|
* log: When --raw-date is used, display only seconds from the epoch, as
|
||||||
documented, omitting a trailing "s" that was included in the output
|
documented, omitting a trailing "s" that was included in the output
|
||||||
before.
|
before.
|
||||||
|
|
|
@ -26,7 +26,7 @@ import Utility.Touch
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = noCommit $ withAnnexOptions [annexedMatchingOptions] $
|
cmd = noCommit $ withAnnexOptions [annexedMatchingOptions, jsonOptions] $
|
||||||
command "fix" SectionMaintenance
|
command "fix" SectionMaintenance
|
||||||
"fix up links to annexed content"
|
"fix up links to annexed content"
|
||||||
paramPaths (withParams seek)
|
paramPaths (withParams seek)
|
||||||
|
|
|
@ -24,6 +24,16 @@ configured by annex.thin.
|
||||||
The [[git-annex-matching-options]](1)
|
The [[git-annex-matching-options]](1)
|
||||||
can be used to specify files to fix.
|
can be used to specify files to fix.
|
||||||
|
|
||||||
|
* `--json`
|
||||||
|
|
||||||
|
Enable JSON output. This is intended to be parsed by programs that use
|
||||||
|
git-annex. Each line of output is a JSON object.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Messages that would normally be output to standard error are included in
|
||||||
|
the JSON instead.
|
||||||
|
|
||||||
* Also the [[git-annex-common-options]](1) can be used.
|
* Also the [[git-annex-common-options]](1) can be used.
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
|
@ -40,6 +40,16 @@ key. The `--historical` option makes it also find past versions of files.
|
||||||
It stops after finding one use of the key, and outputs a git rev that
|
It stops after finding one use of the key, and outputs a git rev that
|
||||||
refers to where it was used, eg "HEAD@{40}:somefile"
|
refers to where it was used, eg "HEAD@{40}:somefile"
|
||||||
|
|
||||||
|
* `--json`
|
||||||
|
|
||||||
|
Enable JSON output. This is intended to be parsed by programs that use
|
||||||
|
git-annex. Each line of output is a JSON object.
|
||||||
|
|
||||||
|
* `--json-error-messages`
|
||||||
|
|
||||||
|
Messages that would normally be output to standard error are included in
|
||||||
|
the JSON instead.
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
[[git-annex]](1)
|
[[git-annex]](1)
|
||||||
|
|
|
@ -8,14 +8,15 @@ These commands have been updated to support --json:
|
||||||
* git-annex-unannex
|
* git-annex-unannex
|
||||||
* git-annex-rmurl
|
* git-annex-rmurl
|
||||||
* git-annex-log
|
* git-annex-log
|
||||||
|
* git-annex-fix
|
||||||
|
|
||||||
Provisional list of commands that don't support --json and maybe should:
|
Provisional list of commands that don't support --json and maybe should:
|
||||||
|
|
||||||
(Feel free to reorder things to the top)
|
(Feel free to reorder things to the top)
|
||||||
|
|
||||||
|
* git-annex-whereused
|
||||||
* git-annex-addunused
|
* git-annex-addunused
|
||||||
* git-annex-adjust
|
* git-annex-adjust
|
||||||
* git-annex-assistant
|
|
||||||
* git-annex-backends
|
* git-annex-backends
|
||||||
* git-annex-benchmark
|
* git-annex-benchmark
|
||||||
* git-annex-calckey
|
* git-annex-calckey
|
||||||
|
@ -27,7 +28,6 @@ Provisional list of commands that don't support --json and maybe should:
|
||||||
* git-annex-dead
|
* git-annex-dead
|
||||||
* git-annex-describe
|
* git-annex-describe
|
||||||
* git-annex-diffdriver
|
* git-annex-diffdriver
|
||||||
* git-annex-direct
|
|
||||||
* git-annex-dropunused
|
* git-annex-dropunused
|
||||||
* git-annex-edit
|
* git-annex-edit
|
||||||
* git-annex-enable-tor
|
* git-annex-enable-tor
|
||||||
|
@ -35,33 +35,25 @@ Provisional list of commands that don't support --json and maybe should:
|
||||||
* git-annex-expire
|
* git-annex-expire
|
||||||
* git-annex-filter-branch
|
* git-annex-filter-branch
|
||||||
* git-annex-filter-process
|
* git-annex-filter-process
|
||||||
* git-annex-findref
|
|
||||||
* git-annex-fix
|
|
||||||
* git-annex-forget
|
* git-annex-forget
|
||||||
* git-annex-fuzztest
|
* git-annex-fuzztest
|
||||||
* git-annex-group
|
* git-annex-group
|
||||||
* git-annex-groupwanted
|
* git-annex-groupwanted
|
||||||
* git-annex-importfeed
|
* git-annex-importfeed
|
||||||
* git-annex-indirect
|
|
||||||
* git-annex-init
|
* git-annex-init
|
||||||
* git-annex-initremote
|
* git-annex-initremote
|
||||||
* git-annex-inprogress
|
* git-annex-inprogress
|
||||||
* git-annex-list
|
|
||||||
* git-annex-lookupkey
|
* git-annex-lookupkey
|
||||||
* git-annex-map
|
* git-annex-map
|
||||||
* git-annex-matchexpression
|
* git-annex-matchexpression
|
||||||
* git-annex-matching-expression
|
* git-annex-matching-expression
|
||||||
* git-annex-matching-options
|
|
||||||
* git-annex-merge
|
* git-annex-merge
|
||||||
* git-annex-migrate
|
* git-annex-migrate
|
||||||
* git-annex-mincopies
|
* git-annex-mincopies
|
||||||
* git-annex-multicast
|
* git-annex-multicast
|
||||||
* git-annex-numcopies
|
* git-annex-numcopies
|
||||||
* git-annex-p2p
|
* git-annex-p2p
|
||||||
* git-annex-post-receive
|
|
||||||
* git-annex-pre-commit
|
|
||||||
* git-annex-preferred-content
|
* git-annex-preferred-content
|
||||||
* git-annex-proxy
|
|
||||||
* git-annex-readpresentkey
|
* git-annex-readpresentkey
|
||||||
* git-annex-reinit
|
* git-annex-reinit
|
||||||
* git-annex-reinject
|
* git-annex-reinject
|
||||||
|
@ -76,8 +68,6 @@ Provisional list of commands that don't support --json and maybe should:
|
||||||
* git-annex-semitrust
|
* git-annex-semitrust
|
||||||
* git-annex-setkey
|
* git-annex-setkey
|
||||||
* git-annex-setpresentkey
|
* git-annex-setpresentkey
|
||||||
* git-annex-shell
|
|
||||||
* git-annex-smudge
|
|
||||||
* git-annex-sync
|
* git-annex-sync
|
||||||
* git-annex-test
|
* git-annex-test
|
||||||
* git-annex-testremote
|
* git-annex-testremote
|
||||||
|
@ -100,5 +90,18 @@ Provisional list of commands that don't support --json and maybe should:
|
||||||
* git-annex-vpop
|
* git-annex-vpop
|
||||||
* git-annex-wanted
|
* git-annex-wanted
|
||||||
* git-annex-watch
|
* git-annex-watch
|
||||||
* git-annex-webapp
|
|
||||||
* git-annex-whereused
|
These commands have been reviewed and should not support json:
|
||||||
|
|
||||||
|
* git-annex-list (because it's a compact display of whereis so no new information)
|
||||||
|
* git-annex-direct (deprecated noop)
|
||||||
|
* git-annex findref (same as find)
|
||||||
|
* git-annex indirect (deprecated noop)
|
||||||
|
* git-annex proxy (deprecated and displays git command output so nothing
|
||||||
|
structured)
|
||||||
|
* git-annex-pre-commit (used internally)
|
||||||
|
* git-annex-post-receive (used internally)
|
||||||
|
* git-annex-smudge (used internally)
|
||||||
|
* git-annex-shell (run by git)
|
||||||
|
* git-annex-assistant (too high level)
|
||||||
|
* git-annex-webapp (too high level)
|
||||||
|
|
Loading…
Add table
Reference in a new issue