Skip to content

Conversation

@miry
Copy link

@miry miry commented May 12, 2021

There are some tool that uses the pre-commit hook as well. It is possible to have multiple hooks in same time with folder .git/hooks/pre-commit.d

There are some tool that uses the pre-commit hook as well. It is possible to have multiple hooks in same time  with folder `.git/hooks/pre-commit.d`
@sds
Copy link
Owner

sds commented May 13, 2021

Thanks for the PR, @miry. I'm not clear on the value of mixing different hook management systems in the same repository.

Can you elaborate on why a development team would be using two systems?

@miry
Copy link
Author

miry commented May 13, 2021

@sds In some companies there are some internal tools exists for development environment. The internal tool required to have pre-commit hook, in same time it does not provide the same functionality as overcommit and focused only on specific commands.

As workaround I need manually to update the overcommit hook.

@sds
Copy link
Owner

sds commented May 18, 2021

It's not clear why the specific nuances of some companies requires Overcommit to accommodate? It seems like a company should standardize on a single workflow? Imposing multiple workflows on the tools the company uses doesn't seem like the right course of action.

With that said—would be supportive of a pull request that allows users to customize the directories that Overcommit reads hooks from. That way you could specify any directory (not just pre-commit.d).

@miry
Copy link
Author

miry commented May 18, 2021

The code that I introduce support any folder:

.git/hooks/<hook_type>.d

Before to update all <hook_type> templates, I wanted to be sure that it is valid idea.

It seems like a company should standardize on a single workflow?

This is right, but it is not easy to do in big companies. In same time the tool support custom hooks as I had implemented.
There is a comment about the approach to put custom hooks like overcommit and other hooks that overcommit should not cover in folder .git/hooks/pre-commit.d comment.

Some use case when I would like to use overcommit and other hook:

  1. Overcommit I use for code formatting and linting and running tests (everything related to code)
  2. I need run hooks to do encryption of the specific folders on commit (everything related to security)

@sds
Copy link
Owner

sds commented Jun 5, 2021

It's still not entirely clear how this adds support for any directory. It adds support for directories of the form <hook-type>.d. That is a limited set of possible directory names.

Could you not just register each hook as described in the documentation?

@miry miry closed this Jun 7, 2021
@miry miry deleted the patch-1 branch June 7, 2021 09:14
@miry miry restored the patch-1 branch June 7, 2021 09:16
@miry
Copy link
Author

miry commented Jun 7, 2021

Could you not just register each hook as described in the documentation?

I could not. I put overcommit to .git/hooks/pre-commit.d and updated the script to support folder name.

I think it is only my problem, so will keep the fork version.

@miry miry deleted the patch-1 branch June 7, 2021 10:20
@miry
Copy link
Author

miry commented Jun 7, 2021

FYI: Added support of installation hooks to directories in the fork: miry#1

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 this pull request may close these issues.

2 participants