-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git rev-parse fails in the pre-receive hook using git >= 2.11.0 #112
Comments
This sounds like a new feature in git that Critic needs to be taught to deal with. Did you by any chance upgrade to a new git version around the time of the restart? |
That is likely, and I found this in the 2.11.0 git release notes:
Not at the machine now but will verify this tomorrow. |
Indeed, reverting to git |
Critic needs fixing indeed. Thank you for reporting the issue! I will look into fixing it as soon as I can. |
This adds support for git >= 2.11.0 - see issue jensl#112.
Hi Jens,
this is probably an issue on our side since it worked earlier, but maybe you have some pointers ?
After a server restart critic started to raise exceptions on new pushes, and it fails in
processCommits()
in index.py in the first line that callsgit rev-parse --verify --quiet SHA1+^{commit}
. The error message is: "fatal: Needed a single revision".So when I tried to debug this a bit I can see that the same git rev-parse command works if I add it directly in the pre-receive hook. But putting the same command early in githook.py fails.
Further I can see that if I print the environment variables in pre-receive I can see the variable
GIT_OBJECT_DIRECTORY
that points to a temporary incoming folder for the new objects. I assume that the git rev-parse command uses this to find the new commit even though they are not yet in the main objects directory. But this environment variable does not seem to be present in githook.py or index.py after the data is sent over the socket. So it seemed to me that this is a problem. But I don't have the full overview - how will the critic hooks know about the new object if they don't have this env variable set ? Should it be set - or is there something else that should handle this ?The text was updated successfully, but these errors were encountered: