wert007 / commit-analyzer

Gets the time somebody worked on something from `git log`
MIT License
1 stars 1 forks source link

Commit Analyzer

Summary

Gets the time somebody worked on something from git log.

  1. Description
  2. Configured Options and Subcommands
    1. Options
      1. --author-contains, -a
      2. --author-equals
      3. --commit-contains, -c
      4. --commit-equals
      5. --duration, -d
      6. --email-contains, -e
      7. --email-equals
      8. --file-extension, -f
      9. --help, -h
      10. --message-starts-with, -l
      11. --message-contains, -m
      12. --message-equals
      13. --output, -o
      14. --verbose, -v
      15. --version, -V
    2. Subcommands
      1. git-history
      2. help
      3. log-file
      4. stdin
  3. Installation and Updation

Description

This is a simple tool which grabs the output of git log --numstat and analyzes how much time somebody worked on the project.

For instance, simply call one of the following lines to see all commits that fit the criteria and how much time was spend creating them.

commit-analyzer --git --author-equals wert007
commit-analyzer --input git.log --author-equals wert007

You can also give commit-analyzer an output file such that it will generate a CSV with the date, the number of commits made on the respective days and the LOC changes due to them.

commit-analyzer --git --output commits-and-loc-by-date.csv
commit-analyzer --input git.log --output commits-and-loc-by-date.csv

Configured Options and Subcommands

Options

--author-contains, -a

Filters for certain author names. ORs if specified multiple times.

--author-equals

Filters for certain author names. ORs if specified multiple times.

--commit-contains, -c

Filters for certain commit hashes. ORs if specified multiple times.

--commit-equals

Filters for certain commit hashes. ORs if specified multiple times.

--duration, -d

The time which may pass between two commits that still counts as working [default: 3].

--email-contains, -e

Filters for certain author emails. ORs if specified multiple times.

--email-equals

Filters for certain author emails. ORs if specified multiple times.

--file-extension, -f

Filters the LOC diff for a certain file extension (e.g. --file-extension cpp). ORs if specified multiple times.

--help, -h

Print help information.

--message-starts-with, -l

Filters for certain commit messages. ORs if specified multiple times.

--message-contains, -m

Filters for certain commit messages. ORs if specified multiple times.

--message-equals

Filters for certain commit messages. ORs if specified multiple times.

--output, -o

An output file for the commits per day in CSV format.

--verbose, -v

Always shows the entire output.

--version, -V

Print version information.

Subcommands

git-history

Reads the input from the local Git history.

help

Print a general help message or the help of the given subcommand(s).

log-file

Reads the specified input file.

stdin

Reads from stdin.

Installation and Updating

Installation is very easy with Cargo. Just execute the following line in a terminal:

cargo install --git https://github.com/wert007/commit-analyzer

This command will install a release compilation of the latest version locally to your user account. The same command also works for regular updates, this is, new commits have had been introduced since the last installation.