Skip to content
Permalink
Browse files

Added ability to save log as a JSON formatted file

* The main feature of this commit is addressing the feature request
  of adding the ability to save the output as a file to use in other
  tools. I decided to use the JSON format as it's relatively straight
  forward and easy to create thanks to a few Google searches.

  The original feature request was to add the ability to output any of
  the options as a JSON/XML/YAML format. That said, because this entire project
  is relying only on built-in shell utilities, we kind of have to format stuff
  ourselves in relatively primitive tools such as awk, sed, and bash in order
  to adhere to the "spirit" of this codebase.

  It is possible to use Perl and/or Python, but that would defeat the purpose
  of this, in my opinion. The downside of not using these tools is that it
  might not be as robust and battle hardened as the others.

  AS SUCH, THIS FEATURE IS CURRENTLY EXPERIMENTAL.

  As people provide feedback, we can adjust this and possibly extend it to
  more options. For now, it respects _GIT_SINCE and _GIT_UNTIL. It does not
  respect variable expansion in paths, though, so saving it to a location such
  as "${my_save_location}" will fail.

* Made some of the variables a bit more robust by utilizing the -r flag to
  make the variables readonly. It should be noted that "local readonly" does
  not work, nor does "readonly local". The best way to do this is either via
  "local -r foo=bar" or "local foo=bar && readonly bar".

* Fixed a few comments describing how functions work.

* Added a .gitignore.

* Changed all functions to adhere to camelCase style for no real reason
  other than consistency and a few other minor things.

* Closes #31
  • Loading branch information...
tomice committed May 25, 2019
1 parent cdb3f20 commit 5f71b785accad3ef5ea71b45fbb148fb57c19c13
Showing with 137 additions and 83 deletions.
  1. +9 −0 .gitignore
  2. +2 −0 README.md
  3. +120 −81 git-quick-stats
  4. +5 −0 git-quick-stats.1
  5. +1 −2 tests/commands_test.sh
@@ -0,0 +1,9 @@
*.json
*.db
.DS_Store*
._*
.*.swp
.*.swo
.Spotlight*
.Trash*
**/*~
@@ -83,6 +83,8 @@ Possible arguments in short and long form:
see changelogs
-L, --changelogs-by-author
see changelogs by author
-j, --json-output
save git log as a JSON formatted file to a specified area
-h, -?, --help
display this help text in the terminal
```

0 comments on commit 5f71b78

Please sign in to comment.
You can’t perform that action at this time.