From 91b9915b095b964558d319ccd57cd332c9eb38b3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 8 May 2023 15:06:19 -0400 Subject: [PATCH] reinit: Support --json and --json-error-messages Basically same concerns as init.. Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project --- CHANGELOG | 4 ++-- Command/Reinit.hs | 2 +- doc/git-annex-reinit.mdwn | 12 +++++++++++- ..._for_unannex__and_ideally_any_other_command_.mdwn | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 197cee8499..c753ded9e7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -39,8 +39,8 @@ git-annex (10.20230408) UNRELEASED; urgency=medium broken. * Support --json and --json-error-messages in more commands (addunused, dead, describe, dropunused, expire, fix, init, log, migrate, - rekey, rmurl, semitrust, setpresentkey, trust, unannex, undo, untrust, - unused) + reinit, rekey, rmurl, semitrust, setpresentkey, trust, unannex, undo, + untrust, unused) * 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/Reinit.hs b/Command/Reinit.hs index 39a0e3f5db..bdc1a6b1c9 100644 --- a/Command/Reinit.hs +++ b/Command/Reinit.hs @@ -14,7 +14,7 @@ import qualified Remote import qualified Annex.SpecialRemote cmd :: Command -cmd = dontCheck repoExists $ +cmd = dontCheck repoExists $ withAnnexOptions [jsonOptions] $ command "reinit" SectionUtility "initialize repository, reusing old UUID" (paramUUID ++ "|" ++ paramDesc) diff --git a/doc/git-annex-reinit.mdwn b/doc/git-annex-reinit.mdwn index 46973570d8..f7c528a0a7 100644 --- a/doc/git-annex-reinit.mdwn +++ b/doc/git-annex-reinit.mdwn @@ -25,7 +25,17 @@ that are configured with autoenable=true. # OPTIONS -* The [[git-annex-common-options]](1) can be used. +* `--json` + + Enable JSON output. This is intended to be parsed by programs that use + git-annex. + +* `--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/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn b/doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn index 5e90653e51..82bc64974a 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 @@ -33,6 +33,7 @@ These commands have been updated to support --json: * git-annex-describe * git-annex-unused * git-annex-init +* git-annex-reinit Provisional list of commands that don't support --json and maybe should: @@ -42,7 +43,6 @@ Provisional list of commands that don't support --json and maybe should: * git-annex-enableremote * git-annex-initremote * git-annex-merge -* git-annex-reinit * git-annex-reinject * git-annex-renameremote * git-annex-sync -- 2.30.2