P

Paul Ching

git-commit-analytics: analyze git commit records to generate daily work reports

P
Paul Ching2022/1/2 16:00:00
Star on GitHub

A tool to analyze your git repository's commit log. It can help you generate daily/weekly or longer work reports.

git-commit-analytics
git-commit-analytics

🚀 Download

This is a client tool, so you need to download the program to use it. See: The Latest Release to download.

Note:

  • As the latest version uses a new packaging tool, Windows device testing is currently missing. If you cannot run it, please download the v1.4.1 version of the product
  • The latest version fixes the problem that macOS cannot run the build product, but if you still encounter problems, you can choose to clone the code of this repository and use it through pnpm i and pnpm dev.

⚡ Usage

Create and fill in your configuration file, and then run the program to get your work report.

📂 Configuration File

You need to create a config.json at the same folder with the program, and write the content in the following format.

{
  "lang": "en",
  "authors": ["chengpeiquan"],
  "dateRange": ["2021-12-01", "2022-01-31"],
  "repos": ["D:\\Git\\git-commit-analytics"],
  "format": {
    "git-commit-analytics": "Git Commit Analytics"
  },
  "includes": ["feat", "fix", "docs", "style", "refactor", "test", "chore"],
  "excludes": ["typo", "backup", "progress"]
}

The configuration items are described as follows:

keytypedescription
langstringSet program default language, support en (English) and zh (Simplified Chinese).
authorsstring[]Filter the author name of commits, support multiple author names, for you may have different names in different repos.
dateRange[string, string]Fill in [start date, end date], support the legal time format, and count from the start date 00:00:00 to the end date 23:59:59(If not configured, the default day to run the program).
reposstring[]The Git repo folder on your computer, need to be switched to the branch you want to count.你电脑里的 Git 仓库文件夹,需要提前切换到你要统计的分支。
format{ [key: string]: string }Format your folder name as the project name.
includesstring[]The commit message prefix to be included in the statistics.
excludesstring[]In the statistical results, exclude commit messages that contain these keywords.

Among them, authors / includes / excludes will be created as regular expressions to match data.

📚 Report File

The report file will be generated in markdown syntax (probably the most common format for developer?) and saved as a file in .txt format (probably the most compatible format?).

The project name will be classified as the second-level title, and 7 types of commit prefixes will be classified as the third-level title:

typedescription
featFeatures
fixBug Fixes
docsDocumentation
styleOptimized Style
refactorRefactored
testTest Cases
choreChores

You can click Commit message and Change log writing guide to learn how to standardize the git commit.

📝 Release Notes

Please refer to CHANGELOG for details.