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

Chain git-hooks instead of overwriting the existing one #7

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

Chain git-hooks instead of overwriting the existing one #7

dwightmulcahy opened this issue Feb 9, 2019 · 3 comments

Comments

@dwightmulcahy
Copy link

I'm not really liking that this overwrites any existing git-hook without mercy.

See this for discussion...
https://stackoverflow.com/questions/8730514/chaining-git-hooks

So this is what I'm envisioning, if an executable git-hook exists in the user's directory a "chain" would be added so that the newly installed script would be executed first and the user's chained to execute second.

@dwightmulcahy
Copy link
Author

I have something cobbled together for this... need refactoring and some cleanup before I PR it.

@phillipuniverse
Copy link
Owner

I'm not really liking that this overwrites any existing git-hook without mercy.

Agree, obliterating what's already there isn't very nice.

So this is what I'm envisioning, if an executable git-hook exists in the user's directory a "chain" would be added so that the newly installed script would be executed first and the user's chained to execute second.

It looks like the chaining piece (at least what you linked in SO) is pretty platform-dependent as it relies on symlinks. We already have some Windows users (see #2) is there a way we can keep this compatible with both?

@dwightmulcahy
Copy link
Author

...platform-dependent
...
...is there a way we can keep this compatible with both?

actually keeping it simple and just making the git-hook (like pre-commit) the hook-chain would do away with any symlinking.

One of the main issues I can think of now is that there would have to be some way to avoid continuing adding onto the "chain". Maybe a manifest of sha1/md5's?

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