feat(cli): support batch JSON output for git-bug bug show - #1581
Open
jyn514 wants to merge 1 commit into
Open
Conversation
Previously, there was no way to dump the full contents of all bugs, which made it prohibitively expensive to script `git-bug` because it would repeatedly attempt to acquire the `.git` lock. Allow dumping full contents by specifying all bugs the user is interested in: `git bug bug show --format=json <ID> <ID...>` Existing one-bug `show` commands continue to use a top-level object; this is not a breaking change. Multiple bugs are serialized as an array. This *only* supports `--format=json`; any other format will error. This does not support `--field`. This is meant to be a "plumbing" command, not user-facing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, there was no way to dump the full contents of all bugs, which made it prohibitively expensive to script
git-bugbecause it would repeatedly attempt to acquire the.gitlock. Allow dumping full contents by specifying all bugs the user is interested in:git bug bug show --format=json <ID> <ID...>Existing one-bug
showcommands continue to use a top-level object; this is not a breaking change.Multiple bugs are serialized as an array.
If you don't like the type-punning, I could switch this to
.jsonlformat, one object per line.This only supports
--format=json; any other format will error. This does not support--field.This is meant to be a "plumbing" command, not user-facing.
I kinda went overkill on the tests. Happy to shrink them if you don't want to pin the guarantees. The collision detection one especially is probably a bit much.
Disclaimer: this was assisted by Codex 5.5 and 5.6-sol, which wrote the actual code. I wrote the PR description / commit message, and reviewed the code before opening the PR.