Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ruin0x11/jikyuu
Estimate the amount of time spent working on a Git repository
https://github.com/ruin0x11/jikyuu
cli git rust statistics
Last synced: 3 months ago
JSON representation
Estimate the amount of time spent working on a Git repository
- Host: GitHub
- URL: https://github.com/ruin0x11/jikyuu
- Owner: Ruin0x11
- License: mit
- Created: 2021-04-25T02:36:20.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-02T11:07:42.000Z (9 months ago)
- Last Synced: 2024-10-15T06:07:24.988Z (3 months ago)
- Topics: cli, git, rust, statistics
- Language: Rust
- Homepage:
- Size: 32.2 KB
- Stars: 25
- Watchers: 2
- Forks: 5
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jikyuu (時給)
A tool to estimate the amount of time spent working on a Git repository.
It is a direct port of [git-hours](https://github.com/kimmobrunfeldt/git-hours), written in Node.js, because the code was many years out of date and no longer builds.
Note that the information provided is only a rough estimate.
## Installation
```sh
cargo install jikyuu
```## Example
``` sh
git clone https://github.com/twbs/bootstrap
cd bootstrap
jikyuu
``````
+----------------+-------------------------+---------+-----------------+
| Author | Email | Commits | Estimated Hours |
| | | | |
| Mark Otto | [email protected] | 2902 | 1808.9833 |
| Mark Otto | [email protected] | 2516 | 1709.4 |
| XhmikosR | [email protected] | 1431 | 1612.4667 |
| Chris Rebert | [email protected] | 945 | 1019.3 |
| Jacob Thornton | [email protected] | 826 | 740.35 |
| Mark Otto | [email protected] | 858 | 663.7167 |
| <...> | | | |
| | | | |
| Total | | 16639 | 15041.153 |
+----------------+-------------------------+---------+-----------------+
```You can associate an author that has used multiple emails in the commit logs with the `--email` (`-e`) option.
``` sh
jikyuu -e [email protected][email protected] \
-e [email protected][email protected] \
-e [email protected][email protected] \
-e [email protected][email protected]```
```
+-----------------+---------------------------+---------+-----------------+
| Author | Email | Commits | Estimated Hours |
| | | | |
| Mark Otto | [email protected] | 6880 | 4662.817 |
| XhmikosR | [email protected] | 1431 | 1612.4667 |
| Chris Rebert | [email protected] | 945 | 1019.3 |
| Jacob Thornton | [email protected] | 826 | 740.35 |
| Martijn Cuppens | [email protected] | 361 | 508.5 |
| <...> | | | |
+-----------------+---------------------------+---------+-----------------+
```Use `--format json` (`-f`) to output the data as a JSON array.
```json5
[
{
"email": "[email protected]",
"author_name": "Mark Otto",
"hours": 4662.817,
"commit_count": 6880
},
{
"email": "[email protected]",
"author_name": "XhmikosR",
"hours": 1612.4667,
"commit_count": 1431
},// ...
{
"email": null,
"author_name": "Total",
"hours": 14826.803,
"commit_count": 16639
}
]
```## Algorithm
See the [How it works](https://github.com/kimmobrunfeldt/git-hours#how-it-works) section of the git-hours README.
## Usage
Run the following command to estimate the time spent for the provided Git repository.
```sh
jikyuu /path/to/git/repo/
```The path must point to the root of the Git repo, not any subdirectories inside of it.
Extended usage:
```
USAGE:
jikyuu [FLAGS] [OPTIONS]FLAGS:
-h, --help Prints help information
-m, --merge-requests Include merge requests into calculation
-V, --version Prints version informationOPTIONS:
-b, --branch Analyze only data on the specified branch
-t, --branch-type
Type of branch that `branch` refers to. `local` means refs/heads/, `remote` means refs/remotes/.-e, --email ...
Associate all commits that have a secondary email with a primary email-a, --first-commit-add
How many minutes first commit of session should add to total [default: 120]-f, --format
[default: stdout] [possible values: Stdout, Json]-d, --max-commit-diff
Maximum difference in minutes between commits counted to one session [default: 120]-s, --since
Analyze data since certain date [default: always]-u, --until
Analyze data until certain date [default: always]ARGS:
Root path of the Git repository to analyze.
```## License
MIT.