• Stars
    star
    385
  • Rank 111,464 (Top 3 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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 -sSfL https://cdn.rawgit.com/pimterry/git-confirm/v0.2.2/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 9ee7ff55f7688f9055a9056bd2617a02 for v0.2.2) 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)

More Repositories

1

loglevel

πŸ“’ Minimal lightweight logging for JavaScript, adding reliable log level methods to wrap any available console.log methods
JavaScript
2,472
star
2

notes

πŸ“ Simple delightful note taking, with more unix and less lock-in.
Shell
1,268
star
3

server-components

πŸ”§ A simple, lightweight tool for composable HTML rendering in Node.js, based on web components.
JavaScript
216
star
4

lambda-git

A git binary installed through NPM, for use with AWS Lambda
Shell
78
star
5

rpi-pxe-server

A ready-to-go PXE + TFTP network boot server for Raspberry Pi, with Resin deployment
Shell
76
star
6

grunt-coveralls

β˜” Grunt task to load coverage results and submit them to Coveralls.io
JavaScript
48
star
7

raspivid-stream

Raspberry pi cam video, as a stream you can send straight to web clients
JavaScript
38
star
8

typesafe-get

A typesafe way to get nested properties when any parent properties might be undefined, while we wait for the optional chaining operator to finally exist
TypeScript
34
star
9

leaflet-map-server-component

A server component for server-rendering leaflet maps
JavaScript
33
star
10

pi-cam

A pure-JS Raspberry Pi webcam
JavaScript
20
star
11

photo-frame

πŸ“Ί Facebook photo frame, for the Raspberry Pi 3 (with Resin.io)
JavaScript
18
star
12

rpi-backlight

A node library to control the backlight of the official Raspberry Pi 7" touch display
JavaScript
8
star
13

Web-components-and-microservices-are-the-same-thing

HTML
7
star
14

tim.fyi

JavaScript
5
star
15

dropbox-ignore

Automatically ignore file & folders from Dropbox by pattern
Shell
4
star
16

dev-bot

πŸ€– A framework for building chat-bot-based developer tooling
TypeScript
4
star
17

server-components-express

πŸ”§ β˜• Express integration plugin for Server Components
JavaScript
4
star
18

docker-selenium-chrome-ftp

Docker image providing Selenium+Chrome+anon FTP
3
star
19

node-tls-crash

JavaScript
3
star
20

knockout-dependency-graph

Knockout plugin to track your KO observable's dependencies, and the updates triggered from them, for later analysis
JavaScript
3
star
21

js-test-runner

A extremely simple command-line tool for running JavaScript test suites
JavaScript
3
star
22

How-to-build-a-database

A hands-on live coding session, building a database from scratch in Python
Python
3
star
23

chai-fetch

Chai matchers to make matching fetch responses clear & easy
TypeScript
3
star
24

Your-Build-Smells

Talk on common automated build smells, and fixes
HTML
2
star
25

Cloud-Everything

Running everything on the cloud, for fun and profit (CI, Quality checkers, PaaS, IaaS)
JavaScript
2
star
26

docker-node-karma

Simplest dumbest possible Node (official image) + xvfb + chrome. Built to run builds including Karma on Wercker, but should work for anything.
Shell
2
star
27

pointsarenttime.com

Headline site to quickly explain to people that story points != estimates of time
HTML
2
star
28

Intro-to-open-source

A quick talk introducing open-source to new developers
JavaScript
2
star
29

rtm-to-todoist

Quick hacky script to port your tasks from RTM to Todoist
JavaScript
2
star
30

docker-node-karma-selenium

Simplest dumbest possible Node (official image) + xvfb + chrome + Selenium. Built to run builds needing Karma & Selenium on Wercker, but should work for anything.
Shell
2
star
31

qtile-config

My QTile Config (mostly vim/gnome-y, written for a Samsung NP940X3G-K01UK)
Python
2
star
32

Building-resilient-infrastructure-with-CouchDB

JavaScript
2
star
33

instagram-to-journey

Quick script to pull all posts from Instagram and transform them to import to Journey
JavaScript
2
star
34

intro-to-typescript

Introductory talk about TypeScript for JS developers
HTML
2
star
35

server-components-static

πŸ”§ πŸŽ† Static content management plugin for Server Components
JavaScript
2
star
36

hackference-karaoke

JavaScript
2
star
37

TetheringStatusMonitor

Simple app to ping notifications up when tethering, so I know when the internet's gone
Java
1
star
38

What-the-hell-are-web-components

Introduction to web components
JavaScript
1
star
39

metawear-accelerometer

Java
1
star
40

chai-style

A webdriver-driven style and layout assertion library for Chai
JavaScript
1
star
41

github-org-feed-page

Static site for your org's gh-pages, that shows off a feed of great things your team have been doing on github recently
JavaScript
1
star
42

national-hack-the-government-2014

JavaScript
1
star
43

What-not-to-do-with-databases

JavaScript
1
star
44

Rust-101

Intro to Rust talk
Ruby
1
star
45

is-it-christmas-yet

HTML
1
star
46

balloons

Java
1
star
47

metawear-repl

A quick & simple Node.js REPL for Metawear devices
JavaScript
1
star
48

concomitant

Java concurrent code testing framework
Java
1
star
49

metawear-fun

1
star
50

pydancemat

Python
1
star
51

module-structure-graph

A tool to generate graphs of the structure of a Node module
1
star
52

dev-bot-tool

🎭 CLI tool for DevBot: a framework for building chat-bot-based developer tooling
TypeScript
1
star
53

And-now-for-something-completely-different

Lightning talk on a wide variety of programming languages
JavaScript
1
star
54

arduino-demos

A selection of simple Arduino + Johnny Five demos
JavaScript
1
star
55

personal-site-feed

Feed of all my activity across Github/Twitter/Stack Overflow/Blogs/etc for http://tim-perry.co.uk
Python
1
star
56

Your-Web-Stack-Would-Betray-You-In-An-Instant

Presentation strolling through a typical modern web stack to talk about recent security issues at each level
HTML
1
star
57

typed-promisify-all

A TypeScript type-safe promisifyAll implementation
TypeScript
1
star
58

phonegap-build-plugin-test

1
star
59

multistage-demos

Demos for my Docker Barcelona talk on Docker, IoT and multi-stage builds
Rust
1
star
60

busmearound

Super-simple local bus times webapp
Python
1
star
61

React-Todo-Demo

Building a PoC todo list demo in React
JavaScript
1
star
62

slide-clicker

A tiny node script to turn a Metawear C into a viable slide clicker
JavaScript
1
star
63

heroku-sinatra-project-template

Template for a project (actually the base for pimterry/Comparably) running on Heroku with Sinatra. Includes working vagrant + rake + travis configs.
Ruby
1
star