Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-appraise list -json dump full review with comments. #82

Open
tcolgate opened this issue Nov 20, 2017 · 1 comment
Open

git-appraise list -json dump full review with comments. #82

tcolgate opened this issue Nov 20, 2017 · 1 comment

Comments

@tcolgate
Copy link
Contributor

I'm working on vim integration for git-appraise. g
Trying to get a list of reviews programmatically, git-appraise list -json dumps the entirety of all reviews, rather than just the "headline" details. Ideally it will leave dumping of the individual review details to git-appraise show. On busy repositories, git appraise list -a -o json could be prohibitively large I guess?

@ojarjur
Copy link
Collaborator

ojarjur commented Nov 20, 2017

I agree with the general approach you are describing; only do the minimal amount of work necessary to display the information in your UX, and leave other details until the user opens a specific review.

The tool does follow that design (git appraise show --json will display more information than git appraise list --json), but it is probably still including more information than what you actually need for your UX.

We could address this by adding more output options to the list command. For instance, we could have a format flag that allows you to specify the actual fields to output. At the very least, we should probably have an option that shows the same information that is shown in the non-JSON format, but structured as JSON.

BTW, since you mentioned performance on a large repo; I do have a test repository with over 15 thousand reviews in it. The run times I see for listing those reviews are:

$ time git appraise list -a --json | grep '    "revision": ' | wc
  15050   30100  903000

real    0m3.662s
user    0m3.196s
sys     0m1.308s

and

$ time git appraise list -a | grep '^\[' | wc
  15050   30100  316066

real    0m2.656s
user    0m2.196s
sys     0m1.176s

So, the process of outputting the extra JSON and then discarding it does add noticeable latency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants