Compare commits

...

24 Commits

Author SHA1 Message Date
Lukáš Mešťan
3283122a38 Merge pull request #109 from mcpcpc/master
checkUtils: remove non-POSIX compliant features
2020-07-22 17:18:59 +02:00
Michael Czigler
920b95c042 squash commit, remove non-POSIX features in checkUtils 2020-07-21 09:07:44 -04:00
Lukáš Mešťan
810ffcff54 update homebrew badge url 2020-07-14 19:05:50 +02:00
Lukáš Mešťan
f9df7ee5e2 Merge pull request #106 from arzzen/task/log-options
Ability to use options for git log command
2020-07-10 18:18:58 +02:00
arzzen
e31fc931c8 add git log options to myDailyStats 2020-07-10 18:13:01 +02:00
arzzen
0655814800 fix test 2020-07-10 08:02:28 +02:00
arzzen
1eb8c53f09 ability to use options for git log command 2020-07-09 09:21:25 +02:00
Lukáš Mešťan
3b2f26e85d Merge pull request #103 from tomice/master
Fix folder excluding pathspec bug #102
2020-06-28 12:59:29 +02:00
Tom Ice
93aa829eae Fix folder excluding pathspec bug #102
* There was an issue with quoting in the pathspec variable where
  the variable would get mangled when being passed to different
  parameters during git operations. This change fixes that.

Fixes #102
2020-06-27 20:02:50 -04:00
Lukáš Mešťan
1a11540b67 Merge pull request #101 from tomice/master
Fix divide by zero error during lines changed calc
2020-05-11 16:15:30 +02:00
Tom Ice
6692ec8aa3 Hotfix for non-GNU awk on macOS 2020-05-10 15:10:30 -04:00
Tom Ice
63eba9f1b8 Fix divide by zero error during lines changed calc
* A new feature was implemented to show percentages when displaying
  detailed stats (menu options 1 and 2, or options -T and -R).
  However, the calculation during "lines changed" may cause an error
  within awk stating it cannot divide by zero as there is no check
  to see if the divisor is larger than zero.

  This commit attempts to fix that issue, albeit admittedly not in
  the most elegant way...

Fixes #100
2020-05-10 14:57:09 -04:00
Lukáš Mešťan
228e67f879 Merge pull request #99 from tomice/master
Fix issue with env vars not respecting spaces
2020-05-07 10:29:58 +02:00
Tom Ice
891e2277ad Add info on how to use experimental JSON feature
* The JSON output feature was not originally explained well and needed
  some additional information on how it worked. Extra info on how to use
  this feature, as well as reminding people that this is a beta feature,
  was added to help the users when trying out this option

Fixes #96
2020-05-01 17:57:19 -04:00
Tom Ice
cc87b3046f Fix issue with env vars not respecting spaces
* If a space existed within _GIT_SINCE, _GIT_UNTIL, or _GIT_PATHSPEC,
  the shell would split the variable at the first space it saw because
  the variables were not quoted.

  If you were to simply quote the variables, then a null variable would
  get inserted into git's log, and it would cause an error.

  This change adds default values to these variables at all times so
  the variables are always assigned to something that git understands.

Fixes #95
2020-05-01 15:29:33 -04:00
Lukáš Mešťan
7aea224e21 Merge pull request #98 from novadiscovery/97-new-lines-as-percent
add percentage for new lines as well
2020-05-01 11:37:49 +02:00
frederic.cogny
c37492bb4c chore(git-quick-stats): add tab instead of space for nicer alignment between percentage counts 2020-05-01 01:03:21 +02:00
frederic.cogny
c258e34afe feat(git-quick-stats): add percentage for new lines as well 2020-05-01 00:36:10 +02:00
Lukáš Mešťan
9e18cf35d4 Merge pull request #94 from arzzen/patch-issue-91
Update commitsByWeekday sorting
2020-02-18 11:31:35 +01:00
Lukáš Mešťan
24ae67ae57 update commitsByWeekday sorting
Fix inconsistent sum sorting in by-weekday, #91
2020-02-14 09:34:46 +01:00
Lukáš Mešťan
ed0e3cbb6b Merge pull request #93 from tomice/master
Fixing OS X compatibility with merge feature
2020-02-13 09:42:06 +01:00
Tom Ice
46a771138e Fixing OS X compatibility with merge feature
* OS X utilizes an older version of GNU Bash. As such, certain features
  such as lowercase expansion can fail. This commit removes the Bash 4.0
  syntax in favor of a POSIX syntax with awk.
