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

Multiple named git-hooks of same type? #8

Open
dwightmulcahy opened this issue Feb 9, 2019 · 2 comments
Open

Multiple named git-hooks of same type? #8

dwightmulcahy opened this issue Feb 9, 2019 · 2 comments

Comments

@dwightmulcahy
Copy link

so if you do this:

<configuration>
      <hooks>
	   <pre-commit>Franklin Barbecue</pre-commit>
	   <pre-commit>Uncle Billy's Brewery</pre-commit>
      </hooks> ...

.git/hooks/pre-commit will contain:
Uncle Billy's Brewery

not sure if it should push an error on the second one or do a chaining like described in #7

@phillipuniverse
Copy link
Owner

The use case I can think of here is having a hook in a parent pom, and then another hook in a child pom, when the parent and child are not located together (like a bunch of disparate projects inheriting from a common base):

parent
   |__> pom.xml
child
    |___> pom.xml 

Where parent/pom.xml contains:

<configuration>
      <hooks>
	   <pre-commit>Parent check</pre-commit>
      </hooks> ...
</configuration>

and child/pom.xml contains:

<parent>
    <groupId>com.somecompany</groupId>
    <artifactId>parent</artifactId>
</parent>
...
<configuration>
      <hooks>
	   <pre-commit>Child additional check</pre-commit>
      </hooks> ...
</configuration>
...

@dwightmulcahy Is there another case you were thinking of? That one by itself would be pretty nice to support.

@dwightmulcahy
Copy link
Author

dwightmulcahy commented Feb 10, 2019

Yeah, I see that situation being solved by the chaining solution ( #7 ). I'll have to think a little about this but I see the order of the pom's (maven reactor) determining the order if the current pom.xml inserts it's git-hook to the front. This would make sure that the parent project trumps (gets executed first) all...

i.e.

Parent check
Child additional check1
Child additional check2
...

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

No branches or pull requests

2 participants