Skip to content

feat(cli): support batch JSON output for git-bug bug show - #1581

Open
jyn514 wants to merge 1 commit into
git-bug:trunkfrom
jyn514:multi-bug-json
Open

feat(cli): support batch JSON output for git-bug bug show#1581
jyn514 wants to merge 1 commit into
git-bug:trunkfrom
jyn514:multi-bug-json

Conversation

@jyn514

@jyn514 jyn514 commented Jul 17, 2026

Copy link
Copy Markdown

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.
If you don't like the type-punning, I could switch this to .jsonl format, 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant