Last active
February 17, 2016 19:20
-
-
Save bradneuman/bbcb6558d01873ea6842 to your computer and use it in GitHub Desktop.
A git hook to automatically populate submodule summary information
This file contains 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
#!/bin/sh | |
# prepare-commit-msg hook that puts the relevant `submodule summary` info in the commit log for you | |
# automaticially. Put it in .git/hooks/prepare-commit-msg (and make sure it is executable) | |
TEMP=`mktemp /tmp/commit.XXXX` | |
echo "\n\n" > $TEMP | |
# remove the * at the beginning of the line so github doesn't think we are making a list | |
git submodule summary --cached | sed 's/^* //' | cat - $1 >> $TEMP && mv $TEMP $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment