curl https://gist.githubusercontent.com/lukeramsden/81e029be19a686261dda4204c8002873/raw/bff6973325b159254a3ba13c5cb9ac8fda8e382b/prepare-commit-msg.sh > ~/.git-hooks/prepare-commit-msg
chmod u+x ~/.git-hooks/prepare-commit-msg
git config --global core.hooksPath ~/.git-hooks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://jsfiddle.net/dandv/47cbj/ | |
function RateLimit(fn, delay, context) { | |
var queue = [], timer = null; | |
function processQueue() { | |
var item = queue.shift(); | |
if (item) | |
fn.apply(item.context, item.arguments); | |
if (queue.length === 0) | |
clearInterval(timer), timer = null; |
Usage:
commit # opens default editor for commit message
commit updated readme.md # commits with message "updated readme.md"
Usage:
push # opens default editor for commit message, then pushes
push updated readme.md # commits with message "updated readme.md", then pushes
NewerOlder