You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I want to be able to say things like
CHANGE_ID=$(jj new main --json | jq .change_id)
or
AUTHOR=$(jj show $commit --json | jq .author.name)
This comes up often when doing any scripting that involves repo operations.
Describe the solution you'd like
Add --json to the most popular commands. It would cause jj to stdout a json object with the "result" of whatever the command does.
It's ok if
it's just one or two commands at first,
and it's also ok if the JSON object is merely a subset of the result,
and it's also ok to fail to output any json if the command fails for whatever reason.
(but ideally the output would be {"error": ..., "details": {...}} or smth of course)
Describe alternatives you've considered
I haven't really. I mean, the backend/api idea is an alternative in a way, since then I just do curl jj/show instead of jj show --json, but I'd say the --json bit is actually a stepping stone towards the api.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I want to be able to say things like
CHANGE_ID=$(jj new main --json | jq .change_id)
or
AUTHOR=$(jj show $commit --json | jq .author.name)
This comes up often when doing any scripting that involves repo operations.
Describe the solution you'd like
Add
--json
to the most popular commands. It would cause jj to stdout a json object with the "result" of whatever the command does.It's ok if
{"error": ..., "details": {...}}
or smth of course)Describe alternatives you've considered
I haven't really. I mean, the backend/api idea is an alternative in a way, since then I just do
curl jj/show
instead ofjj show --json
, but I'd say the--json
bit is actually a stepping stone towards the api.The text was updated successfully, but these errors were encountered: