Skip to content

Estimate the amount of time spent working on a Git repository

License

Notifications You must be signed in to change notification settings

Ruin0x11/jikyuu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jikyuu (時給)

A tool to estimate the amount of time spent working on a Git repository.

It is a direct port of 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

cargo install jikyuu

Example

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.

+-----------------+---------------------------+---------+-----------------+
| 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.

[
  {
    "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 section of the git-hours README.

Usage

Run the following command to estimate the time spent for the provided Git repository.

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] <REPO_PATH>

FLAGS:
    -h, --help              Prints help information
    -m, --merge-requests    Include merge requests into calculation
    -V, --version           Prints version information

OPTIONS:
    -b, --branch <branch>                                                Analyze only data on the specified branch
    -t, --branch-type <local|remote>
            Type of branch that `branch` refers to. `local` means refs/heads/, `remote` means refs/remotes/.

    -e, --email <OTHER_EMAIL=MAIN_EMAIL>...
            Associate all commits that have a secondary email with a primary email

    -a, --first-commit-add <MINUTES>
            How many minutes first commit of session should add to total [default: 120]

    -f, --format <format>
             [default: stdout]  [possible values: Stdout, Json]

    -d, --max-commit-diff <MINUTES>
            Maximum difference in minutes between commits counted to one session [default: 120]

    -s, --since <always|today|yesterday|thisweek|lastweek|YYYY-mm-dd>
            Analyze data since certain date [default: always]

    -u, --until <always|today|yesterday|thisweek|lastweek|YYYY-mm-dd>
            Analyze data until certain date [default: always]


ARGS:
    <REPO_PATH>    Root path of the Git repository to analyze.

License

MIT.

About

Estimate the amount of time spent working on a Git repository

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages