#commit #git-commit #github #hook #git

yanked commit-checker

A Git pre-commit hook tool that ensures daily commit requirements

0.1.0 Jan 26, 2025

#215 in #commit

Download history 99/week @ 2025-01-26 12/week @ 2025-02-02

111 downloads per month

MIT license

18KB
156 lines

Commit Checker

A Git pre-commit hook tool that ensures you maintain a minimum number of commits per day, with support for backdated commits. Perfect for maintaining consistent GitHub activity.

Features

  • 📅 Track daily commit requirements from a specified start date
  • 🔧 Configurable minimum commits per day
  • 🪝 Pre-commit hook integration
  • ⏰ Generates correct backdated commit commands
  • 🏠 Global configuration in user's home directory

Installation

  1. Clone the repository:
git clone https://github.com/KekmaTime/commit-checker.git
cd commit-checker
  1. Install the binary:
cargo install --path .

Configuration

Create a config file at ~/.config/commit-checker/.env with:

GITHUB_TOKEN=your_github_token
GITHUB_USERNAME=your_github_username
START_DATE=from_what_day_you_nonstop_green_in_your_github_graph
REQUIRED_COMMITS=how_many_commits_you_need_to_make_per_day

Note: Your GitHub token needs repository access permissions.

Usage

  1. Install the pre-commit hook in your repository:
commit-checker install
  1. Check your commit status:
commit-checker
  1. If you have missing commits, the tool will show you the exact commands to use for backdated commits.

How it Works

The tool:

  1. Checks GitHub events for your commits using the GitHub API
  2. Ensures minimum daily commits from START_DATE
  3. Blocks regular commits if requirements aren't met
  4. Provides exact commands for backdated commits with correct timestamps

Security

  • GitHub token is stored securely in your home directory
  • Only modifies local git commits
  • No automatic pushing to remote repositories
  • See SECURITY.md for more details

Contributing

Please read:

License

MIT License - See LICENSE file

Dependencies

~12–23MB
~336K SLoC