All Projects → pimterry → Git Confirm

pimterry / Git Confirm

Licence: mit
❓ Git hook to catch placeholders and temporary changes (TODO / @ignore) before you commit them.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Git Confirm

prepare-commit-msg
Automatically prefix commit messages with the current branch issue number
Stars: ✭ 28 (-92.13%)
Mutual labels:  git-hooks
php-git-hooks
Git hooks for the local repository of the PHP project
Stars: ✭ 20 (-94.38%)
Mutual labels:  git-hooks
modular-git-hooks
A tool for organizing git hooks into directories of modular files.
Stars: ✭ 19 (-94.66%)
Mutual labels:  git-hooks
pre-commit-opa
Pre-commit git hooks for Open Policy Agent (OPA) and Rego development
Stars: ✭ 53 (-85.11%)
Mutual labels:  git-hooks
husky-elixir
🐶 Git hooks made easy
Stars: ✭ 47 (-86.8%)
Mutual labels:  git-hooks
enforce-git-message
Enforces conventional git commit messages for git repositories
Stars: ✭ 30 (-91.57%)
Mutual labels:  git-hooks
pre-commit-hooks-safety
A pre-commit hook to check your Python dependencies against safety-db
Stars: ✭ 69 (-80.62%)
Mutual labels:  git-hooks
Static Review
✋ An extendible framework for version control hooks.
Stars: ✭ 330 (-7.3%)
Mutual labels:  git-hooks
detect-secrets
A developer-friendly secrets detection tool for CI and pre-commit hooks based on Yelp's detect-secrets
Stars: ✭ 43 (-87.92%)
Mutual labels:  git-hooks
git-conventional-commits
Git Conventional Commits Util to generate Semantic Version and Markdown Change Log and Validate Commit Messag
Stars: ✭ 58 (-83.71%)
Mutual labels:  git-hooks
pre-commit-hooks
git pre-commit hooks
Stars: ✭ 71 (-80.06%)
Mutual labels:  git-hooks
modern-office-git-diff
An experiment in tracking and diffing versions of modern Microsoft Office files in Git.
Stars: ✭ 51 (-85.67%)
Mutual labels:  git-hooks
elixir git hooks
🪝 Add git hooks to Elixir projects
Stars: ✭ 98 (-72.47%)
Mutual labels:  git-hooks
captain-git-hook
✅ define git hooks as scripts in your package.json
Stars: ✭ 25 (-92.98%)
Mutual labels:  git-hooks
elint
A easy way to lint your code
Stars: ✭ 38 (-89.33%)
Mutual labels:  git-hooks
precommit-hook
Automatically check your python code on every commit. 🔍 ✔️
Stars: ✭ 16 (-95.51%)
Mutual labels:  git-hooks
rusty-hook
git hook manager, geared toward Rust projects
Stars: ✭ 93 (-73.88%)
Mutual labels:  git-hooks
Grumphp
Submitting bugs and feature requests
Stars: ✭ 3,679 (+933.43%)
Mutual labels:  git-hooks
git-semantics
Git hook to ensure semantic commit messages.
Stars: ✭ 42 (-88.2%)
Mutual labels:  git-hooks
mestral
Simple hook management for Git
Stars: ✭ 55 (-84.55%)
Mutual labels:  git-hooks

git-confirm Travis Build Status

Git hook to catch placeholders and temporary changes (TODO / @ignore) before you commit them.

Asciicast DEMO

Git Confirm:

  • Stops you ever accidentally committing bad temporary changes.
  • Is interactive, checking each match with you so you can't miss it (and can still include it if you like).
  • Only considers lines newly added and about to be committed, so no false positives.
  • Includes (diff-colorized) context with each match
  • Installs in any project with a single command
  • Is configurable to match any number of strings, through standard git config
  • Is well tested. See tests/test-hook.bats.
  • Works on Linux, OSX and Windows (in Powershell at least), with no dependencies.

To Install

In the root of your Git repository, run:

curl https://cdn.rawgit.com/pimterry/git-confirm/v0.2.1/hook.sh > .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit

(Note the version number)

All done. If you want to check it's installed correctly you can run:

echo "TODO" > ./test-git-confirm
git add ./test-git-confirm

# Should prompt you to confirm added 'TODO'. Press 'n' to cancel commit.
git commit -m "Testing git confirm"

If you're security conscious, you may be reasonably suspicious of curling executable files. Here you're on HTTPS throughout though, and you're not piping directly to execution so you can check contents and the hash (against MD5 04baf1f87974681a92ee7fe8c0aa3aaa for v0.2.1) before using this, if you like.

To Configure

By default, git-confirm will catch and warn about lines including 'TODO' only.

If you want to match a different pattern, you can override this default and set your own patterns:

git config --add hooks.confirm.match "TODO"

Matches are passed verbatim to your local grep, and are treated as regular expressions. Note that all matches are case-sensitive.

You can repeatedly add patterns, and each of them will be matched in turn. To get, remove or totally clear your config, use the standard Git Config commands:

git config --get-all hooks.confirm.match
git config --unset hooks.confirm.match 'TODO'
git config --unset-all hooks.confirm.match

Contributing

Want to file a bug? That's great! Please search issues first though to check it hasn't already been filed, and provide as much information as you can (your OS, terminal and Git-Confirm version as a minimum).

Want to help improve Git-Confirm?

  • Check out the project: git clone --recursive https://github.com/pimterry/git-confirm.git

    (Note 'recursive' - this ensures submodules are included)

  • Check the tests pass locally: ./test.sh

  • Add tests for your change in test/test-hook.bats

    Check out the BATS documentation if you're not familiar with it, or just crib from the existing tests.

  • Add any documentation required to this README.

  • Commit and push your changes

  • Open a PR!

Need any ideas? Take a look at the Git Confirm Huboard to quickly see the next features to look at.

Release process

  • Make changes
  • Update Curl version number and hash (md5 ./hook.sh) in README.
  • Commit everything
  • Tag with new version numbers (git tag vX.Y.Z)
  • Push including tags (git push origin --tags)
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].