diff --git a/CHANGELOG b/CHANGELOG index 2c07cca73d..9c03b01f97 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -37,7 +37,7 @@ git-annex (10.20230408) UNRELEASED; urgency=medium of core.sharedRepository and umask. * initremote: Avoid creating a remote that is not encrypted when gpg is 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 documented, omitting a trailing "s" that was included in the output before. diff --git a/Command/Fix.hs b/Command/Fix.hs index a7aba56de2..28c8cfa9be 100644 --- a/Command/Fix.hs +++ b/Command/Fix.hs @@ -26,7 +26,7 @@ import Utility.Touch #endif cmd :: Command -cmd = noCommit $ withAnnexOptions [annexedMatchingOptions] $ +cmd = noCommit $ withAnnexOptions [annexedMatchingOptions, jsonOptions] $ command "fix" SectionMaintenance "fix up links to annexed content" paramPaths (withParams seek) diff --git a/doc/git-annex-fix.mdwn b/doc/git-annex-fix.mdwn index d7c7ef45b0..5a670cd1a0 100644 --- a/doc/git-annex-fix.mdwn +++ b/doc/git-annex-fix.mdwn @@ -24,6 +24,16 @@ configured by annex.thin. The [[git-annex-matching-options]](1) 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. # SEE ALSO diff --git a/doc/git-annex-whereused.mdwn b/doc/git-annex-whereused.mdwn index e40457a2aa..cc0cfa9876 100644 --- a/doc/git-annex-whereused.mdwn +++ b/doc/git-annex-whereused.mdwn @@ -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 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 [[git-annex]](1) diff --git a/doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn b/doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn index 9d4c8edd73..0a0ea85389 100644 --- a/doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn +++ b/doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn @@ -8,14 +8,15 @@ These commands have been updated to support --json: * git-annex-unannex * git-annex-rmurl * git-annex-log +* git-annex-fix Provisional list of commands that don't support --json and maybe should: (Feel free to reorder things to the top) +* git-annex-whereused * git-annex-addunused * git-annex-adjust -* git-annex-assistant * git-annex-backends * git-annex-benchmark * git-annex-calckey @@ -27,7 +28,6 @@ Provisional list of commands that don't support --json and maybe should: * git-annex-dead * git-annex-describe * git-annex-diffdriver -* git-annex-direct * git-annex-dropunused * git-annex-edit * 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-filter-branch * git-annex-filter-process -* git-annex-findref -* git-annex-fix * git-annex-forget * git-annex-fuzztest * git-annex-group * git-annex-groupwanted * git-annex-importfeed -* git-annex-indirect * git-annex-init * git-annex-initremote * git-annex-inprogress -* git-annex-list * git-annex-lookupkey * git-annex-map * git-annex-matchexpression * git-annex-matching-expression -* git-annex-matching-options * git-annex-merge * git-annex-migrate * git-annex-mincopies * git-annex-multicast * git-annex-numcopies * git-annex-p2p -* git-annex-post-receive -* git-annex-pre-commit * git-annex-preferred-content -* git-annex-proxy * git-annex-readpresentkey * git-annex-reinit * git-annex-reinject @@ -76,8 +68,6 @@ Provisional list of commands that don't support --json and maybe should: * git-annex-semitrust * git-annex-setkey * git-annex-setpresentkey -* git-annex-shell -* git-annex-smudge * git-annex-sync * git-annex-test * git-annex-testremote @@ -100,5 +90,18 @@ Provisional list of commands that don't support --json and maybe should: * git-annex-vpop * git-annex-wanted * 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)