Compare commits

..

No commits in common. "master" and "2.4.0" have entirely different histories.

12 changed files with 807 additions and 1775 deletions

5
.github/FUNDING.yml vendored
View file

@ -1 +1,6 @@
# These are supported funding model platforms # These are supported funding model platforms
github: [arzzen]
open_collective: git-quick-stats
ko_fi: lukasmestan
custom: ['https://lukasmestan.com/thanks/']

3
.gitignore vendored
View file

@ -8,6 +8,3 @@
.Trash* .Trash*
**/*~ **/*~
nbproject/* nbproject/*
/tests/test-git/.git/
#/tests/test-git/*
!/tests/test-git/resetgit

View file

@ -1,3 +1,3 @@
Lukas <test@gmail.com> Lukáš <arzzen@users.noreply.github.com> Lukas Mestan <lukas.mestan@gmail.com> Lukáš Mešťan <arzzen@users.noreply.github.com>
Lukas <lukas@gmail.com> arzzen Lukas Mestan <lukas.mestan@gmail.com> arzzen

View file

@ -1,25 +0,0 @@
cff-version: 1.2.0
title: Git Quick Stats
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- name-particle: tomice
- name-particle: arzzen
identifiers:
- type: url
value: "https://github.com/git-quick-stats"
description: >-
Simple and efficient way to access various statistics
in a git repository
repository-code: "https://github.com/git-quick-stats/git-quick-stats"
url: "https://git-quick-stats.sh/"
abstract: >-
Git-quick-stats is a simple and efficient way to access
various statistics in a git repository.
keywords:
- git
- stats
license: MIT
version: 2.6.2

View file

@ -4,7 +4,7 @@ FROM alpine
COPY . /app COPY . /app
# Install required packages & build git-quick-stats # Install required packages & build git-quick-stats
RUN apk add --no-cache bash git make ncurses coreutils util-linux \ RUN apk add --no-cache bash git make ncurses util-linux \
&& cd /app \ && cd /app \
&& make install \ && make install \
&& rm -rf /app \ && rm -rf /app \
@ -23,6 +23,5 @@ ENV _GIT_SINCE= \
TERM=xterm-256color TERM=xterm-256color
WORKDIR /git WORKDIR /git
RUN git config --global --add safe.directory /git
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint" ] ENTRYPOINT [ "/usr/local/bin/docker-entrypoint" ]
CMD [ "/usr/bin/git", "quick-stats" ] CMD [ "/usr/bin/git", "quick-stats" ]

View file

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

View file

@ -30,8 +30,8 @@ uninstall:
@$(TASK_DONE) @$(TASK_DONE)
reinstall: reinstall:
@curl -sO https://raw.githubusercontent.com/git-quick-stats/git-quick-stats/master/git-quick-stats @curl -sO https://raw.githubusercontent.com/arzzen/git-quick-stats/master/git-quick-stats
@curl -sO https://raw.githubusercontent.com/git-quick-stats/git-quick-stats/master/git-quick-stats.1 @curl -sO https://raw.githubusercontent.com/arzzen/git-quick-stats/master/git-quick-stats.1
$(MAKE) install $(MAKE) install
@$(TASK_DONE) @$(TASK_DONE)

206
README.md
View file

@ -1,12 +1,12 @@
# GIT quick statistics [![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)
[![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/git-quick-stats.svg)](https://formulae.brew.sh/formula/git-quick-stats#default) # 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. > `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 dont think there is a single person alive who knows them all. Probably not even [Linus Torvalds](https://github.com/torvalds) himself :).
![mainMenuScreenshot](https://user-images.githubusercontent.com/8818630/154823670-f42a111b-45f4-47fc-aea7-80059827c8e6.png)
![mainImageScreenshot](https://github.com/user-attachments/assets/7d8637a4-5a67-49f6-8724-ca7548b987c6)
## Table of Contents ## Table of Contents
@ -14,34 +14,34 @@
[**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)
@ -49,16 +49,14 @@
[**Contributors**](#contributors) [**Contributors**](#contributors)
- [**Backers**](#backers) * [**Backers**](#backers)
- [**Sponsors**](#sponsors) * [**Sponsors**](#sponsors)
## Screenshots ## Screenshots
![commitsByWeekdayScreenshot](https://github.com/user-attachments/assets/3496d245-6385-47d1-878a-726e79100eb1) ![commitsByWeekdayScreenshot](https://user-images.githubusercontent.com/8818630/154823677-e34ca867-ae61-4755-bf89-c877f809c591.png)
![commitsByHourScreenshot](https://github.com/user-attachments/assets/9f1d69d9-46e0-411d-a5ed-905ffdfb887a) ![commitsByHourScreenshot](https://user-images.githubusercontent.com/8818630/154823679-bdadc26c-c644-4a01-b625-85e330f85d41.png)
![commitActivityScreenshot](https://github.com/user-attachments/assets/693fff31-65c7-4b9f-a011-6114a2d10a26)
## Usage ## Usage
@ -118,22 +116,16 @@ LIST OPTIONS
show branches by date show branches by date
-C, --contributors -C, --contributors
see a list of everyone who contributed to the repo see a list of everyone who contributed to the repo
-n, --new-contributors
list everyone who made their first contribution since a specified date
-N, --new-contributors-since-tag
list everyone who made their first contribution since a specified git tag
-a, --commits-per-author -a, --commits-per-author
displays a list of commits per author displays a list of commits per author
-d, --commits-per-day -d, --commits-per-day
displays a list of commits per day displays a list of commits per day
-m, --commits-by-month
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
displays a list of commits per month
-w, --commits-by-weekday -w, --commits-by-weekday
displays a list of commits per weekday displays a list of commits per weekday
-W, --commits-by-author-by-weekday
displays a list of commits per weekday by author
-o, --commits-by-hour -o, --commits-by-hour
displays a list of commits per hour displays a list of commits per hour
-A, --commits-by-author-by-hour -A, --commits-by-author-by-hour
@ -143,12 +135,6 @@ 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
@ -169,20 +155,12 @@ Once set, run `git quick-stats` as normal. Note that this affects all stats that
### Git log limit ### 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`. You can set variable `_GIT_LIMIT` for limited output. It will affect the "changelogs" and "branch tree" options.
```bash ```bash
export _GIT_LIMIT=20 export _GIT_LIMIT=20
``` ```
### Git tag
You can set `_GIT_TAG` to define the default tag used by the "new contributors since tag" option.
```bash
export _GIT_TAG="foo"
```
### Git log options ### Git log options
You can set `_GIT_LOG_OPTIONS` for [git log options](https://git-scm.com/docs/git-log#_options): You can set `_GIT_LOG_OPTIONS` for [git log options](https://git-scm.com/docs/git-log#_options):
@ -222,42 +200,15 @@ You can set the variable `_GIT_BRANCH` to set the branch of the stats. Works wit
export _GIT_BRANCH="master" export _GIT_BRANCH="master"
``` ```
### Ignore authors
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
export _GIT_IGNORE_AUTHORS="(author@examle.com|username)"
```
### Sorting contribution stats
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
export _GIT_SORT_BY="name-asc"
```
### Commit days
You can set \_GIT_DAYS to set the number of days for the heatmap
```bash
export _GIT_DAYS=30
```
### Color themes ### Color themes
You can change to the legacy color scheme by toggling the variable `_MENU_THEME` between `default` and `legacy`. 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`.
```bash ```bash
export _MENU_THEME="legacy" export _MENU_THEME="legacy"
# or
export _MENU_THEME="none"
``` ```
![legacyThemeScreenshot](https://github.com/user-attachments/assets/3b319c1a-827f-47b8-bbfa-b8b59a39deef) ![legacyThemeScreenshot](https://user-images.githubusercontent.com/8818630/154823711-3dd0c268-f3cb-42e5-9094-0eb8e45d1761.png)
## Installation ## Installation
@ -272,7 +223,7 @@ apt install git-quick-stats
### UNIX and Linux ### UNIX and Linux
```bash ```bash
git clone https://github.com/git-quick-stats/git-quick-stats.git && cd git-quick-stats git clone https://github.com/arzzen/git-quick-stats.git && cd git-quick-stats
sudo make install sudo make install
``` ```
@ -290,45 +241,18 @@ sudo make reinstall
### macOS (homebrew) ### macOS (homebrew)
`git-quick-stats` requires GNU `date`. On macOS, install GNU coreutils:
```bash
brew install coreutils
export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"
```
The script auto-detects GNU date as either `date` or `gdate`, so exporting
`gnubin` is optional for this project.
From there, you can install via Homebrew as follows:
```bash ```bash
brew install git-quick-stats brew install git-quick-stats
``` ```
Or you can follow the UNIX and Linux instructions if you wish. Or you can follow the UNIX and Linux instructions if you wish.
If you would like to default to using GNU coreutils system-wide, add
`export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"` to your
applicable `~/.bash_profile`, `~/.zprofile`, or other relevant profile based
on the shell of your choice.
### FreeBSD
`git-quick-stats` requires GNU `date`. On FreeBSD, install GNU coreutils:
```bash
pkg install coreutils
```
FreeBSD provides GNU date as `gdate`, and the script auto-detects it.
### Windows ### Windows
If you are installing with Cygwin, use these scripts: If you are installing with Cygwin, use these scripts:
- [installer](https://gist.github.com/arzzen/35e09866dfdadf2108b2420045739245) * [installer](https://gist.github.com/arzzen/35e09866dfdadf2108b2420045739245)
- [uninstaller](https://gist.github.com/arzzen/21c660014d0663b6c5710014714779d6) * [uninstaller](https://gist.github.com/arzzen/21c660014d0663b6c5710014714779d6)
If you are wishing to use this with WSL, follow the UNIX and Linux instructions. If you are wishing to use this with WSL, follow the UNIX and Linux instructions.
@ -336,22 +260,20 @@ If you are wishing to use this with WSL, follow the UNIX and Linux instructions.
You can use the Docker image provided: You can use the Docker image provided:
- Build: `docker build -t arzzen/git-quick-stats .` * Build: `docker build -t arzzen/git-quick-stats .`
- Run interactive menu: `docker run --rm -it -v $(pwd):/git arzzen/git-quick-stats` * Run interactive menu: `docker run --rm -it -v $(pwd):/git arzzen/git-quick-stats`
- Docker pull command: `docker pull arzzen/git-quick-stats` [docker repository](https://hub.docker.com/r/arzzen/git-quick-stats) * Docker pull command: `docker pull arzzen/git-quick-stats` [docker repository](https://hub.docker.com/r/arzzen/git-quick-stats)
## System requirements ## System requirements
- An OS with a Bash shell * An OS with a Bash shell
- GNU `date` available as either `date` or `gdate` * Tools we use:
- Tools we use:
```bash ```bash
awk awk
basename basename
cat cat
column column
date
echo echo
git git
grep grep
@ -366,21 +288,17 @@ uniq
### Dependencies ### Dependencies
- [`bsdextrautils`](https://packages.debian.org/sid/bsdextrautils) `apt install bsdextrautils` * [`bsdmainutils`](https://packages.debian.org/sid/bsdmainutils) `apt install bsdmainutils`
- [`coreutils`](https://packages.debian.org/sid/coreutils) `apt install coreutils`
- [`gawk`](https://packages.debian.org/sid/gawk) `apt install gawk`
- [`grep`](https://packages.debian.org/sid/grep) `apt install grep`
- [`ncurses-bin`](https://packages.debian.org/sid/ncurses-bin) `apt install ncurses-bin`
## FAQ ## FAQ
_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` *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. *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.
_Q:_ How they could be used in a project with many git projects and statistics would show a summary of all git projects? *Q:* How they could be used in a project with many git projects and statistics would show a summary of all git projects?
_A:_ If you want to include submodule logs, you can try using the following: `export _GIT_LOG_OPTIONS="-p --submodule=log"` *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)) (more info about [git log --submodule](https://git-scm.com/docs/git-log#Documentation/git-log.txt---submoduleltformatgt))
## Contribution ## Contribution
@ -394,13 +312,13 @@ We use GitHub pull requests for this purpose.
### Some tips for good pull requests ### Some tips for good pull requests
- Use our code </br> * Use our code </br>
When in doubt, try to stay true to the existing code of the project. When in doubt, try to stay true to the existing code of the project.
- Write a descriptive commit message. What problem are you solving and what * Write a descriptive commit message. What problem are you solving and what
are the consequences? Where and what did you test? Some good tips: are the consequences? Where and what did you test? Some good tips:
[here](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message) [here](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message)
and [here](https://www.kernel.org/doc/Documentation/SubmittingPatches). and [here](https://www.kernel.org/doc/Documentation/SubmittingPatches).
- If your PR consists of multiple commits which are successive improvements / * If your PR consists of multiple commits which are successive improvements /
fixes to your first commit, consider squashing them into a single commit fixes to your first commit, consider squashing them into a single commit
(`git rebase -i`) such that your PR is a single commit on top of the current (`git rebase -i`) such that your PR is a single commit on top of the current
HEAD. This make reviewing the code so much easier, and our history more HEAD. This make reviewing the code so much easier, and our history more
@ -422,12 +340,36 @@ make test
MIT see [LICENSE][] for the full license text. MIT see [LICENSE][] for the full license text.
[read this page]: http://github.com/git-quick-stats/git-quick-stats/blob/master/.github/CONTRIBUTING.md [read this page]: http://github.com/arzzen/git-quick-stats/blob/master/.github/CONTRIBUTING.md
[landing page]: https://git-quick-stats.sh [landing page]: http://arzzen.github.io/git-quick-stats
[LICENSE]: https://github.com/git-quick-stats/git-quick-stats/blob/master/LICENSE [LICENSE]: https://github.com/arzzen/git-quick-stats/blob/master/LICENSE
## Contributors ## Contributors
This project exists thanks to all the people who contribute. This project exists thanks to all the people who contribute.
[![contributors](https://opencollective.com/git-quick-stats/contributors.svg?width=890&button=false)](https://github.com/git-quick-stats/git-quick-stats/graphs/contributors) [![contributors](https://opencollective.com/git-quick-stats/contributors.svg?width=890&button=false)](https://github.com/arzzen/git-quick-stats/graphs/contributors)
### Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/git-quick-stats#backer)]
[![backers](https://opencollective.com/git-quick-stats/backers.svg?width=890)](https://opencollective.com/git-quick-stats#backers)
### Sponsors
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)]
[![sponsor0](https://opencollective.com/git-quick-stats/sponsor/0/avatar.svg?v=1)](https://opencollective.com/git-quick-stats/sponsor/0/website)
[![sponsor1](https://opencollective.com/git-quick-stats/sponsor/1/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/1/website)
[![sponsor2](https://opencollective.com/git-quick-stats/sponsor/2/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/2/website)
[![sponsor3](https://opencollective.com/git-quick-stats/sponsor/3/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/3/website)
[![sponsor4](https://opencollective.com/git-quick-stats/sponsor/4/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/4/website)
[![sponsor5](https://opencollective.com/git-quick-stats/sponsor/5/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/5/website)
[![sponsor6](https://opencollective.com/git-quick-stats/sponsor/6/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/6/website)
[![sponsor7](https://opencollective.com/git-quick-stats/sponsor/7/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/7/website)
[![sponsor8](https://opencollective.com/git-quick-stats/sponsor/8/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/8/website)
[![sponsor9](https://opencollective.com/git-quick-stats/sponsor/9/avatar.svg)](https://opencollective.com/git-quick-stats/sponsor/9/website)
[![61999966](https://user-images.githubusercontent.com/6382002/130024560-65bb49a6-c7e9-48f9-8427-a29d8ff2a3db.png)](https://quaestor.com/?utm_source=github&utm_category=sponsor)

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
.TH git-quick-stats "1" "June 2025" "git-quick-stats" "User Commands" .TH git-quick-stats "1" "June 2021" "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.
@ -17,30 +17,8 @@ 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 PLATFORM NOTES
.PP
git-quick-stats requires GNU date support for date parsing options.
.PP
On macOS, install GNU coreutils with:
.PP
.B brew install coreutils
.PP
On FreeBSD, install GNU coreutils with:
.PP
.B pkg install coreutils
.PP
GNU date may be available as either
.B date
or
.B gdate
and git-quick-stats auto-detects both.
.PP
.SH GENERATE OPTIONS .SH GENERATE OPTIONS
.PP .PP
\fB\-h\fR, \-?, \fB\-\-help\fR
.IP
display this help text in the terminal
.PP
\fB\-T\fR, \fB\-\-detailed\-git\-stats\fR \fB\-T\fR, \fB\-\-detailed\-git\-stats\fR
.IP .IP
give a detailed list of git stats give a detailed list of git stats
@ -92,16 +70,6 @@ show branches by date
see a list of everyone who contributed to the repo see a list of everyone who contributed to the repo
.HP .HP
.PP .PP
\fB\-n\fR, \fB\-\-new\-contributors\fR
.IP
list everyone who made their first contribution since a specified date
.HP
.PP
\fB\-N\fR, \fB\-\-new\-contributors\-since\-tag\fR
.IP
list everyone who made their first contribution since a specified git tag
.HP
.PP
\fB\-a\fR, \fB\-\-commits\-per\-author\fR \fB\-a\fR, \fB\-\-commits\-per\-author\fR
.IP .IP
displays a list of commits per author displays a list of commits per author
@ -127,11 +95,6 @@ displays a list of commits per year
displays a list of commits per weekday displays a list of commits per weekday
.HP .HP
.PP .PP
\fB\-W\fR, \fB\-\-commits\-by\-author\-by\-weekday\fR
.IP
displays a list of commits per weekday by author
.HP
.PP
\fB\-o\fR, \fB\-\-commits\-by\-hour\fR \fB\-o\fR, \fB\-\-commits\-by\-hour\fR
.IP .IP
displays a list of commits per hour displays a list of commits per hour
@ -151,11 +114,6 @@ displays a list of commits per timezone
.IP .IP
displays a list of commits per timezone by author displays a list of commits per timezone by author
.HP .HP
.PP
\fB\-\-activity\-calendar\fR
.IP
displays a calendar-style grid of commit activity per day-of-week and month for a selected author.
.HP
.SH SUGGEST OPTIONS .SH SUGGEST OPTIONS
.PP .PP
\fB\-r\fR, \fB\-\-suggest\-reviewers\fR \fB\-r\fR, \fB\-\-suggest\-reviewers\fR
@ -163,12 +121,9 @@ displays a calendar-style grid of commit activity per day-of-week and month for
show the best people to contact to review code show the best people to contact to review code
.HP .HP
.PP .PP
.SH CALENDAR OPTIONS \fB\-h\fR, \-?, \fB\-\-help\fR
.PP .IP
\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. display this help text in the terminal
.PP
.PP
\fB\-H\fR, \fB\-\-commits\-heatmap\fR shows a heatmap of commits per day per hour for the last 30 days
.PP .PP
.SH ADDITIONAL USAGE .SH ADDITIONAL USAGE
You can set _GIT_SINCE and _GIT_UNTIL to limit the git time log, example: You can set _GIT_SINCE and _GIT_UNTIL to limit the git time log, example:
@ -179,10 +134,6 @@ You can set _GIT_LIMIT for limited output log, example:
.PP .PP
.B export _GIT_LIMIT=20 .B export _GIT_LIMIT=20
.PP .PP
You can set _GIT_TAG to define the default tag used by the "new contributors since tag" option, example:
.PP
.B export _GIT_TAG="foo"
.PP
You can set _GIT_LOG_OPTIONS for git log options, example: You can set _GIT_LOG_OPTIONS for git log options, example:
.PP .PP
.B export _GIT_LOG_OPTIONS="--ignore-all-space --ignore-blank-lines" .B export _GIT_LOG_OPTIONS="--ignore-all-space --ignore-blank-lines"
@ -199,35 +150,12 @@ You can also set _GIT_MERGE_VIEW to only show merge commits, example:
.PP .PP
.B export _GIT_MERGE_VIEW="exclusive" .B export _GIT_MERGE_VIEW="exclusive"
.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" You can switch to the legacy color scheme, example:
.PP
.B export _GIT_SORT_BY="name-asc"
.PP
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 _MENU_THEME=legacy .B export _MENU_THEME=legacy
.PP .PP
or
.B export _MENU_THEME=none
.PP
You can set _GIT_BRANCH to set the branch of the stats, example: You can set _GIT_BRANCH to set the branch of the stats, example:
.PP .PP
.B export _GIT_BRANCH="master" .B export _GIT_BRANCH="master"
.PP
You can set _GIT_IGNORE_AUTHORS to filter out specific authors, example:
.PP
.B export _GIT_IGNORE_AUTHORS="(author@examle.com|username)"
.PP
You can set _GIT_DAYS to set the number of days for the heatmap, example:
.PP
.B export _GIT_DAYS=30"
. .
.fi .fi
.PP
.SH SEE ALSO
.BR git (1)
.PP
Project homepage:
.UR https://github.com/git-quick-stats/git-quick-stats
.UE

View file

@ -1,17 +1,9 @@
#!/bin/bash #!/bin/bash
# Verify we are in a git repo. Create one if not
# FIXME: All the paths are hardcoded currently and will break if anything
# in this chain moves or gets executed elsewhere. Adjust all of these so
# pathing does not matter as much such as creating a TOP variable that
# does something like TOP=$(cd "$(dirname "$0")" || exit ; pwd -P)
# or maybe leverages Make to handle these as test targets
./tests/test-git/resetgit
. tests/assert.sh -v . tests/assert.sh -v
src="./git-quick-stats" src="./git-quick-stats"
assert "$src fail" "Invalid argument: fail assert "$src fail" "Invalid argument
NAME NAME
git-quick-stats - Simple and efficient way to access various stats in a git repo git-quick-stats - Simple and efficient way to access various stats in a git repo
@ -50,10 +42,6 @@ LIST OPTIONS
show branches by date show branches by date
-C, --contributors -C, --contributors
see a list of everyone who contributed to the repo see a list of everyone who contributed to the repo
-n, --new-contributors
list everyone who made their first contribution since a specified date
-N, --new-contributors-since-tag
list everyone who made their first contribution since a specified tag
-a, --commits-per-author -a, --commits-per-author
displays a list of commits per author displays a list of commits per author
-d, --commits-per-day -d, --commits-per-day
@ -64,8 +52,6 @@ LIST OPTIONS
displays a list of commits per year displays a list of commits per year
-w, --commits-by-weekday -w, --commits-by-weekday
displays a list of commits per weekday displays a list of commits per weekday
-W, --commits-by-author-by-weekday
displays a list of commits per weekday by author
-o, --commits-by-hour -o, --commits-by-hour
displays a list of commits per hour displays a list of commits per hour
-A, --commits-by-author-by-hour -A, --commits-by-author-by-hour
@ -75,12 +61,6 @@ 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,34 +80,22 @@ ADDITIONAL USAGE
ex: export _GIT_MERGE_VIEW=enable ex: export _GIT_MERGE_VIEW=enable
You can also set _GIT_MERGE_VIEW to only show merge commits You can also set _GIT_MERGE_VIEW to only show merge commits
ex: export _GIT_MERGE_VIEW=exclusive ex: export _GIT_MERGE_VIEW=exclusive
You can change to the legacy color scheme by toggling the variable \"_MENU_THEME\" between \"default\" and \"legacy\". You can set _MENU_THEME to display the legacy color scheme
You can completely disable the color theme by setting the \"_MENU_THEME\" variable to \"none\".
ex: export _MENU_THEME=legacy ex: export _MENU_THEME=legacy
You can set _GIT_BRANCH to set the branch of the stats You can set _GIT_BRANCH to set the branch of the stats
ex: export _GIT_BRANCH=master ex: export _GIT_BRANCH=master"
You can set _GIT_IGNORE_AUTHORS to filter out specific authors
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\"
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
assert_contains "$src --suggest-reviewers" "Suggested code reviewers (based on git history)" assert_contains "$src --suggest-reviewers" "Suggested code reviewers (based on git history)"
assert_success "$src --suggest-reviewers" assert_success "$src --suggest-reviewers"
assert_contains "$src --detailed-git-stats" "Contribution stats (by author) on the current branch" assert_contains "$src --detailed-git-stats" "Contribution stats"
assert_success "$src --detailed-git-stats" assert_success "$src --detailed-git-stats"
assert_contains "$src --commits-per-day" "Git commits per date" assert_contains "$src --commits-per-day" "Git commits per date"
assert_success "$src --commits-per-day" assert_success "$src --commits-per-day"
assert_contains "$src --my-daily-stats" "My daily status"
assert_contains "$src --my-daily-stats" "most changed files today"
assert_contains "$src --my-daily-stats" "most active users today (excluding you)"
assert_success "$src --my-daily-stats"
assert_startswith "$src --commits-by-year" "Git commits by year" assert_startswith "$src --commits-by-year" "Git commits by year"
assert_success "$src --commits-by-year" assert_success "$src --commits-by-year"

View file

@ -1,16 +0,0 @@
#!/bin/sh
# Initialises a new local Git repo for test purpose if one does not exist already
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
{
git init
git config user.name "$(printf %s 'Test Git,\nfor test purpose')"
git config user.email "TestGit\o/@example.org"
printf 'test-git\n========\n' > README.md
git add README.md
git commit -m 'added readme (o\w/o)' -m 'in markdown, no \r\n, only \n' -m 'a very "simple" readme'
testChars="$(printf 'tab [%b] form feed [%b] line feed [%b] carriage return [%b]' '\x09' '\x0C' '\x0A' '\x0D')"
git notes add -m 'Some notes' -m 'out of ascii: été au cœur' -m "$testChars"
git log
} >/dev/null 2>&1
fi