Crates.io | git-statistics |
lib.rs | git-statistics |
version | 0.1.0 |
source | src |
created_at | 2023-10-19 16:14:09.762658 |
updated_at | 2023-10-19 16:14:09.762658 |
description | Collect commits from Git repository and present statistics in a comfortable way. |
homepage | |
repository | https://github.com/hyzmm/git-statistics.git |
max_upload_size | |
id | 1007954 |
size | 361,274 |
Collect commits from Git repository and present statistics in a comfortable way.
Commits statistics for each user, including the following dimensions of information.
The statistical results will exclude merges and will not include modifications that have been marked as renames or moves. You can specify a PATHSPEC
to perform more precise matching on top of this.
Clone the repository:
git clone https://github.com/hyzmm/git-statistics
cd git-statistics
Install CLI:
cargo install --path .
If you want to experience the UI version of the application, you can run the following command:
cargo tauri dev
Or make an application installer, run the following command to build it:
cd app/
npm i
npm run build
cargo tauri build
On macOS, the generated installation package is located in target/release/bundle/dmg.
Type git stats -h
to see the full help message:
git stats -h
This tool provides comprehensive statistics for each user in the current repository.
Usage: git-stats [OPTIONS] [-- <PATHSPEC>...]
Arguments:
[PATHSPEC]... A glob pattern to match against file paths. src, *.rs, or src/**/*.rs etc
Options:
-s, --sort <SORT> Sort by the specified column. The default is unordered [possible values: commits, files-changed, insertions, deletions, lines-changed]
-c, --max-count <MAX_COUNT> Limit the number of ros to show
-h, --help Print help (see more with '--help')
-V, --version Print version
Here is an example of statistics in the bevy repository, go to the repository directory and run it:
$ git stats -c 5 -s commits
██████████████████████████████████████████████████████████████████████ 2820/2820
┌──────────────┬─────────┬─────────┬──────────────┬──────────────┬─────────────┐
│ Author ┆ Commits ┆ Files ┆ Insertions ┆ Deletions ┆ Lines │
│ ┆ ┆ Changed ┆ ┆ ┆ Changed │
╞══════════════╪═════════╪═════════╪══════════════╪══════════════╪═════════════╡
│ Carter ┆ 1059 ┆ 16247 ┆ 723427 ┆ 682678 ┆ 1406105 │
│ Anderson ┆ (72%) ┆ (89%) ┆ (94%) ┆ (98%) ┆ (96%) │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ François ┆ 214 ┆ 995 ┆ 17871 ┆ 7333 ┆ 25204 │
│ ┆ (15%) ┆ (5%) ┆ (2%) ┆ (1%) ┆ (2%) │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ Robert Swain ┆ 76 ┆ 421 ┆ 18941 ┆ 3401 ┆ 22342 │
│ ┆ (5%) ┆ (2%) ┆ (2%) ┆ (0%) ┆ (2%) │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ Jakob ┆ 62 ┆ 250 ┆ 4825 ┆ 1516 ┆ 6341 │
│ Hellermann ┆ (4%) ┆ (1%) ┆ (1%) ┆ (0%) ┆ (0%) │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ Daniel McNab ┆ 57 ┆ 248 ┆ 2508 ┆ 2711 ┆ 5219 │
│ ┆ (4%) ┆ (1%) ┆ (0%) ┆ (0%) ┆ (0%) │
└──────────────┴─────────┴─────────┴──────────────┴──────────────┴─────────────┘
This means printing the top 5 authors with the highest number of commits.
The CLI has the following arguments:
Argument | Description |
---|---|
sort |
The sorting method for users, which is unordered by default. It can be sorted by 5 dimensions: commits, files-changed, insertions, deletions, lines-changed. |
max-count |
Limit the number of ros to show. |
PATHSPEC |
A glob pattern to match against file paths. src , *.rs , or src/**/*.rs etc. Prefix with :! to exclude the specified paths, for example: git stats -- ':!src/assets' to exclude all files in src/assets . |
Here is an example that only counts all files in the src directory, and rs files in the crates directory.
git stats -s commits -c 5 -- src crates/**/*.rs
git stats -s commits -c 5 -- src crates ':!crates/bevy_core'
The format of the exclusion path is the same as that of the matching path, but paths prefixed with :!
will be excluded from the statistical results.
Here are some screenshots of the app: