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

Adding support to json #34

Merged
merged 4 commits into from
Dec 17, 2016
Merged

Conversation

luizperes
Copy link
Collaborator

This PR adds support to json as per #27

I also created a flag -json // not sure if it is the best name for the flag

In this way:

  • git ql "select author,hash from commits" returns the classic table as its output.
  • git ql -json "select author,hash from commits" returns a json as its output.

Please check the image below:

gitsql_json

@luizperes luizperes mentioned this pull request Dec 15, 2016
@filhodanuvem
Copy link
Owner

Awesome job @luizperes !!
Really thanks for contribute so fast!

I'm thinking in two points (not blockers to merge this):

  • It would be important test in some way this change ? I look for my runtime_test file and it is bad :(
  • Maybe return values as a single csv file (ok, I confess, I am a csv lover) would be also useful. What do you think? From this we could change the flag -json to -output=json in another PR.

@vigo
Copy link

vigo commented Dec 15, 2016

Great idea! 👍

@pchaganti
Copy link

👍

@luizperes
Copy link
Collaborator Author

You are completely right, @cloudson, I will include that to your runtime_test!

Regarding the json output flags and the possibility to have more flags for output, I also think that it's awesome. Will fix it soon

@KyleAMathews
Copy link

Brilliant!

@luizperes
Copy link
Collaborator Author

Hi @cloudson , I am only concerning about the flag name --output=json, shouldn't it be like --type=json or something? The flag -o and --output=<var> are often used to indicate the output filename in other CLI. What do you think about --type=<output_type>? Do you have any other suggestion?

Thanks

@filhodanuvem
Copy link
Owner

Hey!
--type looks nice for me!

@luizperes
Copy link
Collaborator Author

Hi @cloudson , please check it again! I implemented the --type flag and implemented the test. It turns out that we will need to test the whole process of parsing, because the json is already the output... Thank you.

@filhodanuvem filhodanuvem merged commit 9d47f3b into filhodanuvem:develop Dec 17, 2016
@filhodanuvem
Copy link
Owner

Perfect @luizperes . Is on develop.
I will work to make a new release soon.

@luizperes
Copy link
Collaborator Author

It sounds good! Thanks! I will also try to add new features later, such as the csv

@jhirbour
Copy link

I'd love a way to pump data from git to MySQL/PGSQL to make some info graphics about my teams git history. CSV would work @luizperes but it might also be cool to have a SQL mode. Or a way to import from git into a RDBMS.

@luizperes
Copy link
Collaborator Author

Thanks for the hint @jhirbour... we have already a similar discussion here #39..

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

Successfully merging this pull request may close these issues.

6 participants