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

feat: add --no-verify option to git push #299

Closed
wants to merge 1 commit into from
Closed

feat: add --no-verify option to git push #299

wants to merge 1 commit into from

Conversation

harryparkdotio
Copy link

@harryparkdotio harryparkdotio commented Oct 6, 2018

skip git hooks when pushing tags

use case
I have git hooks setup to run tests before pushing
I use np to publish
np runs tests before pushing

problem
tests are run twice

tests are run twice, first by np, second by git push hooks

@harryparkdotio harryparkdotio deleted the feat/git-push-no-verify-option branch May 18, 2019 05:24
@itaisteinherz
Copy link
Collaborator

Hi @harryparkdotio, sorry for not commenting sooner. This sounds like a great addition to np, and so I'd be glad to review and help land this in case you're interested in reopening and finishing this PR.

@sindresorhus Do you have any additional thoughts on this?

@sindresorhus
Copy link
Owner

Not sure it’s a good behavior to skip Git hooks by default. Users could have other important checks than tests in their hooks. If we do this, it should be opt-in.

@itaisteinherz
Copy link
Collaborator

If we do this, it should be opt-in.

Of course - this PR adds an opt-in flag to np which will enable users to optionally skip Git hooks when pushing.

@chrisblossom chrisblossom mentioned this pull request May 29, 2019
@chrisblossom
Copy link
Contributor

Is it possible to get this merged? If so, is there anything I can do to help? I see the source branch was deleted, I can put a new PR in if wanted.

@itaisteinherz
Copy link
Collaborator

@chrisblossom Feel free to do so 👍🏻
In retrospect, I see why @sindresorhus was skeptical about this. However, I still think that it could be useful for some users, and so I'd like to see this landed in np.

@samouri
Copy link
Contributor

samouri commented Sep 8, 2020

Any reason this was closed? I'd love to see this feature added

@b-hayes
Copy link

b-hayes commented Sep 13, 2020

Yeah, it kind of sucks having to open a terminal to push because of a broken git hook.

@hiro5id
Copy link

hiro5id commented Jan 19, 2022

I also need this feature. I'm using Husky for pre-commit hooks. But because Husky is installed as a DEV dependency, and as part of my publish I prune all DEV dependencies in the preversion hook. As a result, when np tries to commit the version change, it fails, because Husky is no longer there because it was cleaned up as part of pruning the DEV dependencies. So without the --no-verify option, I'm forced to have the Husky package included so that np can finish publishing. But that has the consequence of having Husky published as part of non-dev dependencies.

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.

7 participants