You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Git commit takes a really long time on a specific repo #2518
GitHub desktop either takes a really long time (5 minutes or more) to commit, but only on a specific repository. I've now also had it fail for the first time ever since switching to the new desktop app.
Version
GitHub Desktop version: 0.8.0
OS version: Microsoft Windows [Version 10.0.15063]
Steps to Reproduce
make changes to any file in repo
commit using GitHub desktop UI
GitHub desktop takes more than 5 minutes to commit
Expected behavior: commit in the usual timeframe, usually under 10 seconds, even for large commits.
Actual behavior: commit takes 5 minutes or more. Failed on only 1 occasion, Reproduces how often: It's slow 100% of the time with this repo but failed only once.
Logs
Please see attached file for a copy-paste of the error window, to me it looks like it's actually executing the code of the repo, which would be highly dubious.
Also attached the desktop log.
@radumg it looks like the Git pre-commit hook is failing, which blocks the commit from completing. It's hard for me to tell what's in the git commit hook (husky -> NPM -> ???) - could you shed some light on that?
Just tried with CLI and same behaviour, even when changes are un-staged, see the 2 screenshots.
As for the husky pre-commit hook : now that I knew what to look for, I dug around the repo and husky is a node module and it seems it has some git hooks, see screenshot. It's not something I added, must have been part of the original repo.
@radumg pre-commit hooks in Git will fail Git by returning a non-zero exit code. There might be details in the log files around the actual failure (if you didn't scroll the output of the dialog to the bottom at the time).
EDIT: apoloiges - you attached the logs. Let me read them over.
19 passing (59s)
1 failing
1) cli fixtures/seed.json --no-cors=true "before each" hook for "should not send Access-Control-Allow-Origin headers":
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
@radumg so a test in the pre-commit hook failed due to a timeout of 5s (which fits with the slow commit issue) which then caused the commit itself to fail. Closing this out as an external issue.
Activity
iAmWillShepherd commentedon Aug 21, 2017
Does it take long to commit using the CLI?
shiftkey commentedon Aug 21, 2017
@radumg it looks like the Git pre-commit hook is failing, which blocks the commit from completing. It's hard for me to tell what's in the git commit hook (husky -> NPM -> ???) - could you shed some light on that?
radumg commentedon Aug 21, 2017
thanks @iAmWillShepherd and @shiftkey for the quick take-up.
Just tried with CLI and same behaviour, even when changes are un-staged, see the 2 screenshots.
As for the

huskypre-commit hook : now that I knew what to look for, I dug around the repo andhuskyis a node module and it seems it has some git hooks, see screenshot. It's not something I added, must have been part of the original repo.j-f1 commentedon Aug 21, 2017
Here’s your culprit:
source
One of
build,test:cli,test:server, oreslintis slowing you down.shiftkey commentedon Aug 21, 2017
@radumg pre-commit hooks in Git will fail Git by returning a non-zero exit code. There might be details in the log files around the actual failure (if you didn't scroll the output of the dialog to the bottom at the time).
EDIT: apoloiges - you attached the logs. Let me read them over.
shiftkey commentedon Aug 21, 2017
Aha!
shiftkey commentedon Aug 21, 2017
@radumg so a test in the pre-commit hook failed due to a timeout of 5s (which fits with the slow commit issue) which then caused the commit itself to fail. Closing this out as an external issue.
radumg commentedon Aug 21, 2017
Thanks all for the assistance 🍻 , hadn't dealt with commit hooks (or this much JS) until now.
Will reach out to original repo owner @typicode .