Repository navigation
locking: add --json flag - #1814
Conversation
|
I support offering better support for automated consumption of output, but this raises some further issues:
I feel that if we're going to offer machine-parseable output it should be a full commitment. I'm not against offering |
technoweenie
left a comment
There was a problem hiding this comment.
I agree that --json support should be more universal, and that --porcelain/--format should be supported as well. I think this PR is good to go though.
|
😍 on having a |
Wholeheartedly agree 👍. Thanks all for your input. |
This pull-request backports an internal change made to the various locking commands adding the
--jsonflag.To allow 3rd party tools written in languages that do not interoperate with Go to integrate with LFS , a
--jsonflag is used to share a standard encoding format. This allows other programs to shell out to LFS and expect an exact data format in return over stdout.As a caveat, the
Error()'d messages are not encoded in JSON. This behavior should be OK, since programs can expect that JSON parse errors should be treated as LFS errors and can treat the contents of stdout as the error message.While working on this PR, I noticed that none of the three locking commands (
locks,lock, andunlock) have manpage documentation. Before removing theGITLFSLOCKSENABLEDenvironment flag, manpages should be written, and they should include notes about the--jsonflag./cc @git-lfs/core