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

Remove defaut commit-msg setting #86

Open
gabmontes opened this issue Apr 21, 2016 · 8 comments
Open

Remove defaut commit-msg setting #86

gabmontes opened this issue Apr 21, 2016 · 8 comments

Comments

@gabmontes
Copy link

When installing pre-git, a default setting for the commit-msg is set. Is there any way to prevent this behavior?

In repos where no such a rule is applied to commit messages, the hook has to be manually disabled editing the package.json after install. Even doing that, the hook can be unintentionally re-enabled by reinstalling the package.

Please advise. Thanks.

@bahmutov
Copy link
Owner

bahmutov commented May 9, 2016

I think we should not set it if it has been removed manually. But setting the default value helps I think

@gabmontes
Copy link
Author

I agree that in some cases will help but in many cases I have run into, and this is the reason behind my question, had to perform clear installs of repos using pre-git and the commit-msg setting is set, despite it was previously removed from package.json.

One option to solve the issue is to split the module's behavior in two: a git hooks piece and a commit message validation piece. If you install the second, have the current full functionality. If only install the first piece, just the hooks. My two cents!

@insidewhy
Copy link

Setting the default value feels like overreach for me. I've installed pre-git in about five projects now and never wanted it.

@bahmutov
Copy link
Owner

bahmutov commented Aug 4, 2017

Wait, is it installing a hook even if this is a deep nested dependency? In other words, I am ok with it installing git hooks and adding config to the package.json if the package requires pre-git. But if you add a dependency on the package Foo that requires pre-git, you shouldn't get any of these things.

If this is the case (I don't remember now), it is a bad bug = feature.

@bahmutov
Copy link
Owner

bahmutov commented Aug 6, 2017

Just tested - if you do NOT install pre-git directly, the Git hooks are not set. The package.json is not updated. Only if you directly install pre-git then you will get the Git hooks and the config object. I do not see how this module can be installed without installing its requirements hooks and configuration object.

@insidewhy
Copy link

pre-git should be modular and do one thing well. Commit message validation should be a separate package.

@oli
Copy link

oli commented Sep 5, 2017

Using pre-git for secrets checking here, and have no desire to enforce commit message formatting, so we’re also deleting

"release": {
  "analyzeCommits": "simple-commit-message"
}

from each repo’s package.json after installation, fwiw (yay microservices). Thanks for pre-git by the way!

@lirantal
Copy link

lirantal commented Dec 7, 2017

Same.
TBH, don't even know what that's used for? is that for anyone who might be using semantic-release or standard-version type of modules?

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

No branches or pull requests

5 participants