* The previous commands were Lower CamelCase style and had no equivalent
short options. If you wanted to see the branch tree via non-interactive
mode, you always needed to supply "branchTree" as the passing argument to
the git-quick-stats script.
This commit changes the argument style to be more akin to the POSIX and GNU
styles of arguments commonly seen in many other applications. As of this
commit, there is no compatibility with legacy commands, so those who have
been using the old commands will unfortunately need to get familiar with the
new ones. All documentation and tests have been updated accordingly to
reflect the new changes.
* The main interactive loop contained a non-variable constant that was only
getting parsed correctly due to legacy fallback behavior. This commit fixes
the main loop and cleans up the formatting a little bit.
* Added -r to more areas where read reads in a variable to help prevent
it from mangling backslashes.
* Changed everything to use bash's built-in [[ notation and did some minor
formatting changes to reduce the LOC.
* Removed some unnecessary echo statements and did some other minor cleanup.
* Fixing a bug where, if you insert an author's name that has a space in the
"Git commits by author per hour" option, it fails due to improper variable
expansion. Note that the current implementation is a "greedy" one in that
it will attempt to look for any instance of the user provided string in the
author field
* In some situations, the awk statements in the functions commitsByMonth,
commitsByDay, and commitsByHour attempt to divide by zero and display
an error to the user. To invoke this bug, checkout any of the previous
commits and attempt to see commits by hour from some user who has never
committed to this repository.
This commit fixes this bug by making sure the awk statement only ever
executes when the total commits is greater than zero.
* Added a utility checker to make sure that the user has all of the necessary
tools in their path in order to run this script. If they do not exist, it
exits and informs the user that this script cannot locate them in PATH.
* Adjusted shell logic to prevent double negatives from confusing developers
as ! -z is technically read as something akin to "not has no value"
* Changed some statements to utilize safer and more predictable bash-isms
* Minor white space fixes and adjusted the README.md slightly
* Color was originally done with ANSI escape characters for defining
different "expected" colors. However, this is not uniform across all
terminals. To improve what the designers of this program expect
colors to be, escape codes were replaced with tput equivalents.
For more information, see the GNU manual here:
https://www.gnu.org/software/termutils/manual/termutils-2.0/html_chapter/tput_1.html
* Limited scope of variables to their local scope instead of having them
be global
* Renamed menu variables to aid in readability and adjusted formatting
slightly to be more uniform
* Fixed a bug where option_picked was assigning an array to a string
and relying on the default behavior of the shell to interpret it
* Added the -r option to "read" for safety, as read without -r will
interpret backslashes before spaces/line feeds, which tends to
be an unintended side effect
* Updated all backtick notation to the newer POSIX $(..) notation for
aid in readability when paired next to single quotes and improved
safety
* Updated the README.md to include missing utilities and fixed some
minor formatting issues
While using this tool feature "Contribution stats (by author)", I observed that script was not respecting author email as option was being used here was "%ae". Corrected it to "%aE", output looks good now.
The current user interface seems to place options in no particular order, which slows down the user's workflow. By providing some more organization, the learning curve will be easier for new users. In order to test the changes, I've entered each option and verified the appropriate output and action.
* Provide a hierarchy of verbs for the corresponding set of options.
* Alphabetize menu options for a second layer of organization.
* Simplify option statements and change the corresponding output in the appropriate places.
* Reorder mapping of number to function in the main while loop.
Restrict the commits used in generating stats to commits that aren't
merges. For repos that have lots of pull requests that are merged in it
can really throw off the statistics.