New issue
Advanced search Search tips
Starred by 2 users

Issue metadata

Status: Released
Owner: ----
Closed: Nov 2016

Sign in to add a comment

GIT_DIR not filled in for ref-update hooks with the new hooks-plugin.

Reported by, Oct 31 2016

Issue description

Affected Version: 2.13.2

What steps will reproduce the problem?
0. I built gerrit with its plugins from source using the 2.13.2 tag.
1. Install hooks core plugin, add a ref-update hook e.g. shell script that just prints the env and exits with 1.
2. Push a commit.
3. The env (printed in the git-client) does not contain an environment variable with GIT_DIR.

What is the expected output?
GIT_DIR set to the project that is pushed to

What do you see instead?
Some debug output in the plugin showed me that in HookTask projectName is null although the hookArgs contain --project example.

Please provide any additional information below.

I added the lines:
log.error("projectName: '" + projectName);
log.error("hookargs: '" + args);
before the if (projectName != null) test in

this gives the described output.

Patch for CommitReceived, that adds the project name to the run call of the hook.
The project name is calculated by using toString on a ProjectNameKey-object. Not sure if this is the way to go.
1.2 KB Download
I opened up review for this.
Project Member

Comment 4 by, Nov 1 2016

Status: ChangeUnderReview (was: New)
Labels: FixedIn-2.13.3
Status: Submitted (was: ChangeUnderReview)
Status: Released (was: Submitted)
Components: plugins>hooks

Sign in to add a comment