2020-02-11 08:25:44 -05:00
Lukáš Mešťan
9f54b87ed5 Update FUNDING.yml 2020-02-05 09:33:07 +00:00
Lukáš Mešťan
246076f5f6 Bump year 2020-01-20 08:00:06 +00:00
6 changed files with 206 additions and 74 deletions

1
.github/FUNDING.yml vendored
View File

@@ -2,3 +2,4 @@
github: [arzzen]
open_collective: git-quick-stats
custom: ['https://lukasmestan.com/thanks/']

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019 Lukáš Mešťan
Copyright (c) 2020 Lukáš Mešťan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
# GIT quick statistics [![Backers on Open Collective](https://opencollective.com/git-quick-stats/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/git-quick-stats/sponsors/badge.svg)](#sponsors) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Simple%20and%20efficient%20way%20to%20access%20various%20statistics%20in%20git%20repository&url=https://github.com/arzzen/git-quick-stat&via=arzzen&hashtags=git,stats,tool,statistics,developers) [![Travis](https://api.travis-ci.org/arzzen/git-quick-stats.svg?branch=master)](https://travis-ci.org/arzzen/git-quick-stats) [![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/git-quick-stats.svg)](http://braumeister.org/formula/git-quick-stats) [![Linuxbrew package](https://repology.org/badge/version-for-repo/linuxbrew/git-quick-stats.svg)](https://repology.org/metapackage/git-quick-stats/packages)
# GIT quick statistics [![Backers on Open Collective](https://opencollective.com/git-quick-stats/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/git-quick-stats/sponsors/badge.svg)](#sponsors) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Simple%20and%20efficient%20way%20to%20access%20various%20statistics%20in%20git%20repository&url=https://github.com/arzzen/git-quick-stat&via=arzzen&hashtags=git,stats,tool,statistics,developers) [![Travis](https://api.travis-ci.org/arzzen/git-quick-stats.svg?branch=master)](https://travis-ci.org/arzzen/git-quick-stats) [![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/git-quick-stats.svg)](https://formulae.brew.sh/formula/git-quick-stats#default) [![Linuxbrew package](https://repology.org/badge/version-for-repo/linuxbrew/git-quick-stats.svg)](https://repology.org/metapackage/git-quick-stats/packages)
> `git-quick-stats` is a simple and efficient way to access various statistics in a git repository.
>
@@ -18,6 +18,7 @@
* [**Command-line arguments**](#command-line-arguments)
* [**Git log since and until**](#git-log-since-and-until)
* [**Git log limit**](#git-log-limit)
* [**Git log options**](#git-log-options)
* [**Git pathspec**](#git-pathspec)
* [**Git merge view strategy**](#git-merge-view-strategy)
* [**Color themes**](#color-themes)
@@ -146,6 +147,14 @@ You can set variable `_GIT_LIMIT` for limited output. It will affect the "change
export _GIT_LIMIT=20
```
### Git log options
You can set _GIT_LOG_OPTIONS for [git log options](https://git-scm.com/docs/git-log#_options):
```bash
export _GIT_LOG_OPTIONS="--ignore-all-space --ignore-blank-lines"
```
### Git pathspec
You can exclude a directory from the stats by using [pathspec](https://git-scm.com/docs/gitglossary#gitglossary-aiddefpathspecapathspec)

View File

@@ -8,24 +8,42 @@ set -o nounset
set -o errexit
# Beginning git log date. Respects all git datetime formats
# If $_GIT_SINCE is never set, choose epoch time as that is
# as far back as git will allow you to go
_since=${_GIT_SINCE:-}
[[ -n "${_since}" ]] && _since="--since=$_since"
if [[ -n "${_since}" ]]; then
_since="--since=$_since"
else
_since="--since=1970-01-01"
fi
# End of git log date. Respects all git datetime formats
# If $_GIT_UNTIL is never set, choose the latest system
# time from the user's current environment
_until=${_GIT_UNTIL:-}
[[ -n "${_until}" ]] && _until="--until=$_until"
if [[ -n "${_until}" ]]; then
_until="--until=$_until"
else
_until="--until=$(date)"
fi
# Set files or directories to be excluded in stats
# If $_GIT_PATHSPEC is not set, shift over the option completely
_pathspec=${_GIT_PATHSPEC:-}
[[ -n "${_pathspec}" ]] && _pathspec="-- $_pathspec"
if [[ -n "${_pathspec}" ]]; then
_pathspec="-- $_pathspec"
else
_pathspec="--"
fi
# Set merge commit view strategy. Default is to show no merge commits
# Exclusive shows only merge commits
# Enable shows regular commits together with normal commits
_merges=${_GIT_MERGE_VIEW:-}
if [[ "${_merges,,}" == "exclusive" ]]; then
_merges=$(echo "$_merges" | awk '{print tolower($0)}')
if [[ "${_merges}" == "exclusive" ]]; then
_merges="--merges"
elif [[ "${_merges,,}" == "enable" ]]; then
elif [[ "${_merges}" == "enable" ]]; then
_merges=""
else
_merges="--no-merges"
@@ -39,6 +57,14 @@ else
_limit=10
fi
# Log options
_log_options=${_GIT_LOG_OPTIONS:-}
if [[ -n "${_log_options}" ]]; then
_log_options=$_log_options
else
_log_options=""
fi
# Default menu theme
# Set the legacy theme by typing "export _MENU_THEME=legacy"
_theme="${_MENU_THEME:=default}"
@@ -48,14 +74,14 @@ _theme="${_MENU_THEME:=default}"
# ARGS: None
# OUTS: None
################################################################################
function checkUtils() {
local -r msg="not found. Please make sure this is installed and in PATH."
declare -ar utils=("awk" "basename" "cat" "column" "echo" "git" "grep" "head"
"seq" "sort" "tput" "tr" "uniq" "wc")
checkUtils() {
readonly MSG="not found. Please make sure this is installed and in PATH."
readonly UTILS="awk basename cat column echo git grep head seq sort tput \
tr uniq wc"
for u in "${utils[@]}"
for u in $UTILS
do
command -v "$u" >/dev/null 2>&1 || { echo >&2 "$u ${msg}"; exit 1; }
command -v "$u" >/dev/null 2>&1 || { echo >&2 "$u ${MSG}"; exit 1; }
done
}
@@ -123,6 +149,8 @@ ADDITIONAL USAGE
ex: export _GIT_SINCE=\"2017-01-20\"
You can set _GIT_LIMIT for limited output log
ex: export _GIT_LIMIT=20
You can set _GIT_LOG_OPTIONS for git log options
ex: export _GIT_LOG_OPTIONS=\"--ignore-all-space --ignore-blank-lines\"
You can exclude directories or files from the stats by using pathspec
ex: export _GIT_PATHSPEC=':!pattern'
You can set _GIT_MERGE_VIEW to view merge commits with normal commits
@@ -239,32 +267,39 @@ function detailedGitStats() {
git -c log.showSignature=false log ${_branch} --use-mailmap $_merges --numstat \
--pretty="format:commit %H%nAuthor: %aN <%aE>%nDate: %ad%n%n%w(0,4,4)%B%n" \
$_since $_until $_pathspec | LC_ALL=C awk '
"$_since" "$_until" $_log_options $_pathspec | LC_ALL=C awk '
function printStats(author) {
printf "\t%s:\n", author
if(more["total"] > 0) {
printf "\t insertions: %d (%.0f%%)\n", more[author], \
printf "\t insertions: %d\t(%.0f%%)\n", more[author], \
(more[author] / more["total"] * 100)
}
if(less["total"] > 0) {
printf "\t deletions: %d (%.0f%%)\n", less[author], \
printf "\t deletions: %d\t(%.0f%%)\n", less[author], \
(less[author] / less["total"] * 100)
}
if(file["total"] > 0) {
printf "\t files: %d (%.0f%%)\n", file[author], \
printf "\t files: %d\t(%.0f%%)\n", file[author], \
(file[author] / file["total"] * 100)
}
if(commits["total"] > 0) {
printf "\t commits: %d (%.0f%%)\n", commits[author], \
printf "\t commits: %d\t(%.0f%%)\n", commits[author], \
(commits[author] / commits["total"] * 100)
}
if (first[author] != "") {
printf "\t lines changed: %s\n", more[author] + less[author]
if ( ((more["total"] + less["total"]) * 100) > 0) {
printf "\t lines changed: %d\t", more[author] + less[author]
printf "(%.0f%%)\n", ((more[author] + less[author]) / \
(more["total"] + less["total"]) * 100)
}
else {
printf "\t lines changed: %d\t(0%%)\n", (more[author] + less[author])
}
printf "\t first commit: %s\n", first[author]
printf "\t last commit: %s\n", last[author]
}
@@ -288,8 +323,8 @@ function detailedGitStats() {
/^[0-9]/ {
more[author] += $1
less[author] += $2
file[author] += 1
file[author] += 1
more["total"] += $1
less["total"] += $2
file["total"] += 1
@@ -312,8 +347,8 @@ function detailedGitStats() {
################################################################################
function suggestReviewers() {
optionPicked "Suggested code reviewers (based on git history):"
git -c log.showSignature=false log --use-mailmap $_merges $_since $_until \
--pretty=%aN $_pathspec | head -n 100 | sort | uniq -c | sort -nr | LC_ALL=C awk '
git -c log.showSignature=false log --use-mailmap $_merges "$_since" "$_until" \
--pretty=%aN $_log_options $_pathspec | head -n 100 | sort | uniq -c | sort -nr | LC_ALL=C awk '
{ args[NR] = $0; }
END {
for (i = 1; i <= NR; ++i) {
@@ -328,13 +363,13 @@ function suggestReviewers() {
# OUTS: A JSON formatted file
################################################################################
function jsonOutput() {
optionPicked "Output log saved to file at: ${json_path:?}/output.json"
git -c log.showSignature=false log --use-mailmap $_merges $_since $_until \
optionPicked "Output log saved to file at: ${json_path}/output.json"
git -c log.showSignature=false log --use-mailmap $_merges "$_since" "$_until" $_log_options \
--pretty=format:'{%n "commit": "%H",%n "abbreviated_commit": "%h",%n "tree": "%T",%n "abbreviated_tree": "%t",%n "parent": "%P",%n "abbreviated_parent": "%p",%n "refs": "%D",%n "encoding": "%e",%n "subject": "%s",%n "sanitized_subject_line": "%f",%n "body": "%b",%n "commit_notes": "%N",%n "author": {%n "name": "%aN",%n "email": "%aE",%n "date": "%aD"%n },%n "commiter": {%n "name": "%cN",%n "email": "%cE",%n "date": "%cD"%n }%n},' \
| sed "$ s/,$//" \
| sed ':a;N;$!ba;s/\r\n\([^{]\)/\\n\1/g' \
| awk 'BEGIN { print("[") } { print($0) } END { print("]") }' \
> "${json_path:?}"/output.json
> "${json_path}/output.json"
}
################################################################################
@@ -349,7 +384,7 @@ function commitsByMonth() {
do
echo -en "\t$i\t"
git -c log.showSignature=false shortlog -n $_merges --format='%ad %s' \
$_since $_until | grep " $i " | wc -l
"$_since" "$_until" $_log_options | grep " $i " | wc -l
done | awk '{
count[$1] = $2
total += $2
@@ -376,21 +411,21 @@ function commitsByMonth() {
function commitsByWeekday() {
optionPicked "Git commits by weekday:"
echo -e "\tday\tsum"
local counter=1
for i in Mon Tue Wed Thu Fri Sat Sun
do
echo -en "\t$i\t"
echo -en "\t$counter\t$i\t"
git -c log.showSignature=false shortlog -n $_merges --format='%ad %s' \
$_since $_until | grep "$i " | wc -l
"$_since" "$_until" $_log_options | grep "$i " | wc -l
counter=$((counter+1))
done | awk '{
}
NR == FNR {
count[$1] = $2;
total += $2;
count[$1" "$2] = $3;
total += $3;
next
}
END{
for (day in count) {
s="|";
if (total > 0) {
@@ -398,10 +433,10 @@ function commitsByWeekday() {
for (i = 1; i <= percent; ++i) {
s=s"█"
}
printf( "\t%s\t%-0s\t%s\n", day, count[day], s );
printf("\t%s\t%s\t%-0s\t%s\n", substr(day,0,1), substr(day,3,5), count[day], s);
}
}
}' | sort -k 2 -n -r
}' | sort -k 1 -n | awk '{$1=""}1' | awk '{$1=$1}1' | awk '{printf("\t%s\t%s\t%s\n", $1, $2, $3)}'
}
################################################################################
@@ -425,7 +460,7 @@ function commitsByHour() {
do
echo -ne "\t$i\t"
git -c log.showSignature=false shortlog -n $_merges --format='%ad %s' \
"${_author}" $_since $_until | grep ' '$i: | wc -l
"${_author}" "$_since" "$_until" $_log_options | grep ' '$i: | wc -l
done | awk '{
count[$1] = $2
total += $2
@@ -452,8 +487,8 @@ function commitsByHour() {
################################################################################
function commitsPerDay() {
optionPicked "Git commits per date:";
git -c log.showSignature=false log --use-mailmap $_merges $_since $_until \
--date=short --format='%ad' $_pathspec | sort | uniq -c
git -c log.showSignature=false log --use-mailmap $_merges "$_since" "$_until" \
--date=short --format='%ad' $_log_options $_pathspec | sort | uniq -c
}
################################################################################
@@ -465,9 +500,9 @@ function commitsPerDay() {
function commitsPerAuthor() {
optionPicked "Git commits per author:"
local authorCommits=$(git -c log.showSignature=false log --use-mailmap $_merges \
$_since $_until | grep -i Author: | cut -c9-)
"$_since" "$_until" $_log_options | grep -i Author: | cut -c9-)
local coAuthorCommits=$(git -c log.showSignature=false log --use-mailmap $_merges \
$_since $_until | grep -i Co-Authored-by: | cut -c21-)
"$_since" "$_until" $_log_options | grep -i Co-Authored-by: | cut -c21-)
if [[ -z "${coAuthorCommits}" ]]
then
@@ -506,7 +541,7 @@ function myDailyStats() {
echo -e "\t" $(git -c log.showSignature=false log --use-mailmap \
--author="$(git config user.name)" $_merges \
--since=$(date "+%Y-%m-%dT00:00:00") \
--until=$(date "+%Y-%m-%dT23:59:59") --reverse \
--until=$(date "+%Y-%m-%dT23:59:59") --reverse $_log_options \
| grep commit | wc -l) "commits"
}
@@ -517,8 +552,8 @@ function myDailyStats() {
################################################################################
function contributors() {
optionPicked "All contributors (sorted by name):"
git -c log.showSignature=false log --use-mailmap $_merges $_since $_until \
--format='%aN' $_pathspec | sort -u | cat -n
git -c log.showSignature=false log --use-mailmap $_merges "$_since" "$_until" \
--format='%aN' $_log_options $_pathspec | sort -u | cat -n
}
################################################################################
@@ -529,9 +564,9 @@ function contributors() {
function branchTree() {
optionPicked "Branching tree view:"
git -c log.showSignature=false log --use-mailmap --graph --abbrev-commit \
$_since $_until --decorate \
"$_since" "$_until" --decorate \
--format=format:'--+ Commit: %h %n | Date: %aD (%ar) %n'' | Message: %s %d %n'' + Author: %aN %n' \
--all | head -n $((_limit*5))
--all $_log_options | head -n $((_limit*5))
}
################################################################################
@@ -567,7 +602,7 @@ function changelogs() {
--use-mailmap \
$_merges \
--format="%cd" \
--date=short "${_author}" $_since $_until $_pathspec \
--date=short "${_author}" "$_since" "$_until" $_log_options $_pathspec \
| sort -u -r | head -n $_limit \
| while read DATE; do
echo -e "\n[$DATE]"
@@ -624,7 +659,15 @@ if [[ "$#" -eq 1 ]]; then
-j|--json-output)
json_path=""
while [[ -z "${json_path}" ]]; do
read -r -p "Path to save JSON file: " json_path
echo "NOTE: This feature is in beta!"
echo "The file name will be saved as \"output.json\"."
echo "The full path must be provided."
echo "Variables or shorthands such as ~ are not valid."
echo "You do not need the final slash at the end of a directory path."
echo "You must have write permission to the folder you are trying to save this to."
echo "This feature only works interactively and cannot be combined with other options."
echo -e "Example of a valid path: /home/$(whoami)\n"
read -r -p "Please provide the full path to directory to save JSON file: " json_path
if [[ ! -w "${json_path}" ]]; then
echo "Invalid path or permission denied to write to given area."
json_path=""
@@ -660,7 +703,15 @@ while [[ "${opt}" != "" ]]; do
5) myDailyStats; showMenu;;
6) json_path=""
while [[ -z "${json_path}" ]]; do
read -r -p "Path to save JSON file: " json_path
echo "NOTE: This feature is in beta!"
echo "The file name will be saved as \"output.json\"."
echo "The full path must be provided."
echo "Variables, subshell commands, or shorthands such as ~ may not be valid."
echo "You do not need the final slash at the end of a directory path."
echo "You must have write permission to the folder you are trying to save this to."
echo "This feature only works interactively and cannot be combined with other options."
echo -e "Example of a valid path: /home/$(whoami)\n"
read -r -p "Please provide the full path to directory to save JSON file: " json_path
if [[ ! -w "${json_path}" ]]; then
echo "Invalid path or permission denied to write to given area."
json_path=""

View File

@@ -112,6 +112,10 @@ You can set _GIT_LIMIT for limited output log, example:
.PP
.B export _GIT_LIMIT=20
.PP
You can set _GIT_LOG_OPTIONS for git log options, example:
.PP
.B export _GIT_LOG_OPTIONS="--ignore-all-space --ignore-blank-lines"
.PP
You can exclude directories or files from the stats by using pathspec, example:
.PP
.B export _GIT_PATHSPEC=':!pattern'

View File

@@ -3,7 +3,74 @@
. tests/assert.sh -v
src="./git-quick-stats"
assert "$src fail" "Invalid argument\n\nNAME\n git-quick-stats - Simple and efficient way to access various stats in a git repo\n\nSYNOPSIS\n For non-interactive mode: git-quick-stats [OPTIONS]\n For interactive mode: git-quick-stats\n\nDESCRIPTION\n Any git repository contains tons of information about commits, contributors,\n and files. Extracting this information is not always trivial, mostly because\n of a gadzillion options to a gadzillion git commands.\n\n This program allows you to see detailed information about a git repository.\n\nOPTIONS\n -r, --suggest-reviewers\n show the best people to contact to review code\n -T, --detailed-git-stats\n give a detailed list of git stats\n -R, --git-stats-by-branch\n see detailed list of git stats by branch\n -d, --commits-per-day\n displays a list of commits per day\n -m, --commits-by-month\n displays a list of commits per month\n -w, --commits-by-weekday\n displays a list of commits per weekday\n -o, --commits-by-hour\n displays a list of commits per hour\n -A, --commits-by-author-by-hour\n displays a list of commits per hour by author\n -a, --commits-per-author\n displays a list of commits per author\n -S, --my-daily-stats\n see your current daily stats\n -C, --contributors\n see a list of everyone who contributed to the repo\n -b, --branch-tree\n show an ASCII graph of the git repo branch history\n -D, --branches-by-date\n show branches by date\n -c, --changelogs\n see changelogs\n -L, --changelogs-by-author\n see changelogs by author\n -j, --json-output\n save git log as a JSON formatted file to a specified area\n -h, -?, --help\n display this help text in the terminal\n\nADDITIONAL USAGE\n You can set _GIT_SINCE and _GIT_UNTIL to limit the git time log\n ex: export _GIT_SINCE=\"2017-01-20\"\n You can set _GIT_LIMIT for limited output log\n ex: export _GIT_LIMIT=20\n You can exclude directories or files from the stats by using pathspec\n ex: export _GIT_PATHSPEC=':!pattern'\n You can set _GIT_MERGE_VIEW to view merge commits with normal commits\n ex: export _GIT_MERGE_VIEW=enable\n You can also set _GIT_MERGE_VIEW to only show merge commits\n ex: export _GIT_MERGE_VIEW=exclusive\n You can set _MENU_THEME to display the legacy color scheme\n ex: export _MENU_THEME=legacy"
assert "$src fail" "Invalid argument
NAME
git-quick-stats - Simple and efficient way to access various stats in a git repo
SYNOPSIS
For non-interactive mode: git-quick-stats [OPTIONS]
For interactive mode: git-quick-stats
DESCRIPTION
Any git repository contains tons of information about commits, contributors,
and files. Extracting this information is not always trivial, mostly because
of a gadzillion options to a gadzillion git commands.
This program allows you to see detailed information about a git repository.
OPTIONS
-r, --suggest-reviewers
show the best people to contact to review code
-T, --detailed-git-stats
give a detailed list of git stats
-R, --git-stats-by-branch
see detailed list of git stats by branch
-d, --commits-per-day
displays a list of commits per day
-m, --commits-by-month
displays a list of commits per month
-w, --commits-by-weekday
displays a list of commits per weekday
-o, --commits-by-hour
displays a list of commits per hour
-A, --commits-by-author-by-hour
displays a list of commits per hour by author
-a, --commits-per-author
displays a list of commits per author
-S, --my-daily-stats
see your current daily stats
-C, --contributors
see a list of everyone who contributed to the repo
-b, --branch-tree
show an ASCII graph of the git repo branch history
-D, --branches-by-date
show branches by date
-c, --changelogs
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
ADDITIONAL USAGE
You can set _GIT_SINCE and _GIT_UNTIL to limit the git time log
ex: export _GIT_SINCE=\"2017-01-20\"
You can set _GIT_LIMIT for limited output log
ex: export _GIT_LIMIT=20
You can set _GIT_LOG_OPTIONS for git log options
ex: export _GIT_LOG_OPTIONS=\"--ignore-all-space --ignore-blank-lines\"
You can exclude directories or files from the stats by using pathspec
ex: export _GIT_PATHSPEC=':!pattern'
You can set _GIT_MERGE_VIEW to view merge commits with normal commits
ex: export _GIT_MERGE_VIEW=enable
You can also set _GIT_MERGE_VIEW to only show merge commits
ex: export _GIT_MERGE_VIEW=exclusive
You can set _MENU_THEME to display the legacy color scheme
ex: export _MENU_THEME=legacy"
assert_raises "$src fail" 1
assert_contains "$src --suggest-reviewers" "Suggested code reviewers (based on git history)" 127