Improve speed of commit-msg hook by calculating git-guilt only once
This commit is contained in:
parent
e0038e9420
commit
2e374de893
1 changed files with 2 additions and 5 deletions
|
@ -6,11 +6,8 @@ echo Calculating git guilt... >&2
|
||||||
# create a temporary commit for git-guilt to look at, using git-stash!
|
# create a temporary commit for git-guilt to look at, using git-stash!
|
||||||
git stash save -q
|
git stash save -q
|
||||||
|
|
||||||
# stash@{0}^2 is the index. I know, it's weird. We call git-guilt twice because
|
# stash@{0}^2 is the index. I know, it's weird.
|
||||||
# we want the nice colours when we commit in a terminal, but we don't want them
|
git guilt HEAD stash@{0}^2 | tee -a $1 >&2
|
||||||
# in the actual commit message.
|
|
||||||
git guilt HEAD stash@{0}^2 >&2
|
|
||||||
git guilt HEAD stash@{0}^2 >> $1
|
|
||||||
|
|
||||||
# Now restore the changes from stash, so we can actually commit them. ;)
|
# Now restore the changes from stash, so we can actually commit them. ;)
|
||||||
git stash pop -q --index
|
git stash pop -q --index
|
||||||
|
|
Loading…
Reference in a new issue