All Projects → tommarshall → Git Good Commit

tommarshall / Git Good Commit

Licence: mit
Git hook to help you write good commit messages, with no external dependencies.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Git Good Commit

Pre Commit Terraform
pre-commit git hooks to take care of Terraform configurations
Stars: ✭ 902 (+604.69%)
Mutual labels:  hooks, git-hooks
rusty-hook
git hook manager, geared toward Rust projects
Stars: ✭ 93 (-27.34%)
Mutual labels:  hooks, git-hooks
husky-elixir
🐶 Git hooks made easy
Stars: ✭ 47 (-63.28%)
Mutual labels:  hooks, git-hooks
Pre Commit Hooks
A set of useful (and documented!) git pre-commit hooks.
Stars: ✭ 95 (-25.78%)
Mutual labels:  hooks, best-practices
Hooks
Async middleware for JavaScript and TypeScript
Stars: ✭ 117 (-8.59%)
Mutual labels:  hooks
Graphql Hooks
🎣 Minimal hooks-first GraphQL client
Stars: ✭ 1,610 (+1157.81%)
Mutual labels:  hooks
Lefthook
Fast and powerful Git hooks manager for any type of projects.
Stars: ✭ 1,848 (+1343.75%)
Mutual labels:  hooks
Use Conditional Effect
React.useEffect, except you can pass a comparison function.
Stars: ✭ 111 (-13.28%)
Mutual labels:  hooks
Autohooks
Library for managing git hooks
Stars: ✭ 126 (-1.56%)
Mutual labels:  hooks
Awesome Couchdb
CouchDB - curated meta resources & best practices list
Stars: ✭ 124 (-3.12%)
Mutual labels:  best-practices
Dbatools
🚀 SQL Server automation and instance migrations have never been safer, faster or freer
Stars: ✭ 1,742 (+1260.94%)
Mutual labels:  best-practices
Powershellpracticeandstyle
The Unofficial PowerShell Best Practices and Style Guide
Stars: ✭ 1,589 (+1141.41%)
Mutual labels:  best-practices
Wshook
Easily intercept and modify WebSocket requests and message events.
Stars: ✭ 121 (-5.47%)
Mutual labels:  hooks
Effective Go
a list of effective go, best practices and go idiomatic
Stars: ✭ 112 (-12.5%)
Mutual labels:  best-practices
Backend Best Practices
An evolving description of general best practices for backend development.
Stars: ✭ 1,736 (+1256.25%)
Mutual labels:  best-practices
Awesome Solidity
A curated list of awesome Solidity resources
Stars: ✭ 111 (-13.28%)
Mutual labels:  best-practices
Hooks
A high-quality & reliable React Hooks library.
Stars: ✭ 7,841 (+6025.78%)
Mutual labels:  hooks
Ajax Hook
🔱 Intercepting browser's AJAX requests which made by XMLHttpRequest.
Stars: ✭ 1,900 (+1384.38%)
Mutual labels:  hooks
Sound
🔊 A Vue composable for playing sound effects
Stars: ✭ 116 (-9.37%)
Mutual labels:  hooks
React Tensorflow
Tensorflow hooks for React.js
Stars: ✭ 115 (-10.16%)
Mutual labels:  hooks

git-good-commit

Build Status

Git hook to help you write good commit messages.

Validates commit messages conform to six of the seven rules of a great git commit message, plus a couple of extras:

  1. Separate subject from body with a blank line
  2. Limit the subject line to 50 characters
  3. Capitalize the subject line
  4. Do not end the subject line with a period
  5. Use the imperative mood in the subject line
  6. Wrap the body at 72 characters
  7. Use the body to explain what and why vs. how - you're on your own with this one
  8. Do no write single worded commits
  9. Do not start the subject line with whitespace

Offers an interactive prompt if any of the rules are detected to be broken.

git-good-commit animated demo

Installation

Single repository

At the root of the repository, run:

curl https://cdn.rawgit.com/tommarshall/git-good-commit/v0.6.1/hook.sh > .git/hooks/commit-msg && chmod +x .git/hooks/commit-msg

Globally

To use the hook globally, you can use git-init's template directory:

mkdir -p ~/.git-template/hooks
git config --global init.templatedir '~/.git-template'
curl https://cdn.rawgit.com/tommarshall/git-good-commit/v0.6.1/hook.sh > ~/.git-template/hooks/commit-msg && chmod +x ~/.git-template/hooks/commit-msg

The hook will now be present after any git init or git clone. You can safely re-run git init on any existing repositories to add the hook there.


If you're security conscious, you may be reasonably suspicious of curling executable files. In this case you're on HTTPS throughout, and not piping directly to execution, so you can check contents and the hash against MD5 12fd3b8829eead2eff9a72598cbc9f4b for v0.6.1.

Usage

echo "apple" > ./bar.txt
git add fruits.txt

# should warn you that the subject line is not capitalised, and offer an interactive prompt.
git commit -m 'add fruits.txt'

Options

e - edit commit message
y - proceed with commit
n - abort commit
? - print help

Configuration

The default colour setting is auto, but the hook will use git's color.ui config setting if defined. You override the colour setting for the hook with:

git config --global hooks.goodcommit.color "never"

Supported values are always, auto, never and false.

Dependencies

None, other than Bash.

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].