Skip to content
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

incompatible with git-review hooks #19

Open
ssbarnea opened this issue Apr 13, 2017 · 3 comments
Open

incompatible with git-review hooks #19

ssbarnea opened this issue Apr 13, 2017 · 3 comments

Comments

@ssbarnea
Copy link

ssbarnea commented Apr 13, 2017

It seems that is not possible to use git-good-commit alongside git-review (gerrit) because both are installing the same hook: commit-msg.

We need to find a working solution for this so we can use both and eventually with other hooks.

I already made a CR for gerrit itself for adding this kind of functionality:
https://gerrit-review.googlesource.com/#/c/103362/

The same code could be added to git-review-hook in order to enable call of other hooks. The first hooks that gets installed is supposed to create the commit-msg.d folder and next hooks will be able to deploy themselves into this folder.

@ssbarnea
Copy link
Author

Here is the related bug raise for Gerrit: https://bugs.chromium.org/p/gerrit/issues/detail?id=5999

@tommarshall
Copy link
Owner

Hi @ssbarnea,

As described on the #20:

Multiple hooks (chaining) has unfortunately been a long running challenge with Git.

I appreciate the users of git-good-commit may run into this issue, however I think that resolving it is out of scope for any single commit hook, this project included. There's no agreed standard, so if every hook tried to offer it's own solution for chaining hooks they'd likely end up conflicting.

Rather than implement a solution within the hook itself I'd prefer to link to documentation so that users that require the hook chaining can solve this issue for themselves, e.g. http://stackoverflow.com/a/8734391

So I think this issue is worth addressing, but I think the solution needs to come in the way of documentation rather than the implementation of a concrete solution in the project itself.

Tom

@ssbarnea
Copy link
Author

I am aware about that SO DYI workaround but it doesn't scale at all. My current working set of git repos is about ~100-150 repos.

As you observed I opened a CR on Gerrit itself for implementing this multi-hooks support and they were happy about the implementation. The change was not merged yet because we had some problems with test execution but we will get it sorted in the end.

Once we have this merged, Gerrit hook will be the first hook that implement it but also the most common hook in the wild.

After this you will be able to replicate the same functionality in your hook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants