unlock, lock: Support --json.
This commit is contained in:
parent
325c40afef
commit
75ec0227f8
7 changed files with 27 additions and 2 deletions
|
@ -2,6 +2,7 @@ git-annex (6.20171027) UNRELEASED; urgency=medium
|
|||
|
||||
* Fix export of subdir of a branch.
|
||||
* Fix exporting of non-annexed files to external special remotes.
|
||||
* unlock, lock: Support --json.
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Mon, 30 Oct 2017 12:01:45 -0400
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import Logs.Location
|
|||
import Git.FilePath
|
||||
|
||||
cmd :: Command
|
||||
cmd = notDirect $ withGlobalOptions annexedMatchingOptions $
|
||||
cmd = notDirect $ withGlobalOptions (jsonOption : annexedMatchingOptions) $
|
||||
command "lock" SectionCommon
|
||||
"undo unlock command"
|
||||
paramPaths (withParams seek)
|
||||
|
|
|
@ -26,7 +26,7 @@ editcmd :: Command
|
|||
editcmd = mkcmd "edit" "same as unlock"
|
||||
|
||||
mkcmd :: String -> String -> Command
|
||||
mkcmd n d = notDirect $ withGlobalOptions annexedMatchingOptions $
|
||||
mkcmd n d = notDirect $ withGlobalOptions (jsonOption : annexedMatchingOptions) $
|
||||
command n SectionCommon d paramPaths (withParams seek)
|
||||
|
||||
seek :: CmdParams -> CommandSeek
|
||||
|
|
|
@ -18,6 +18,11 @@ the files any longer, or have made modifications you want to discard.
|
|||
The [[git-annex-matching-options]](1)
|
||||
can be used to specify files to lock.
|
||||
|
||||
* `--json`
|
||||
|
||||
Enable JSON output. This is intended to be parsed by programs that use
|
||||
git-annex. Each line of output is a JSON object.
|
||||
|
||||
# SEE ALSO
|
||||
|
||||
[[git-annex]](1)
|
||||
|
|
|
@ -37,6 +37,11 @@ file to be lost from the local repository. So, enable annex.thin with care.
|
|||
The [[git-annex-matching-options]](1)
|
||||
can be used to specify files to unlock.
|
||||
|
||||
* `--json`
|
||||
|
||||
Enable JSON output. This is intended to be parsed by programs that use
|
||||
git-annex. Each line of output is a JSON object.
|
||||
|
||||
# SEE ALSO
|
||||
|
||||
[[git-annex]](1)
|
||||
|
|
|
@ -5,3 +5,5 @@ Unlock is quite heavy in terms of I/O and thus waiting time, so we (in datalad)
|
|||
2. could there be a --json mode of output (consistent with add --json etc)?
|
||||
|
||||
[[!meta author=yoh]]
|
||||
|
||||
> added --json option [[done]] --[[Joey]]
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
[[!comment format=mdwn
|
||||
username="joey"
|
||||
subject="""comment 2"""
|
||||
date="2017-10-30T18:40:53Z"
|
||||
content="""
|
||||
Why was I talking about batch mode here before? --json of course makes
|
||||
sense to support for unlock (and lock). Adding that now.
|
||||
|
||||
And, to find the files that `git annex unlock` would operate on, you
|
||||
can simply use `git annex find`, because that does not list already
|
||||
unlocked files, and only files with their content present can be unlocked.
|
||||
""]]
|
Loading…
Reference in a new issue