Update .husky/pre-commit to run local git pre-commit if defined#7862
Open
bplaxco wants to merge 1 commit intobackstage:mainfrom
Open
Update .husky/pre-commit to run local git pre-commit if defined#7862bplaxco wants to merge 1 commit intobackstage:mainfrom
bplaxco wants to merge 1 commit intobackstage:mainfrom
Conversation
Signed-off-by: Braxton Plaxco <bplaxco@redhat.com>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey, I just made a Pull Request!
This is a pull request for #7667
Here is an example of the output when I committed the change.
The extra output at the end there is because I have a local hook defined at
.git/hooks/pre-commit.Here's what it looks like if I remove my local hook and create a new commit:
Note that the husky hook still runs and my hook does not.
Also here is confirming the existing hook will error like it's supposed to:
I made a small change on my example branch:
Note the changes were not committed and my local pre-commit script that I re-enabled for this test did not run. It exited early as it should.
I also ran shellcheck on the script to look for any obvious errors:
✔️ Checklist
A changeset describing the change and affected packages. (more info)(Didn't seem applicable since this isn't a change that's released but would be more than happy too if I was wrong and it is applicable 👍 )Added or updated documentation(left out because it didn't seem like something previously documented, but I can write docs if desired ^_^)Signed-off-byline in the message. (more info)