mirror of
https://github.com/git-quick-stats/git-quick-stats.git
synced 2025-12-16 12:00:12 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81fce5cadf | ||
|
|
f3931eb1a3 | ||
|
|
bdfe3beb25 | ||
|
|
90d118f09f | ||
|
|
d12c1c6c4f | ||
|
|
749367701d |
14
README.md
14
README.md
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
> 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 – I don’t think there is a single person alive who knows them all. Probably not even [Linus Torvalds](https://github.com/torvalds) himself :).
|
> 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 – I don’t think there is a single person alive who knows them all. Probably not even [Linus Torvalds](https://github.com/torvalds) himself :).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
@@ -35,9 +35,9 @@
|
|||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -115,6 +115,14 @@ You can exclude directory from the stats by using [pathspec](https://git-scm.com
|
|||||||
export _GIT_PATHSPEC=':!directory'
|
export _GIT_PATHSPEC=':!directory'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Color themes
|
||||||
|
|
||||||
|
You can change to the legacy color scheme by toggling the variable `_MENU_THEME` between `default` and `legacy`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export _MENU_THEME=legacy
|
||||||
|
```
|
||||||
|

|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ else
|
|||||||
_limit=10
|
_limit=10
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Default menu theme
|
||||||
|
# Set the legacy theme by typing "export _MENU_THEME=legacy"
|
||||||
|
_theme="${_MENU_THEME:=default}"
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# DESC: Checks to make sure the user has the appropriate utilities installed
|
# DESC: Checks to make sure the user has the appropriate utilities installed
|
||||||
# ARGS: None
|
# ARGS: None
|
||||||
@@ -111,7 +115,9 @@ ADDITIONAL USAGE
|
|||||||
You can set _GIT_LIMIT for limited output log
|
You can set _GIT_LIMIT for limited output log
|
||||||
ex: export _GIT_LIMIT=20
|
ex: export _GIT_LIMIT=20
|
||||||
You can exclude a directory from the stats by using pathspec
|
You can exclude a directory from the stats by using pathspec
|
||||||
ex: export _GIT_PATHSPEC=':!directory'"
|
ex: export _GIT_PATHSPEC=':!directory'
|
||||||
|
You can set _MENU_THEME to display the legacy color scheme
|
||||||
|
ex: export _MENU_THEME=legacy"
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -122,28 +128,51 @@ ADDITIONAL USAGE
|
|||||||
function show_menu() {
|
function show_menu() {
|
||||||
local normal=$(tput sgr0)
|
local normal=$(tput sgr0)
|
||||||
local cyan=$(tput setaf 6)
|
local cyan=$(tput setaf 6)
|
||||||
|
local bold=$(tput bold)
|
||||||
local red=$(tput setaf 1)
|
local red=$(tput setaf 1)
|
||||||
local yellow=$(tput setaf 3)
|
local yellow=$(tput setaf 3)
|
||||||
|
local white=$(tput setaf 7)
|
||||||
echo -e "\n${red} Generate: ${normal}"
|
local titles=""
|
||||||
echo -e "${cyan} ${yellow} 1)${cyan} Contribution stats (by author) ${normal}"
|
local text=""
|
||||||
echo -e "${cyan} ${yellow} 2)${cyan} Contribution stats (by author) on a specific branch ${normal}"
|
local nums=""
|
||||||
echo -e "${cyan} ${yellow} 3)${cyan} Git changelogs (last $_limit days)${normal}"
|
local help_txt=""
|
||||||
echo -e "${cyan} ${yellow} 4)${cyan} Git changelogs by author ${normal}"
|
local exit_txt=""
|
||||||
echo -e "${cyan} ${yellow} 5)${cyan} My daily status ${normal}"
|
|
||||||
echo -e "${red} List: ${normal}"
|
# Adjustable color menu option
|
||||||
echo -e "${cyan} ${yellow} 6)${cyan} Branch tree view (last $_limit)${normal}"
|
if [[ "${_theme}" == "legacy" ]]; then
|
||||||
echo -e "${cyan} ${yellow} 7)${cyan} All branches (sorted by most recent commit) ${normal}"
|
titles="${bold}${red}"
|
||||||
echo -e "${cyan} ${yellow} 8)${cyan} All contributors (sorted by name) ${normal}"
|
text="${normal}${cyan}"
|
||||||
echo -e "${cyan} ${yellow} 9)${cyan} Git commits per author ${normal}"
|
nums="${bold}${yellow}"
|
||||||
echo -e "${cyan} ${yellow} 10)${cyan} Git commits per date ${normal}"
|
help_txt="${normal}${yellow}"
|
||||||
echo -e "${cyan} ${yellow} 11)${cyan} Git commits per month ${normal}"
|
exit_txt="${bold}${red}"
|
||||||
echo -e "${cyan} ${yellow} 12)${cyan} Git commits per weekday ${normal}"
|
else
|
||||||
echo -e "${cyan} ${yellow} 13)${cyan} Git commits per hour ${normal}"
|
titles="${bold}${cyan}"
|
||||||
echo -e "${cyan} ${yellow} 14)${cyan} Git commits by author per hour ${normal}"
|
text="${normal}${white}"
|
||||||
echo -e "${red} Suggest: ${normal}"
|
nums="${normal}${bold}${white}"
|
||||||
echo -e "${cyan} ${yellow} 15)${cyan} Code reviewers (based on git history) ${normal}"
|
help_txt="${normal}${cyan}"
|
||||||
echo -e "\n${yellow}Please enter a menu option or ${red}press enter to exit. ${normal}"
|
exit_txt="${bold}${cyan}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "\n${titles} Generate:${normal}"
|
||||||
|
echo -e "${nums} 1)${text} Contribution stats (by author)"
|
||||||
|
echo -e "${nums} 2)${text} Contribution stats (by author) on a specific branch"
|
||||||
|
echo -e "${nums} 3)${text} Git changelogs (last $_limit days)"
|
||||||
|
echo -e "${nums} 4)${text} Git changelogs by author"
|
||||||
|
echo -e "${nums} 5)${text} My daily status"
|
||||||
|
echo -e "\n${titles} List:"
|
||||||
|
echo -e "${nums} 6)${text} Branch tree view (last $_limit)"
|
||||||
|
echo -e "${nums} 7)${text} All branches (sorted by most recent commit)"
|
||||||
|
echo -e "${nums} 8)${text} All contributors (sorted by name)"
|
||||||
|
echo -e "${nums} 9)${text} Git commits per author"
|
||||||
|
echo -e "${nums} 10)${text} Git commits per date"
|
||||||
|
echo -e "${nums} 11)${text} Git commits per month"
|
||||||
|
echo -e "${nums} 12)${text} Git commits per weekday"
|
||||||
|
echo -e "${nums} 13)${text} Git commits per hour"
|
||||||
|
echo -e "${nums} 14)${text} Git commits by author per hour"
|
||||||
|
echo -e "\n${titles} Suggest:"
|
||||||
|
echo -e "${nums} 15)${text} Code reviewers (based on git history)"
|
||||||
|
echo -e "\n${help_txt}Please enter a menu option or ${exit_txt}press Enter to exit."
|
||||||
|
echo -n "${text}> ${normal}"
|
||||||
read -r opt
|
read -r opt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,6 +112,10 @@ You can set _GIT_LIMIT for limited output log, example:
|
|||||||
You can exclude a directory from the stats by using pathspec, example:
|
You can exclude a directory from the stats by using pathspec, example:
|
||||||
.PP
|
.PP
|
||||||
.B export _GIT_PATHSPEC=':!directory'
|
.B export _GIT_PATHSPEC=':!directory'
|
||||||
|
.PP
|
||||||
|
You can switch to the legacy color scheme, example:
|
||||||
|
.PP
|
||||||
|
.B export _MENU_THEME=legacy
|
||||||
.
|
.
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
src="./git-quick-stats"
|
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 suggestReviewers - see best people to contact to review code\n detailedGitStats - displays a detailed list of git status\n commitsPerDay - displays a list of commits per day\n commitsByMonth - displays a list of commits per month\n commitsByWeekday - displays a list of commits per weekday\n commitsByHour - displays a list of commits per hour\n commitsByAuthorByHour - see a list of commits per hour by author\n commitsPerAuthor - displays a list of commits per author\n myDailyStats - see your current daily stats\n contributors - see a list of all contributors\n branchTree - see an ASCII graph of the git repo\n branchesByDate - show branches by date\n changelogs - see changelogs\n changelogsByAuthor - see changelogs by author\n\nADDITIONAL USAGE\n You can set _GIT_SINCE and _GIT_UNTIL to limit the git time log\n ex: export _GIT_SINCE=2017-20-01\n You can set _GIT_LIMIT for limited output log\n ex: export _GIT_LIMIT=20\n You can exclude a directory from the stats by using pathspec\n ex: export _GIT_PATHSPEC=':!directory'\n \nCONTRIBUTION\n For details regarding contribution, please see the contribution.md document\n\nLICENSE\n This is under the MIT license. See LICENSE in the repo for more info"
|
#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 suggestReviewers - see best people to contact to review code\n detailedGitStats - displays a detailed list of git status\n commitsPerDay - displays a list of commits per day\n commitsByMonth - displays a list of commits per month\n commitsByWeekday - displays a list of commits per weekday\n commitsByHour - displays a list of commits per hour\n commitsByAuthorByHour - see a list of commits per hour by author\n commitsPerAuthor - displays a list of commits per author\n myDailyStats - see your current daily stats\n contributors - see a list of all contributors\n branchTree - see an ASCII graph of the git repo\n branchesByDate - show branches by date\n changelogs - see changelogs\n changelogsByAuthor - see changelogs by author\n\nADDITIONAL USAGE\n You can set _GIT_SINCE and _GIT_UNTIL to limit the git time log\n ex: export _GIT_SINCE=2017-20-01\n You can set _GIT_LIMIT for limited output log\n ex: export _GIT_LIMIT=20\n You can exclude a directory from the stats by using pathspec\n ex: export _GIT_PATHSPEC=':!directory'\n \nCONTRIBUTION\n For details regarding contribution, please see the contribution.md document\n\nLICENSE\n This is under the MIT license. See LICENSE in the repo for more info"
|
||||||
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 -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-20-01\"\n You can set _GIT_LIMIT for limited output log\n ex: export _GIT_LIMIT=20\n You can exclude a directory from the stats by using pathspec\n ex: export _GIT_PATHSPEC=':!directory'"
|
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 -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-20-01\"\n You can set _GIT_LIMIT for limited output log\n ex: export _GIT_LIMIT=20\n You can exclude a directory from the stats by using pathspec\n ex: export _GIT_PATHSPEC=':!directory'\n You can set _MENU_THEME to display the legacy color scheme\n ex: export _MENU_THEME=legacy"
|
||||||
assert_raises "$src fail" 1
|
assert_raises "$src fail" 1
|
||||||
|
|
||||||
assert_contains "$src --suggest-reviewers" "Suggested code reviewers (based on git history)" 127
|
assert_contains "$src --suggest-reviewers" "Suggested code reviewers (based on git history)" 127
|
||||||
|
|||||||
Reference in New Issue
Block a user