mirror of
https://github.com/git-quick-stats/git-quick-stats.git
synced 2025-12-16 12:00:12 +01:00
Merge pull request #190 from git-quick-stats/task/commits-heatmap
commits heatmap
This commit is contained in:
831
README.md
831
README.md
@@ -1,420 +1,411 @@
|
|||||||
# GIT quick statistics [](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)
|
# GIT quick statistics [](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)
|
||||||
|
|
||||||
[](https://formulae.brew.sh/formula/git-quick-stats#default)
|
[](https://formulae.brew.sh/formula/git-quick-stats#default)
|
||||||
|
|
||||||
> `git-quick-stats` is a simple and efficient way to access various statistics in a git repository.
|
> `git-quick-stats` is a simple and efficient way to access various statistics in a git repository.
|
||||||
>
|
>
|
||||||
> Any git repository may contain tons of information about commits, contributors, and files. Extracting this information is not always trivial, mostly because there are 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 may contain tons of information about commits, contributors, and files. Extracting this information is not always trivial, mostly because there are 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
|
|
||||||
|
[**Screenshots**](#screenshots)
|
||||||
[**Screenshots**](#screenshots)
|
|
||||||
|
[**Usage**](#usage)
|
||||||
[**Usage**](#usage)
|
|
||||||
|
- [**Interactive**](#interactive)
|
||||||
- [**Interactive**](#interactive)
|
- [**Non-interactive**](#non-interactive)
|
||||||
- [**Non-interactive**](#non-interactive)
|
- [**Command-line arguments**](#command-line-arguments)
|
||||||
- [**Command-line arguments**](#command-line-arguments)
|
- [**Git log since and until**](#git-log-since-and-until)
|
||||||
- [**Git log since and until**](#git-log-since-and-until)
|
- [**Git log limit**](#git-log-limit)
|
||||||
- [**Git log limit**](#git-log-limit)
|
- [**Git log options**](#git-log-options)
|
||||||
- [**Git log options**](#git-log-options)
|
- [**Git pathspec**](#git-pathspec)
|
||||||
- [**Git pathspec**](#git-pathspec)
|
- [**Git merge view strategy**](#git-merge-view-strategy)
|
||||||
- [**Git merge view strategy**](#git-merge-view-strategy)
|
- [**Color themes**](#color-themes)
|
||||||
- [**Color themes**](#color-themes)
|
|
||||||
|
[**Installation**](#installation)
|
||||||
[**Installation**](#installation)
|
|
||||||
|
- [**UNIX and Linux**](#unix-and-linux)
|
||||||
- [**UNIX and Linux**](#unix-and-linux)
|
- [**macOS**](#macos-homebrew)
|
||||||
- [**macOS**](#macos-homebrew)
|
- [**Windows**](#windows)
|
||||||
- [**Windows**](#windows)
|
- [**Docker**](#docker)
|
||||||
- [**Docker**](#docker)
|
|
||||||
|
[**System requirements**](#system-requirements)
|
||||||
[**System requirements**](#system-requirements)
|
|
||||||
|
- [**Dependencies**](#dependencies)
|
||||||
- [**Dependencies**](#dependencies)
|
|
||||||
|
[**FAQ**](#faq)
|
||||||
[**FAQ**](#faq)
|
|
||||||
|
[**Contribution**](#contribution)
|
||||||
[**Contribution**](#contribution)
|
|
||||||
|
- [**Code reviews**](#code-reviews)
|
||||||
- [**Code reviews**](#code-reviews)
|
- [**Some tips for good pull requests**](#some-tips-for-good-pull-requests)
|
||||||
- [**Some tips for good pull requests**](#some-tips-for-good-pull-requests)
|
- [**Formatting**](#formatting)
|
||||||
- [**Formatting**](#formatting)
|
|
||||||
|
[**Tests**](#tests)
|
||||||
[**Tests**](#tests)
|
|
||||||
|
[**Licensing**](#licensing)
|
||||||
[**Licensing**](#licensing)
|
|
||||||
|
[**Contributors**](#contributors)
|
||||||
[**Contributors**](#contributors)
|
|
||||||
|
- [**Backers**](#backers)
|
||||||
- [**Backers**](#backers)
|
- [**Sponsors**](#sponsors)
|
||||||
- [**Sponsors**](#sponsors)
|
|
||||||
|
## Screenshots
|
||||||
## Screenshots
|
|
||||||
|

|
||||||

|
|
||||||
|

|
||||||

|
|
||||||
|

|
||||||

|
|
||||||
|
## Usage
|
||||||
|
|
||||||
## Usage
|
### Interactive
|
||||||
|
|
||||||
### Interactive
|
`git-quick-stats` has a built-in interactive menu that can be executed as such:
|
||||||
|
|
||||||
`git-quick-stats` has a built-in interactive menu that can be executed as such:
|
```bash
|
||||||
|
git-quick-stats
|
||||||
```bash
|
```
|
||||||
git-quick-stats
|
|
||||||
```
|
Or
|
||||||
|
|
||||||
Or
|
```bash
|
||||||
|
git quick-stats
|
||||||
```bash
|
```
|
||||||
git quick-stats
|
|
||||||
```
|
### Non-interactive
|
||||||
|
|
||||||
### Non-interactive
|
For those who prefer to utilize command-line options, `git-quick-stats` also has a non-interactive mode supporting both short and long options:
|
||||||
|
|
||||||
For those who prefer to utilize command-line options, `git-quick-stats` also has a non-interactive mode supporting both short and long options:
|
```bash
|
||||||
|
git-quick-stats <optional-command-to-execute-directly>
|
||||||
```bash
|
```
|
||||||
git-quick-stats <optional-command-to-execute-directly>
|
|
||||||
```
|
Or
|
||||||
|
|
||||||
Or
|
```bash
|
||||||
|
git quick-stats <optional-command-to-execute-directly>
|
||||||
```bash
|
```
|
||||||
git quick-stats <optional-command-to-execute-directly>
|
|
||||||
```
|
### Command-line arguments
|
||||||
|
|
||||||
### Command-line arguments
|
Possible arguments in short and long form:
|
||||||
|
|
||||||
Possible arguments in short and long form:
|
```bash
|
||||||
|
GENERATE OPTIONS
|
||||||
```bash
|
-T, --detailed-git-stats
|
||||||
GENERATE OPTIONS
|
give a detailed list of git stats
|
||||||
-T, --detailed-git-stats
|
-R, --git-stats-by-branch
|
||||||
give a detailed list of git stats
|
see detailed list of git stats by branch
|
||||||
-R, --git-stats-by-branch
|
-c, --changelogs
|
||||||
see detailed list of git stats by branch
|
see changelogs
|
||||||
-c, --changelogs
|
-L, --changelogs-by-author
|
||||||
see changelogs
|
see changelogs by author
|
||||||
-L, --changelogs-by-author
|
-S, --my-daily-stats
|
||||||
see changelogs by author
|
see your current daily stats
|
||||||
-S, --my-daily-stats
|
-V, --csv-output-by-branch
|
||||||
see your current daily stats
|
output daily stats by branch in CSV format
|
||||||
-V, --csv-output-by-branch
|
-j, --json-output
|
||||||
output daily stats by branch in CSV format
|
save git log as a JSON formatted file to a specified area
|
||||||
-j, --json-output
|
|
||||||
save git log as a JSON formatted file to a specified area
|
LIST OPTIONS
|
||||||
|
-b, --branch-tree
|
||||||
LIST OPTIONS
|
show an ASCII graph of the git repo branch history
|
||||||
-b, --branch-tree
|
-D, --branches-by-date
|
||||||
show an ASCII graph of the git repo branch history
|
show branches by date
|
||||||
-D, --branches-by-date
|
-C, --contributors
|
||||||
show branches by date
|
see a list of everyone who contributed to the repo
|
||||||
-C, --contributors
|
-n, --new-contributors
|
||||||
see a list of everyone who contributed to the repo
|
list everyone who made their first contribution since a specified date
|
||||||
-n, --new-contributors
|
-a, --commits-per-author
|
||||||
list everyone who made their first contribution since a specified date
|
displays a list of commits per author
|
||||||
-a, --commits-per-author
|
-d, --commits-per-day
|
||||||
displays a list of commits per author
|
displays a list of commits per day
|
||||||
-d, --commits-per-day
|
-m, --commits-by-month
|
||||||
displays a list of commits per day
|
displays a list of commits per month
|
||||||
-Y, --commits-by-year
|
-Y, --commits-by-year
|
||||||
displays a list of commits per year
|
displays a list of commits per year
|
||||||
-m, --commits-by-month
|
-w, --commits-by-weekday
|
||||||
displays a list of commits per month
|
displays a list of commits per weekday
|
||||||
-w, --commits-by-weekday
|
-W, --commits-by-author-by-weekday
|
||||||
displays a list of commits per weekday
|
displays a list of commits per weekday by author
|
||||||
-W, --commits-by-author-by-weekday
|
-o, --commits-by-hour
|
||||||
displays a list of commits per weekday by author
|
displays a list of commits per hour
|
||||||
-o, --commits-by-hour
|
-A, --commits-by-author-by-hour
|
||||||
displays a list of commits per hour
|
displays a list of commits per hour by author
|
||||||
-A, --commits-by-author-by-hour
|
-z, --commits-by-timezone
|
||||||
displays a list of commits per hour by author
|
displays a list of commits per timezone
|
||||||
-z, --commits-by-timezone
|
-Z, --commits-by-author-by-timezone
|
||||||
displays a list of commits per timezone
|
displays a list of commits per timezone by author
|
||||||
-Z, --commits-by-author-by-timezone
|
|
||||||
displays a list of commits per timezone by author
|
CALENDAR OPTIONS
|
||||||
|
-k, --commits-calendar-by-author
|
||||||
SUGGEST OPTIONS
|
shows a calendar heatmap of commits per day-of-week per month for a given author
|
||||||
-r, --suggest-reviewers
|
-H, --commits-heatmap
|
||||||
show the best people to contact to review code
|
shows a heatmap of commits per day-of-week per month for the last 30 days
|
||||||
-h, -?, --help
|
|
||||||
display this help text in the terminal
|
SUGGEST OPTIONS
|
||||||
```
|
-r, --suggest-reviewers
|
||||||
|
show the best people to contact to review code
|
||||||
### Git log since and until
|
-h, -?, --help
|
||||||
|
display this help text in the terminal
|
||||||
You can set the variables `_GIT_SINCE` and/or `_GIT_UNTIL` before running `git-quick-stats` to limit the git log. These work similar to git's built-in `--since` and `--until` log options.
|
```
|
||||||
|
|
||||||
```bash
|
### Git log since and until
|
||||||
export _GIT_SINCE="2017-01-20"
|
|
||||||
export _GIT_UNTIL="2017-01-22"
|
You can set the variables `_GIT_SINCE` and/or `_GIT_UNTIL` before running `git-quick-stats` to limit the git log. These work similar to git's built-in `--since` and `--until` log options.
|
||||||
```
|
|
||||||
|
```bash
|
||||||
Once set, run `git quick-stats` as normal. Note that this affects all stats that parse the git log history until unset.
|
export _GIT_SINCE="2017-01-20"
|
||||||
|
export _GIT_UNTIL="2017-01-22"
|
||||||
### Git log limit
|
```
|
||||||
|
|
||||||
You can set variable `_GIT_LIMIT` for limited output. It will affect the "changelogs" and "branch tree" options. The default limit is `10`.
|
Once set, run `git quick-stats` as normal. Note that this affects all stats that parse the git log history until unset.
|
||||||
|
|
||||||
```bash
|
### Git log limit
|
||||||
export _GIT_LIMIT=20
|
|
||||||
```
|
You can set variable `_GIT_LIMIT` for limited output. It will affect the "changelogs" and "branch tree" options. The default limit is `10`.
|
||||||
|
|
||||||
### Git log options
|
```bash
|
||||||
|
export _GIT_LIMIT=20
|
||||||
You can set `_GIT_LOG_OPTIONS` for [git log options](https://git-scm.com/docs/git-log#_options):
|
```
|
||||||
|
|
||||||
```bash
|
### Git log options
|
||||||
export _GIT_LOG_OPTIONS="--ignore-all-space --ignore-blank-lines"
|
|
||||||
```
|
You can set `_GIT_LOG_OPTIONS` for [git log options](https://git-scm.com/docs/git-log#_options):
|
||||||
|
|
||||||
### Git pathspec
|
```bash
|
||||||
|
export _GIT_LOG_OPTIONS="--ignore-all-space --ignore-blank-lines"
|
||||||
You can exclude a directory from the stats by using [pathspec](https://git-scm.com/docs/gitglossary#gitglossary-aiddefpathspecapathspec)
|
```
|
||||||
|
|
||||||
```bash
|
### Git pathspec
|
||||||
export _GIT_PATHSPEC=':!directory'
|
|
||||||
```
|
You can exclude a directory from the stats by using [pathspec](https://git-scm.com/docs/gitglossary#gitglossary-aiddefpathspecapathspec)
|
||||||
|
|
||||||
You can also exclude files from the stats. Note that it works with any alphanumeric, glob, or regex that git respects.
|
```bash
|
||||||
|
export _GIT_PATHSPEC=':!directory'
|
||||||
```bash
|
```
|
||||||
export _GIT_PATHSPEC=':!package-lock.json'
|
|
||||||
```
|
You can also exclude files from the stats. Note that it works with any alphanumeric, glob, or regex that git respects.
|
||||||
|
|
||||||
### Git merge view strategy
|
```bash
|
||||||
|
export _GIT_PATHSPEC=':!package-lock.json'
|
||||||
You can set the variable `_GIT_MERGE_VIEW` to enable merge commits to be part of the stats by setting `_GIT_MERGE_VIEW` to `enable`. You can also choose to only show merge commits by setting `_GIT_MERGE_VIEW` to `exclusive`. Default is to not show merge commits. These work similar to git's built-in `--merges` and `--no-merges` log options.
|
```
|
||||||
|
|
||||||
```bash
|
### Git merge view strategy
|
||||||
export _GIT_MERGE_VIEW="enable"
|
|
||||||
export _GIT_MERGE_VIEW="exclusive"
|
You can set the variable `_GIT_MERGE_VIEW` to enable merge commits to be part of the stats by setting `_GIT_MERGE_VIEW` to `enable`. You can also choose to only show merge commits by setting `_GIT_MERGE_VIEW` to `exclusive`. Default is to not show merge commits. These work similar to git's built-in `--merges` and `--no-merges` log options.
|
||||||
```
|
|
||||||
|
```bash
|
||||||
### Git branch
|
export _GIT_MERGE_VIEW="enable"
|
||||||
|
export _GIT_MERGE_VIEW="exclusive"
|
||||||
You can set the variable `_GIT_BRANCH` to set the branch of the stats. Works with commands `--git-stats-by-branch` and `--csv-output-by-branch`.
|
```
|
||||||
|
|
||||||
```bash
|
### Git branch
|
||||||
export _GIT_BRANCH="master"
|
|
||||||
```
|
You can set the variable `_GIT_BRANCH` to set the branch of the stats. Works with commands `--git-stats-by-branch` and `--csv-output-by-branch`.
|
||||||
|
|
||||||
### Ignore authors
|
```bash
|
||||||
|
export _GIT_BRANCH="master"
|
||||||
You can set the variable `_GIT_IGNORE_AUTHORS` to filter out specific authors. It will affect the "All contributors", ""Suggested code reviewers" and "New contributors" options.
|
```
|
||||||
|
|
||||||
```bash
|
### Ignore authors
|
||||||
export _GIT_IGNORE_AUTHORS="(author@examle.com|username)"
|
|
||||||
```
|
You can set the variable `_GIT_IGNORE_AUTHORS` to filter out specific authors. It will affect the "All contributors", ""Suggested code reviewers" and "New contributors" options.
|
||||||
|
|
||||||
### Sorting contribution stats
|
```bash
|
||||||
|
export _GIT_IGNORE_AUTHORS="(author@examle.com|username)"
|
||||||
You can sort contribution stats by field `name`, `commits`, `insertions`, `deletions`, or `lines` (total lines changed) and order (`asc`, `desc`). e.g.: `commits-desc`
|
```
|
||||||
|
|
||||||
```bash
|
### Sorting contribution stats
|
||||||
export _GIT_SORT_BY="name-asc"
|
|
||||||
```
|
You can sort contribution stats by field `name`, `commits`, `insertions`, `deletions`, or `lines` (total lines changed) and order (`asc`, `desc`). e.g.: `commits-desc`
|
||||||
|
|
||||||
### Color themes
|
```bash
|
||||||
|
export _GIT_SORT_BY="name-asc"
|
||||||
You can change to the legacy color scheme by toggling the variable `_MENU_THEME` between `default` and `legacy`.
|
```
|
||||||
You can completely disable the color theme by setting the `_MENU_THEME` variable to `none`.
|
|
||||||
|
### Commit days
|
||||||
```bash
|
|
||||||
export _MENU_THEME="legacy"
|
You can set \_GIT_DAYS to set the number of days for the heatmap
|
||||||
# or
|
|
||||||
export _MENU_THEME="none"
|
```bash
|
||||||
```
|
export _GIT_DAYS=30
|
||||||
|
```
|
||||||

|
|
||||||
|
### Color themes
|
||||||
## Installation
|
|
||||||
|
You can change to the legacy color scheme by toggling the variable `_MENU_THEME` between `default` and `legacy`.
|
||||||
### Debian and Ubuntu
|
You can completely disable the color theme by setting the `_MENU_THEME` variable to `none`.
|
||||||
|
|
||||||
If you are on at least Debian Bullseye or Ubuntu Focal you can use apt for installation:
|
```bash
|
||||||
|
export _MENU_THEME="legacy"
|
||||||
```bash
|
# or
|
||||||
apt install git-quick-stats
|
export _MENU_THEME="none"
|
||||||
```
|
```
|
||||||
|
|
||||||
### UNIX and Linux
|

|
||||||
|
|
||||||
```bash
|
## Installation
|
||||||
git clone https://github.com/git-quick-stats/git-quick-stats.git && cd git-quick-stats
|
|
||||||
sudo make install
|
### Debian and Ubuntu
|
||||||
```
|
|
||||||
|
If you are on at least Debian Bullseye or Ubuntu Focal you can use apt for installation:
|
||||||
For uninstalling, open up the cloned directory and run
|
|
||||||
|
```bash
|
||||||
```bash
|
apt install git-quick-stats
|
||||||
sudo make uninstall
|
```
|
||||||
```
|
|
||||||
|
### UNIX and Linux
|
||||||
For update/reinstall
|
|
||||||
|
```bash
|
||||||
```bash
|
git clone https://github.com/git-quick-stats/git-quick-stats.git && cd git-quick-stats
|
||||||
sudo make reinstall
|
sudo make install
|
||||||
```
|
```
|
||||||
|
|
||||||
### macOS (homebrew)
|
For uninstalling, open up the cloned directory and run
|
||||||
|
|
||||||
macOS requires GNU coreutils to be installed and for the non "g" aliased
|
```bash
|
||||||
versions to be exported to your path. The following is an example of how to
|
sudo make uninstall
|
||||||
perform this if you are using Homebrew as your package manager.
|
```
|
||||||
|
|
||||||
```bash
|
For update/reinstall
|
||||||
brew install coreutils
|
|
||||||
export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"
|
```bash
|
||||||
```
|
sudo make reinstall
|
||||||
|
```
|
||||||
From there, you can install via Homebrew as follows:
|
|
||||||
|
### macOS (homebrew)
|
||||||
```bash
|
|
||||||
brew install git-quick-stats
|
macOS requires GNU coreutils to be installed and for the non "g" aliased
|
||||||
```
|
versions to be exported to your path. The following is an example of how to
|
||||||
|
perform this if you are using Homebrew as your package manager.
|
||||||
Or you can follow the UNIX and Linux instructions if you wish.
|
|
||||||
|
```bash
|
||||||
If you would like to default to using the GNU coreutils (recommended), then you
|
brew install coreutils
|
||||||
can add `export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"` to
|
export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"
|
||||||
your applicable `~/.bash_profile`, `~/.zprofile`, or other relevant profile
|
```
|
||||||
based on the shell of your choice.
|
|
||||||
|
From there, you can install via Homebrew as follows:
|
||||||
### Windows
|
|
||||||
|
```bash
|
||||||
If you are installing with Cygwin, use these scripts:
|
brew install git-quick-stats
|
||||||
|
```
|
||||||
- [installer](https://gist.github.com/arzzen/35e09866dfdadf2108b2420045739245)
|
|
||||||
- [uninstaller](https://gist.github.com/arzzen/21c660014d0663b6c5710014714779d6)
|
Or you can follow the UNIX and Linux instructions if you wish.
|
||||||
|
|
||||||
If you are wishing to use this with WSL, follow the UNIX and Linux instructions.
|
If you would like to default to using the GNU coreutils (recommended), then you
|
||||||
|
can add `export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"` to
|
||||||
### Docker
|
your applicable `~/.bash_profile`, `~/.zprofile`, or other relevant profile
|
||||||
|
based on the shell of your choice.
|
||||||
You can use the Docker image provided:
|
|
||||||
|
### Windows
|
||||||
- Build: `docker build -t arzzen/git-quick-stats .`
|
|
||||||
- Run interactive menu: `docker run --rm -it -v $(pwd):/git arzzen/git-quick-stats`
|
If you are installing with Cygwin, use these scripts:
|
||||||
- Docker pull command: `docker pull arzzen/git-quick-stats` [docker repository](https://hub.docker.com/r/arzzen/git-quick-stats)
|
|
||||||
|
- [installer](https://gist.github.com/arzzen/35e09866dfdadf2108b2420045739245)
|
||||||
## System requirements
|
- [uninstaller](https://gist.github.com/arzzen/21c660014d0663b6c5710014714779d6)
|
||||||
|
|
||||||
- An OS with a Bash shell
|
If you are wishing to use this with WSL, follow the UNIX and Linux instructions.
|
||||||
- Tools we use:
|
|
||||||
|
### Docker
|
||||||
```bash
|
|
||||||
awk
|
You can use the Docker image provided:
|
||||||
basename
|
|
||||||
cat
|
- Build: `docker build -t arzzen/git-quick-stats .`
|
||||||
column
|
- Run interactive menu: `docker run --rm -it -v $(pwd):/git arzzen/git-quick-stats`
|
||||||
date
|
- Docker pull command: `docker pull arzzen/git-quick-stats` [docker repository](https://hub.docker.com/r/arzzen/git-quick-stats)
|
||||||
echo
|
|
||||||
git
|
## System requirements
|
||||||
grep
|
|
||||||
head
|
- An OS with a Bash shell
|
||||||
printf
|
- Tools we use:
|
||||||
seq
|
|
||||||
sort
|
```bash
|
||||||
tput
|
awk
|
||||||
tr
|
basename
|
||||||
uniq
|
cat
|
||||||
```
|
column
|
||||||
|
date
|
||||||
### Dependencies
|
echo
|
||||||
|
git
|
||||||
- [`bsdextrautils`](https://packages.debian.org/sid/bsdextrautils) `apt install bsdextrautils`
|
grep
|
||||||
- [`coreutils`](https://packages.debian.org/sid/coreutils) `apt install coreutils`
|
head
|
||||||
- [`gawk`](https://packages.debian.org/sid/gawk) `apt install gawk`
|
printf
|
||||||
- [`grep`](https://packages.debian.org/sid/grep) `apt install grep`
|
seq
|
||||||
- [`ncurses-bin`](https://packages.debian.org/sid/ncurses-bin) `apt install ncurses-bin`
|
sort
|
||||||
|
tput
|
||||||
## FAQ
|
tr
|
||||||
|
uniq
|
||||||
_Q:_ I get some errors after run git-quick-stats in cygwin like `/usr/local/bin/git-quick-stats: line 2: $'\r': command not found`
|
```
|
||||||
|
|
||||||
_A:_ You can run the dos2unix app in cygwin as follows: `/bin/dos2unix.exe /usr/local/bin/git-quick-stats`. This will convert the script from the CR-LF convention that Microsoft uses to the LF convention that UNIX, OS X, and Linux use. You should then should be able to run it as normal.
|
### Dependencies
|
||||||
|
|
||||||
_Q:_ How they could be used in a project with many git projects and statistics would show a summary of all git projects?
|
- [`bsdextrautils`](https://packages.debian.org/sid/bsdextrautils) `apt install bsdextrautils`
|
||||||
|
- [`coreutils`](https://packages.debian.org/sid/coreutils) `apt install coreutils`
|
||||||
_A:_ If you want to include submodule logs, you can try using the following: `export _GIT_LOG_OPTIONS="-p --submodule=log"`
|
- [`gawk`](https://packages.debian.org/sid/gawk) `apt install gawk`
|
||||||
(more info about [git log --submodule](https://git-scm.com/docs/git-log#Documentation/git-log.txt---submoduleltformatgt))
|
- [`grep`](https://packages.debian.org/sid/grep) `apt install grep`
|
||||||
|
- [`ncurses-bin`](https://packages.debian.org/sid/ncurses-bin) `apt install ncurses-bin`
|
||||||
## Contribution
|
|
||||||
|
## FAQ
|
||||||
Want to contribute? Great! First, read this page.
|
|
||||||
|
_Q:_ I get some errors after run git-quick-stats in cygwin like `/usr/local/bin/git-quick-stats: line 2: $'\r': command not found`
|
||||||
### Code reviews
|
|
||||||
|
_A:_ You can run the dos2unix app in cygwin as follows: `/bin/dos2unix.exe /usr/local/bin/git-quick-stats`. This will convert the script from the CR-LF convention that Microsoft uses to the LF convention that UNIX, OS X, and Linux use. You should then should be able to run it as normal.
|
||||||
All submissions, including submissions by project members, require review.</br>
|
|
||||||
We use GitHub pull requests for this purpose.
|
_Q:_ How they could be used in a project with many git projects and statistics would show a summary of all git projects?
|
||||||
|
|
||||||
### Some tips for good pull requests
|
_A:_ If you want to include submodule logs, you can try using the following: `export _GIT_LOG_OPTIONS="-p --submodule=log"`
|
||||||
|
(more info about [git log --submodule](https://git-scm.com/docs/git-log#Documentation/git-log.txt---submoduleltformatgt))
|
||||||
- Use our code </br>
|
|
||||||
When in doubt, try to stay true to the existing code of the project.
|
## Contribution
|
||||||
- Write a descriptive commit message. What problem are you solving and what
|
|
||||||
are the consequences? Where and what did you test? Some good tips:
|
Want to contribute? Great! First, read this page.
|
||||||
[here](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message)
|
|
||||||
and [here](https://www.kernel.org/doc/Documentation/SubmittingPatches).
|
### Code reviews
|
||||||
- If your PR consists of multiple commits which are successive improvements /
|
|
||||||
fixes to your first commit, consider squashing them into a single commit
|
All submissions, including submissions by project members, require review.</br>
|
||||||
(`git rebase -i`) such that your PR is a single commit on top of the current
|
We use GitHub pull requests for this purpose.
|
||||||
HEAD. This make reviewing the code so much easier, and our history more
|
|
||||||
readable.
|
### Some tips for good pull requests
|
||||||
|
|
||||||
### Formatting
|
- Use our code </br>
|
||||||
|
When in doubt, try to stay true to the existing code of the project.
|
||||||
This documentation is written using standard [markdown syntax](https://help.github.com/articles/markdown-basics/). Please submit your changes using the same syntax.
|
- Write a descriptive commit message. What problem are you solving and what
|
||||||
|
are the consequences? Where and what did you test? Some good tips:
|
||||||
## Tests
|
[here](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message)
|
||||||
|
and [here](https://www.kernel.org/doc/Documentation/SubmittingPatches).
|
||||||
[](https://codecov.io/gh/arzzen/git-quick-stats)
|
- If your PR consists of multiple commits which are successive improvements /
|
||||||
|
fixes to your first commit, consider squashing them into a single commit
|
||||||
```bash
|
(`git rebase -i`) such that your PR is a single commit on top of the current
|
||||||
make test
|
HEAD. This make reviewing the code so much easier, and our history more
|
||||||
```
|
readable.
|
||||||
|
|
||||||
## Licensing
|
### Formatting
|
||||||
|
|
||||||
MIT see [LICENSE][] for the full license text.
|
This documentation is written using standard [markdown syntax](https://help.github.com/articles/markdown-basics/). Please submit your changes using the same syntax.
|
||||||
|
|
||||||
[read this page]: http://github.com/git-quick-stats/git-quick-stats/blob/master/.github/CONTRIBUTING.md
|
## Tests
|
||||||
[landing page]: https://git-quick-stats.sh
|
|
||||||
[LICENSE]: https://github.com/git-quick-stats/git-quick-stats/blob/master/LICENSE
|
[](https://codecov.io/gh/arzzen/git-quick-stats)
|
||||||
|
|
||||||
## Contributors
|
```bash
|
||||||
|
make test
|
||||||
This project exists thanks to all the people who contribute.
|
```
|
||||||
|
|
||||||
[](https://github.com/git-quick-stats/git-quick-stats/graphs/contributors)
|
## Licensing
|
||||||
|
|
||||||
### Backers
|
MIT see [LICENSE][] for the full license text.
|
||||||
|
|
||||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/git-quick-stats#backer)]
|
[read this page]: http://github.com/git-quick-stats/git-quick-stats/blob/master/.github/CONTRIBUTING.md
|
||||||
|
[landing page]: https://git-quick-stats.sh
|
||||||
[](https://opencollective.com/git-quick-stats#backers)
|
[LICENSE]: https://github.com/git-quick-stats/git-quick-stats/blob/master/LICENSE
|
||||||
|
|
||||||
### Sponsors
|
## Contributors
|
||||||
|
|
||||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/git-quick-stats#sponsor)]
|
This project exists thanks to all the people who contribute.
|
||||||
|
|
||||||
[](https://opencollective.com/git-quick-stats/sponsor/0/website)
|
[](https://github.com/git-quick-stats/git-quick-stats/graphs/contributors)
|
||||||
[](https://opencollective.com/git-quick-stats/sponsor/1/website)
|
|
||||||
[](https://opencollective.com/git-quick-stats/sponsor/2/website)
|
|
||||||
[](https://opencollective.com/git-quick-stats/sponsor/3/website)
|
|
||||||
[](https://opencollective.com/git-quick-stats/sponsor/4/website)
|
|
||||||
[](https://opencollective.com/git-quick-stats/sponsor/5/website)
|
|
||||||
[](https://opencollective.com/git-quick-stats/sponsor/6/website)
|
|
||||||
[](https://opencollective.com/git-quick-stats/sponsor/7/website)
|
|
||||||
[](https://opencollective.com/git-quick-stats/sponsor/8/website)
|
|
||||||
[](https://opencollective.com/git-quick-stats/sponsor/9/website)
|
|
||||||
|
|||||||
168
git-quick-stats
168
git-quick-stats
@@ -10,6 +10,24 @@
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o errexit
|
set -o errexit
|
||||||
|
|
||||||
|
# Global color variables using tput setaf
|
||||||
|
COLOR_NORMAL=$(tput sgr0)
|
||||||
|
COLOR_CYANL=$(tput setaf 6)
|
||||||
|
COLOR_BOLD=$(tput bold)
|
||||||
|
COLOR_RED=$(tput setaf 1)
|
||||||
|
COLOR_YELLOW=$(tput setaf 3)
|
||||||
|
COLOR_WHITE=$(tput setaf 7)
|
||||||
|
COLOR_BRIGHT_YELLOW=$(tput setaf 226)
|
||||||
|
COLOR_GOLD=$(tput setaf 220)
|
||||||
|
COLOR_ORANGE=$(tput setaf 214)
|
||||||
|
COLOR_DARK_ORANGE=$(tput setaf 208)
|
||||||
|
COLOR_RED_ORANGE=$(tput setaf 202)
|
||||||
|
COLOR_DARK_RED=$(tput setaf 160)
|
||||||
|
COLOR_DEEP_RED=$(tput setaf 88)
|
||||||
|
COLOR_DARKEST_RED=$(tput setaf 52)
|
||||||
|
COLOR_GRAY=$(tput setaf 240)
|
||||||
|
COLOR_RESET=$(tput sgr0)
|
||||||
|
|
||||||
# Beginning git log date. Respects all git datetime formats
|
# Beginning git log date. Respects all git datetime formats
|
||||||
# If $_GIT_SINCE is never set, look at the repository to find the first date.
|
# If $_GIT_SINCE is never set, look at the repository to find the first date.
|
||||||
# NOTE: previously this put the date at the fixed GIT epoch (May 2005)
|
# NOTE: previously this put the date at the fixed GIT epoch (May 2005)
|
||||||
@@ -84,6 +102,14 @@ if [[ ! "$_GIT_SORT_BY" =~ ^(name|commits|insertions|deletions|lines)-(asc|desc)
|
|||||||
_GIT_SORT_BY="name-asc"
|
_GIT_SORT_BY="name-asc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Number of days to display in the heatmap
|
||||||
|
_commit_days=${_GIT_DAYS:-30}
|
||||||
|
# If the user has not set a number of days, default to 30
|
||||||
|
if ! [[ "$_commit_days" =~ ^[0-9]+$ ]] || (( _commit_days <= 0 )); then
|
||||||
|
echo "Invalid number of days: $_commit_days. Defaulting to 30."
|
||||||
|
_commit_days=30
|
||||||
|
fi
|
||||||
|
|
||||||
# Default menu theme
|
# Default menu theme
|
||||||
# Set the legacy theme by typing "export _MENU_THEME=legacy"
|
# Set the legacy theme by typing "export _MENU_THEME=legacy"
|
||||||
_theme="${_MENU_THEME:=default}"
|
_theme="${_MENU_THEME:=default}"
|
||||||
@@ -141,6 +167,93 @@ function commitsCalendarByAuthor() {
|
|||||||
'
|
'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# DESC: Shows a heatmap of commits per hour of each day for the last 30 days
|
||||||
|
function commitsHeatmap() {
|
||||||
|
optionPicked "Commit Heatmap for the last $_commit_days days"
|
||||||
|
|
||||||
|
color_for_count() {
|
||||||
|
local n=$1
|
||||||
|
if (( n == 1 )); then
|
||||||
|
echo -n "${COLOR_BRIGHT_YELLOW}"
|
||||||
|
elif (( n < 2 )); then
|
||||||
|
echo -n "${COLOR_GOLD}"
|
||||||
|
elif (( n < 3 )); then
|
||||||
|
echo -n "${COLOR_ORANGE}"
|
||||||
|
elif (( n < 4 )); then
|
||||||
|
echo -n "${COLOR_DARK_ORANGE}"
|
||||||
|
elif (( n < 5 )); then
|
||||||
|
echo -n "${COLOR_RED_ORANGE}"
|
||||||
|
elif (( n < 6 )); then
|
||||||
|
echo -n "${COLOR_RED}"
|
||||||
|
elif (( n < 8 )); then
|
||||||
|
echo -n "${COLOR_DARK_RED}"
|
||||||
|
elif (( n < 10 )); then
|
||||||
|
echo -n "${COLOR_DEEP_RED}"
|
||||||
|
else
|
||||||
|
echo -n "${COLOR_DARKEST_RED}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
printf "Day | Date/Hours |"
|
||||||
|
local h
|
||||||
|
for h in {0..23}; do
|
||||||
|
printf " %2d" "$h"
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
echo "------------------------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
local i
|
||||||
|
for i in $(seq $((_commit_days-1)) -1 0); do
|
||||||
|
local day=$(date -d "-$i days" +"%Y-%m-%d")
|
||||||
|
if [[ $(date -d "$day" +%u) -gt 5 ]]; then
|
||||||
|
echo -en "${COLOR_GRAY}"
|
||||||
|
else
|
||||||
|
echo -en "${COLOR_RESET}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local dayName=$(date -d "$day" +%a)
|
||||||
|
printf "%s | %s |" "$dayName" "$day"
|
||||||
|
|
||||||
|
declare -a commits_per_hour
|
||||||
|
local h
|
||||||
|
for h in {0..23}; do
|
||||||
|
commits_per_hour[$h]=0
|
||||||
|
done
|
||||||
|
|
||||||
|
IFS=$'\n' commits_per_hour=($(
|
||||||
|
git log --since="$day 00:00" --until="$day 23:59" --pretty=format:"%ci" 2>/dev/null |
|
||||||
|
awk '{split($2, t, ":"); h = t[1]+0; c[h]++} END {for(i=0;i<24;i++) print c[i]+0}'
|
||||||
|
))
|
||||||
|
unset IFS
|
||||||
|
|
||||||
|
local h
|
||||||
|
for h in {0..23}; do
|
||||||
|
local count=${commits_per_hour[$h]}
|
||||||
|
local color=$(color_for_count "$count")
|
||||||
|
if (( count == 0 )); then
|
||||||
|
echo -en " ${COLOR_GRAY}.${COLOR_RESET} "
|
||||||
|
else
|
||||||
|
echo -en "${color} █ ${COLOR_RESET}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "------------------------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
echo -e "\nLegend:"
|
||||||
|
echo -e " ${COLOR_BRIGHT_YELLOW}█${COLOR_RESET} 1 commit"
|
||||||
|
echo -e " ${COLOR_GOLD}█${COLOR_RESET} 2 commits"
|
||||||
|
echo -e " ${COLOR_ORANGE}█${COLOR_RESET} 3 commits"
|
||||||
|
echo -e " ${COLOR_DARK_ORANGE}█${COLOR_RESET} 4 commits"
|
||||||
|
echo -e " ${COLOR_RED_ORANGE}█${COLOR_RESET} 5 commits"
|
||||||
|
echo -e " ${COLOR_RED}█${COLOR_RESET} 6 commits"
|
||||||
|
echo -e " ${COLOR_DARK_RED}█${COLOR_RESET} 7–8 commits"
|
||||||
|
echo -e " ${COLOR_DEEP_RED}█${COLOR_RESET} 9–10 commits"
|
||||||
|
echo -e " ${COLOR_DARKEST_RED}█${COLOR_RESET} 11+ commits"
|
||||||
|
echo -e " ${COLOR_GRAY}.${COLOR_RESET} = no commits"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# HELPER AND MENU FUNCTIONS
|
# HELPER AND MENU FUNCTIONS
|
||||||
|
|
||||||
@@ -256,6 +369,12 @@ LIST OPTIONS
|
|||||||
-Z, --commits-by-author-by-timezone
|
-Z, --commits-by-author-by-timezone
|
||||||
displays a list of commits per timezone by author
|
displays a list of commits per timezone by author
|
||||||
|
|
||||||
|
CALENDAR OPTIONS
|
||||||
|
-k, --commits-calendar-by-author
|
||||||
|
shows a calendar heatmap of commits per day-of-week per month for a given author
|
||||||
|
-H, --commits-heatmap
|
||||||
|
shows a heatmap of commits per day-of-week per month for the last 30 days
|
||||||
|
|
||||||
SUGGEST OPTIONS
|
SUGGEST OPTIONS
|
||||||
-r, --suggest-reviewers
|
-r, --suggest-reviewers
|
||||||
show the best people to contact to review code
|
show the best people to contact to review code
|
||||||
@@ -283,7 +402,9 @@ ADDITIONAL USAGE
|
|||||||
You can set _GIT_IGNORE_AUTHORS to filter out specific authors
|
You can set _GIT_IGNORE_AUTHORS to filter out specific authors
|
||||||
ex: export _GIT_IGNORE_AUTHORS=\"(author1|author2)\"
|
ex: export _GIT_IGNORE_AUTHORS=\"(author1|author2)\"
|
||||||
You can sort contribution stats by field \"name\", \"commits\", \"insertions\", \"deletions\", or \"lines\" - total lines changed and order - \"asc\", \"desc\"
|
You can sort contribution stats by field \"name\", \"commits\", \"insertions\", \"deletions\", or \"lines\" - total lines changed and order - \"asc\", \"desc\"
|
||||||
ex: export _GIT_SORT_BY=\"name-asc\""
|
ex: export _GIT_SORT_BY=\"name-asc\"
|
||||||
|
You can set _GIT_DAYS to set the number of days for the heatmap
|
||||||
|
ex: export _GIT_DAYS=30"
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -293,12 +414,6 @@ ADDITIONAL USAGE
|
|||||||
################################################################################
|
################################################################################
|
||||||
function showMenu() {
|
function showMenu() {
|
||||||
# These are "global" and can be overriden from users if so desired
|
# These are "global" and can be overriden from users if so desired
|
||||||
NORMAL=$(tput sgr0)
|
|
||||||
CYAN=$(tput setaf 6)
|
|
||||||
BOLD=$(tput bold)
|
|
||||||
RED=$(tput setaf 1)
|
|
||||||
YELLOW=$(tput setaf 3)
|
|
||||||
WHITE=$(tput setaf 7)
|
|
||||||
TITLES=""
|
TITLES=""
|
||||||
TEXT=""
|
TEXT=""
|
||||||
NUMS=""
|
NUMS=""
|
||||||
@@ -308,29 +423,29 @@ function showMenu() {
|
|||||||
# Adjustable color menu option
|
# Adjustable color menu option
|
||||||
case "${_theme}" in
|
case "${_theme}" in
|
||||||
"legacy" )
|
"legacy" )
|
||||||
TITLES="${BOLD}${RED}"
|
TITLES="${COLOR_BOLD}${COLOR_RED}"
|
||||||
TEXT="${NORMAL}${CYAN}"
|
TEXT="${COLOR_NORMAL}${COLOR_CYANL}"
|
||||||
NUMS="${BOLD}${YELLOW}"
|
NUMS="${COLOR_BOLD}${COLOR_YELLOW}"
|
||||||
HELP_TXT="${NORMAL}${YELLOW}"
|
HELP_TXT="${COLOR_NORMAL}${COLOR_YELLOW}"
|
||||||
EXIT_TXT="${BOLD}${RED}"
|
EXIT_TXT="${COLOR_BOLD}${COLOR_RED}"
|
||||||
;;
|
;;
|
||||||
"none" )
|
"none" )
|
||||||
TITLES="${BOLD}"
|
TITLES="${COLOR_BOLD}"
|
||||||
TEXT="${NORMAL}"
|
TEXT="${COLOR_NORMAL}"
|
||||||
NUMS="${BOLD}"
|
NUMS="${COLOR_BOLD}"
|
||||||
HELP_TXT="${NORMAL}"
|
HELP_TXT="${COLOR_NORMAL}"
|
||||||
EXIT_TXT="${BOLD}"
|
EXIT_TXT="${COLOR_BOLD}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
TITLES="${BOLD}${CYAN}"
|
TITLES="${COLOR_BOLD}${COLOR_CYANL}"
|
||||||
TEXT="${NORMAL}${WHITE}"
|
TEXT="${COLOR_NORMAL}${COLOR_WHITE}"
|
||||||
NUMS="${NORMAL}${BOLD}${WHITE}"
|
NUMS="${COLOR_NORMAL}${COLOR_BOLD}${COLOR_WHITE}"
|
||||||
HELP_TXT="${NORMAL}${CYAN}"
|
HELP_TXT="${COLOR_NORMAL}${COLOR_CYANL}"
|
||||||
EXIT_TXT="${BOLD}${CYAN}"
|
EXIT_TXT="${COLOR_BOLD}${COLOR_CYANL}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
printf %b "\\n${TITLES} Generate:${NORMAL}\\n"
|
printf %b "\\n${TITLES} Generate:${COLOR_NORMAL}\\n"
|
||||||
printf %b "${NUMS} 1)${TEXT} Contribution stats (by author)\\n"
|
printf %b "${NUMS} 1)${TEXT} Contribution stats (by author)\\n"
|
||||||
printf %b "${NUMS} 2)${TEXT} Contribution stats (by author) on a specific branch\\n"
|
printf %b "${NUMS} 2)${TEXT} Contribution stats (by author) on a specific branch\\n"
|
||||||
printf %b "${NUMS} 3)${TEXT} Git changelogs (last $_limit days)\\n"
|
printf %b "${NUMS} 3)${TEXT} Git changelogs (last $_limit days)\\n"
|
||||||
@@ -357,8 +472,9 @@ function showMenu() {
|
|||||||
printf %b "${NUMS} 22)${TEXT} Code reviewers (based on git history)\\n"
|
printf %b "${NUMS} 22)${TEXT} Code reviewers (based on git history)\\n"
|
||||||
printf %b "\\n${TITLES} Calendar:\\n"
|
printf %b "\\n${TITLES} Calendar:\\n"
|
||||||
printf %b "${NUMS} 23)${TEXT} Activity calendar by author\\n"
|
printf %b "${NUMS} 23)${TEXT} Activity calendar by author\\n"
|
||||||
|
printf %b "${NUMS} 24)${TEXT} Activity heatmap for the last $_commit_days days\\n"
|
||||||
printf %b "\\n${HELP_TXT}Please enter a menu option or ${EXIT_TXT}press Enter to exit.\\n"
|
printf %b "\\n${HELP_TXT}Please enter a menu option or ${EXIT_TXT}press Enter to exit.\\n"
|
||||||
printf %b "${TEXT}> ${NORMAL}"
|
printf %b "${TEXT}> ${COLOR_NORMAL}"
|
||||||
read -r opt
|
read -r opt
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1275,13 +1391,14 @@ if [[ "$#" -eq 1 ]]; then
|
|||||||
read -r -p "Which author? " author
|
read -r -p "Which author? " author
|
||||||
done
|
done
|
||||||
commitsByTimezone "${author}";;
|
commitsByTimezone "${author}";;
|
||||||
# ACTIVITY OPTIONS
|
# CALENDAR OPTIONS
|
||||||
-k|--commits-calendar-by-author)
|
-k|--commits-calendar-by-author)
|
||||||
author="${_GIT_AUTHOR:-}"
|
author="${_GIT_AUTHOR:-}"
|
||||||
while [[ -z "${author}" ]]; do
|
while [[ -z "${author}" ]]; do
|
||||||
read -r -p "Which author? " author
|
read -r -p "Which author? " author
|
||||||
done
|
done
|
||||||
commitsCalendarByAuthor "${author}";;
|
commitsCalendarByAuthor "${author}";;
|
||||||
|
-H|--commits-heatmap) commitsHeatmap;;
|
||||||
# SUGGEST OPTIONS
|
# SUGGEST OPTIONS
|
||||||
-r|--suggest-reviewers) suggestReviewers;;
|
-r|--suggest-reviewers) suggestReviewers;;
|
||||||
-h|-\?|--help) usage;;
|
-h|-\?|--help) usage;;
|
||||||
@@ -1374,6 +1491,7 @@ if [[ "$#" -eq 0 ]]; then
|
|||||||
read -r -p "Which author? " author
|
read -r -p "Which author? " author
|
||||||
done
|
done
|
||||||
commitsCalendarByAuthor "${author}"; showMenu;;
|
commitsCalendarByAuthor "${author}"; showMenu;;
|
||||||
|
24) commitsHeatmap; showMenu;;
|
||||||
q|"\n") exit;;
|
q|"\n") exit;;
|
||||||
*) clear; optionPicked "Pick an option from the menu"; showMenu;;
|
*) clear; optionPicked "Pick an option from the menu"; showMenu;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -1,213 +1,206 @@
|
|||||||
.TH git-quick-stats "1" "June 2025" "git-quick-stats" "User Commands"
|
.TH git-quick-stats "1" "June 2025" "git-quick-stats" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.B git\-quick\-stats
|
.B git\-quick\-stats
|
||||||
\- Simple and efficient way to access various stats in a git repository.
|
\- Simple and efficient way to access various stats in a git repository.
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.PP
|
.PP
|
||||||
For non\-interactive mode:
|
For non\-interactive mode:
|
||||||
.B git\-quick\-stats [OPTIONS]
|
.B git\-quick\-stats [OPTIONS]
|
||||||
.PP
|
.PP
|
||||||
For interactive mode:
|
For interactive mode:
|
||||||
.B git-quick-stats
|
.B git-quick-stats
|
||||||
.PP
|
.PP
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.PP
|
.PP
|
||||||
Any git repository contains tons of information about commits, contributors,
|
Any git repository contains tons of information about commits, contributors,
|
||||||
and files. Extracting this information is not always trivial, mostly because
|
and files. Extracting this information is not always trivial, mostly because
|
||||||
of a gadzillion options to a gadzillion git commands.
|
of a gadzillion options to a gadzillion git commands.
|
||||||
This program allows you to see detailed information about a git repository.
|
This program allows you to see detailed information about a git repository.
|
||||||
.PP
|
.PP
|
||||||
.SH GENERATE OPTIONS
|
.SH GENERATE OPTIONS
|
||||||
.PP
|
.PP
|
||||||
\fB\-T\fR, \fB\-\-detailed\-git\-stats\fR
|
\fB\-h\fR, \-?, \fB\-\-help\fR
|
||||||
.IP
|
.IP
|
||||||
give a detailed list of git stats
|
display this help text in the terminal
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-T\fR, \fB\-\-detailed\-git\-stats\fR
|
||||||
\fB\-R\fR, \fB\-\-git\-stats\-by\-branch\fR
|
.IP
|
||||||
.IP
|
give a detailed list of git stats
|
||||||
see detailed list of git stats by branch
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-R\fR, \fB\-\-git\-stats\-by\-branch\fR
|
||||||
\fB\-c\fR, \fB\-\-changelogs\fR
|
.IP
|
||||||
.IP
|
see detailed list of git stats by branch
|
||||||
see changelogs
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-c\fR, \fB\-\-changelogs\fR
|
||||||
\fB\-L\fR, \fB\-\-changelogs\-by\-author\fR
|
.IP
|
||||||
.IP
|
see changelogs
|
||||||
see changelogs by author
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-L\fR, \fB\-\-changelogs\-by\-author\fR
|
||||||
\fB\-S\fR, \fB\-\-my\-daily\-stats\fR
|
.IP
|
||||||
.IP
|
see changelogs by author
|
||||||
see your current daily stats
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-S\fR, \fB\-\-my\-daily\-stats\fR
|
||||||
\fB\-V\fR, \fB\-\-csv\-output\-by\-branch\fR
|
.IP
|
||||||
.IP
|
see your current daily stats
|
||||||
output daily stats by branch in CSV format
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-V\fR, \fB\-\-csv\-output\-by\-branch\fR
|
||||||
\fB\-j\fR, \fB\-\-json\-output\fR
|
.IP
|
||||||
.IP
|
output daily stats by branch in CSV format
|
||||||
save git log as a JSON formatted file to a specified area
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.SH LIST OPTIONS
|
\fB\-j\fR, \fB\-\-json\-output\fR
|
||||||
.PP
|
.IP
|
||||||
\fB\-b\fR, \fB\-\-branch\-tree\fR
|
save git log as a JSON formatted file to a specified area
|
||||||
.IP
|
.HP
|
||||||
show an ASCII graph of the git repo branch history
|
.SH LIST OPTIONS
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-b\fR, \fB\-\-branch\-tree\fR
|
||||||
\fB\-D\fR, \fB\-\-branches\-by\-date\fR
|
.IP
|
||||||
.IP
|
show an ASCII graph of the git repo branch history
|
||||||
show branches by date
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-D\fR, \fB\-\-branches\-by\-date\fR
|
||||||
\fB\-C\fR, \fB\-\-contributors\fR
|
.IP
|
||||||
.IP
|
show branches by date
|
||||||
see a list of everyone who contributed to the repo
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-C\fR, \fB\-\-contributors\fR
|
||||||
\fB\-n\fR, \fB\-\-new\-contributors\fR
|
.IP
|
||||||
.IP
|
see a list of everyone who contributed to the repo
|
||||||
list everyone who made their first contribution since a specified date
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-n\fR, \fB\-\-new\-contributors\fR
|
||||||
\fB\-a\fR, \fB\-\-commits\-per\-author\fR
|
.IP
|
||||||
.IP
|
list everyone who made their first contribution since a specified date
|
||||||
displays a list of commits per author
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-a\fR, \fB\-\-commits\-per\-author\fR
|
||||||
\fB\-d\fR, \fB\-\-commits\-per\-day\fR
|
.IP
|
||||||
.IP
|
displays a list of commits per author
|
||||||
displays a list of commits per day
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-d\fR, \fB\-\-commits\-per\-day\fR
|
||||||
\fB\-m\fR, \fB\-\-commits\-by\-month\fR
|
.IP
|
||||||
.IP
|
displays a list of commits per day
|
||||||
displays a list of commits per month
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-m\fR, \fB\-\-commits\-by\-month\fR
|
||||||
\fB\-Y\fR, \fB\-\-commits\-by\-year\fR
|
.IP
|
||||||
.IP
|
displays a list of commits per month
|
||||||
displays a list of commits per year
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-Y\fR, \fB\-\-commits\-by\-year\fR
|
||||||
\fB\-w\fR, \fB\-\-commits\-by\-weekday\fR
|
.IP
|
||||||
.IP
|
displays a list of commits per year
|
||||||
displays a list of commits per weekday
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-w\fR, \fB\-\-commits\-by\-weekday\fR
|
||||||
\fB\-W\fR, \fB\-\-commits\-by\-author\-by\-weekday\fR
|
.IP
|
||||||
.IP
|
displays a list of commits per weekday
|
||||||
displays a list of commits per weekday by author
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-W\fR, \fB\-\-commits\-by\-author\-by\-weekday\fR
|
||||||
\fB\-o\fR, \fB\-\-commits\-by\-hour\fR
|
.IP
|
||||||
.IP
|
displays a list of commits per weekday by author
|
||||||
displays a list of commits per hour
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-o\fR, \fB\-\-commits\-by\-hour\fR
|
||||||
\fB\-A\fR, \fB\-\-commits\-by\-author\-by\-hour\fR
|
.IP
|
||||||
.IP
|
displays a list of commits per hour
|
||||||
displays a list of commits per hour by author
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-A\fR, \fB\-\-commits\-by\-author\-by\-hour\fR
|
||||||
\fB\-z\fR, \fB\-\-commits\-by\-timezone\fR
|
.IP
|
||||||
.IP
|
displays a list of commits per hour by author
|
||||||
displays a list of commits per timezone
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-z\fR, \fB\-\-commits\-by\-timezone\fR
|
||||||
\fB\-Z\fR, \fB\-\-commits\-by\-author\-by\-timezone\fR
|
.IP
|
||||||
.IP
|
displays a list of commits per timezone
|
||||||
displays a list of commits per timezone by author
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-Z\fR, \fB\-\-commits\-by\-author\-by\-timezone\fR
|
||||||
\fB\-\-activity\-calendar\fR
|
.IP
|
||||||
.IP
|
displays a list of commits per timezone by author
|
||||||
displays a calendar-style grid of commit activity per day-of-week and month for a selected author.
|
.HP
|
||||||
.HP
|
.PP
|
||||||
.SH SUGGEST OPTIONS
|
\fB\-\-activity\-calendar\fR
|
||||||
.PP
|
.IP
|
||||||
\fB\-r\fR, \fB\-\-suggest\-reviewers\fR
|
displays a calendar-style grid of commit activity per day-of-week and month for a selected author.
|
||||||
.IP
|
.HP
|
||||||
show the best people to contact to review code
|
.SH SUGGEST OPTIONS
|
||||||
.HP
|
.PP
|
||||||
.PP
|
\fB\-r\fR, \fB\-\-suggest\-reviewers\fR
|
||||||
\fB\-h\fR, \-?, \fB\-\-help\fR
|
.IP
|
||||||
.IP
|
show the best people to contact to review code
|
||||||
display this help text in the terminal
|
.HP
|
||||||
.PP
|
.PP
|
||||||
.SH ADDITIONAL USAGE
|
.SH CALENDAR OPTIONS
|
||||||
You can set _GIT_SINCE and _GIT_UNTIL to limit the git time log, example:
|
.PP
|
||||||
.PP
|
\fB\-k\fR, \fB\-\-commits\-calendar\-by\-author\fR outputs a visual grid of commit activity for a selected author, grouped by day-of-week (rows: Mon..Sun) and month (columns: Jan..Dec). Each cell is 3 characters wide, separated by one space.
|
||||||
.B export _GIT_SINCE="2017\-01\-20"
|
.PP
|
||||||
.PP
|
.PP
|
||||||
You can set _GIT_LIMIT for limited output log, example:
|
\fB\-H\fR, \fB\-\-commits\-heatmap\fR shows a heatmap of commits per day per hour for the last 30 days
|
||||||
.PP
|
.PP
|
||||||
.B export _GIT_LIMIT=20
|
.SH ADDITIONAL USAGE
|
||||||
.PP
|
You can set _GIT_SINCE and _GIT_UNTIL to limit the git time log, example:
|
||||||
You can set _GIT_LOG_OPTIONS for git log options, example:
|
.PP
|
||||||
.PP
|
.B export _GIT_SINCE="2017\-01\-20"
|
||||||
.B export _GIT_LOG_OPTIONS="--ignore-all-space --ignore-blank-lines"
|
.PP
|
||||||
.PP
|
You can set _GIT_LIMIT for limited output log, example:
|
||||||
You can exclude directories or files from the stats by using pathspec, example:
|
.PP
|
||||||
.PP
|
.B export _GIT_LIMIT=20
|
||||||
.B export _GIT_PATHSPEC=':!pattern'
|
.PP
|
||||||
.PP
|
You can set _GIT_LOG_OPTIONS for git log options, example:
|
||||||
You can set _GIT_MERGE_VIEW to show merge commits with normal commits, example:
|
.PP
|
||||||
.PP
|
.B export _GIT_LOG_OPTIONS="--ignore-all-space --ignore-blank-lines"
|
||||||
.B export _GIT_MERGE_VIEW="enable"
|
.PP
|
||||||
.PP
|
You can exclude directories or files from the stats by using pathspec, example:
|
||||||
You can also set _GIT_MERGE_VIEW to only show merge commits, example:
|
.PP
|
||||||
.PP
|
.B export _GIT_PATHSPEC=':!pattern'
|
||||||
.B export _GIT_MERGE_VIEW="exclusive"
|
.PP
|
||||||
.PP
|
You can set _GIT_MERGE_VIEW to show merge commits with normal commits, example:
|
||||||
You can sort contribution stats by field "name", "commits", "insertions", "deletions", or "lines" (total lines changed) and order ("asc", "desc"). e.g.: "commits-desc"
|
.PP
|
||||||
.PP
|
.B export _GIT_MERGE_VIEW="enable"
|
||||||
.B export _GIT_SORT_BY="name-asc"
|
.PP
|
||||||
.PP
|
You can also set _GIT_MERGE_VIEW to only show merge commits, example:
|
||||||
You can change to the legacy color scheme by toggling the variable "_MENU_THEME" between "default" and "legacy". You can completely disable the color theme by setting the "_MENU_THEME" variable to "none", example:
|
.PP
|
||||||
.PP
|
.B export _GIT_MERGE_VIEW="exclusive"
|
||||||
.B export _MENU_THEME=legacy
|
.PP
|
||||||
.PP
|
You can sort contribution stats by field "name", "commits", "insertions", "deletions", or "lines" (total lines changed) and order ("asc", "desc"). e.g.: "commits-desc"
|
||||||
or
|
.PP
|
||||||
.B export _MENU_THEME=none
|
.B export _GIT_SORT_BY="name-asc"
|
||||||
.PP
|
.PP
|
||||||
You can set _GIT_BRANCH to set the branch of the stats, example:
|
You can change to the legacy color scheme by toggling the variable "_MENU_THEME" between "default" and "legacy". You can completely disable the color theme by setting the "_MENU_THEME" variable to "none", example:
|
||||||
.PP
|
.PP
|
||||||
.B export _GIT_BRANCH="master"
|
.B export _MENU_THEME=legacy
|
||||||
.PP
|
.PP
|
||||||
.SH Calendar activity output
|
or
|
||||||
.PP
|
.B export _MENU_THEME=none
|
||||||
\fBactivity-calendar\fR outputs a visual grid of commit activity for a selected author, grouped by day-of-week (rows: Mon..Sun) and month (columns: Jan..Dec). Each cell is 3 characters wide, separated by one space.
|
.PP
|
||||||
.PP
|
You can set _GIT_BRANCH to set the branch of the stats, example:
|
||||||
Sample output:
|
.PP
|
||||||
.PP
|
.B export _GIT_BRANCH="master"
|
||||||
.nf
|
.PP
|
||||||
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
|
You can set _GIT_IGNORE_AUTHORS to filter out specific authors, example:
|
||||||
Mon ▓▓▓ ░░░ ▒▒▒ ░░░ ░░░ ▒▒▒ ▓▓▓ ░░░ ░░░ ▓▓▓ ▒▒▒ ▒▒▒
|
.PP
|
||||||
Tue ▒▒▒ ░░░ ▒▒▒ ░░░ ▒▒▒ ░░░ ▒▒▒ ▓▓▓ ▒▒▒ ░░░ ░░░ ░░░
|
.B export _GIT_IGNORE_AUTHORS="(author@examle.com|username)"
|
||||||
Wed ░░░ ▓▓▓ ░░░ ▓▓▓ ▒▒▒ ░░░ ░░░ ▒▒▒ ░░░ ░░░ ▓▓▓ ░░░
|
.PP
|
||||||
Thu ░░░ ▒▒▒ ░░░ ░░░ ▒▒▒ ░░░ ▓▓▓ ▒▒▒ ▒▒▒ ░░░ ░░░ ▒▒▒
|
You can set _GIT_DAYS to set the number of days for the heatmap, example:
|
||||||
Fri ▒▒▒ ░░░ ▒▒▒ ▓▓▓ ░░░ ▓▓▓ ▒▒▒ ░░░ ▒▒▒ ░░░ ▒▒▒ ░░░
|
.PP
|
||||||
Sat ░░░ ░░░ ▒▒▒ ░░░ ░░░ ░░░ ▒▒▒ ░░░ ▒▒▒ ▓▓▓ ▒▒▒ ░░░
|
.B export _GIT_DAYS=30"
|
||||||
Sun ▓▓▓ ░░░ ▓▓▓ ░░░ ░░░ ▓▓▓ ░░░ ▒▒▒ ░░░ ░░░ ▓▓▓ ░░░
|
.
|
||||||
|
.fi
|
||||||
Legend: ... = 0 ░░░ = 1–2 ▒▒▒ = 3–5 ▓▓▓ = 6+ commits
|
|
||||||
.PP
|
.PP
|
||||||
You can set _GIT_IGNORE_AUTHORS to filter out specific authors, example:
|
.SH SEE ALSO
|
||||||
.PP
|
.BR git (1)
|
||||||
.B export _GIT_IGNORE_AUTHORS="(author@examle.com|username)"
|
.PP
|
||||||
.
|
Project homepage:
|
||||||
.fi
|
.UR https://github.com/git-quick-stats/git-quick-stats
|
||||||
|
|
||||||
.PP
|
|
||||||
.SH SEE ALSO
|
|
||||||
.BR git (1)
|
|
||||||
.PP
|
|
||||||
Project homepage:
|
|
||||||
.UR https://github.com/git-quick-stats/git-quick-stats
|
|
||||||
.UE
|
.UE
|
||||||
@@ -73,6 +73,12 @@ LIST OPTIONS
|
|||||||
-Z, --commits-by-author-by-timezone
|
-Z, --commits-by-author-by-timezone
|
||||||
displays a list of commits per timezone by author
|
displays a list of commits per timezone by author
|
||||||
|
|
||||||
|
CALENDAR OPTIONS
|
||||||
|
-k, --commits-calendar-by-author
|
||||||
|
shows a calendar heatmap of commits per day-of-week per month for a given author
|
||||||
|
-H, --commits-heatmap
|
||||||
|
shows a heatmap of commits per day-of-week per month for the last 30 days
|
||||||
|
|
||||||
SUGGEST OPTIONS
|
SUGGEST OPTIONS
|
||||||
-r, --suggest-reviewers
|
-r, --suggest-reviewers
|
||||||
show the best people to contact to review code
|
show the best people to contact to review code
|
||||||
@@ -100,7 +106,9 @@ ADDITIONAL USAGE
|
|||||||
You can set _GIT_IGNORE_AUTHORS to filter out specific authors
|
You can set _GIT_IGNORE_AUTHORS to filter out specific authors
|
||||||
ex: export _GIT_IGNORE_AUTHORS=\"(author1|author2)\"
|
ex: export _GIT_IGNORE_AUTHORS=\"(author1|author2)\"
|
||||||
You can sort contribution stats by field \"name\", \"commits\", \"insertions\", \"deletions\", or \"lines\" - total lines changed and order - \"asc\", \"desc\"
|
You can sort contribution stats by field \"name\", \"commits\", \"insertions\", \"deletions\", or \"lines\" - total lines changed and order - \"asc\", \"desc\"
|
||||||
ex: export _GIT_SORT_BY=\"name-asc\""
|
ex: export _GIT_SORT_BY=\"name-asc\"
|
||||||
|
You can set _GIT_DAYS to set the number of days for the heatmap
|
||||||
|
ex: export _GIT_DAYS=30"
|
||||||
|
|
||||||
assert_raises "$src fail" 1
|
assert_raises "$src fail" 1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user