kazazor / git-pre-commit

A pre-commit hook that ignores all the unstagged changes while performing the pre-commit command you wrote (Using Shell, Gulp, Grunt etc..)
https://www.npmjs.com/package/git-pre-commit
MIT License
18 stars 5 forks source link

git commit --amend with no changes fails because there is nothing to stash #18

Closed kazazor closed 8 years ago

kazazor commented 8 years ago
> git commit --amend
[16:42:02] Using gulpfile ~/Developments/Autodesk/Galileo-Web/Gulpfile.js
[16:42:02] Starting 'lint'...
[16:42:02] Starting 'js:lint'...
[16:42:02] Starting 'js:lint:find-files'...
[16:42:02] Finished 'js:lint:find-files' after 37 ms
[16:42:02] Starting 'js:lint:count-files'...
[16:42:02] Finished 'js:lint:count-files' after 5.61 ms
[16:42:02] Starting 'js:lint:run'...
[16:42:02] Finished 'js:lint:run' after 66 ms
[16:42:02] Finished 'js:lint' after 111 ms
[16:42:02] Finished 'lint' after 112 ms
[16:42:02] Starting 'pre-commit'...
[16:42:02] Finished 'pre-commit' after 10 μs
No stash found.
[16:42:02] Warning! Trying to print an undefined message

We're doing this when we want to edit the commit message. Current workaround:

git commit --amend --no-verify