bahmutov / pre-git

Automatically install pre-commit / pre-push hooks in your git repo
168 stars 22 forks source link

Commit fails with error: #19

Open geoidesic opened 10 years ago

geoidesic commented 10 years ago

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree commit -q -F /var/folders/hp/0cj2csyn2fj6gmlw_t3skynr0000gn/T/SourceTreeTemp.wiV3x9 executing task "grunt"

pre-commit: You've failed to pass all the hooks. pre-commit: pre-commit: The "grunt" script failed. pre-commit: pre-commit: You can skip the git pre-commit hook by running: pre-commit: pre-commit: git commit -n (--no-verify) pre-commit: pre-commit: But this is not adviced as your tests are obviously failing.

Completed with errors, see above

bahmutov commented 10 years ago

hi, any more details on this bug? does grunt by itself run fine?

geoidesic commented 10 years ago

Hi. Yes, grunt runs fine on it's own from the command line.

I think what I'm trying to do may be impossible though. I was hoping to get grunt to run uglify on js files that were committed but thinking about it it's probably not possible to automatically add the uglified files to the commit using a pre-commit hook?

bahmutov commented 10 years ago

yeah, I think git pre-commit hook can modify files, but the git will add only files that were staged BEFORE the hook starts.