drewdeponte / git-ps

Patch Stack workflow CLI extension for Git
MIT License
50 stars 4 forks source link

Add `--no-verify` switch to the `commitAmendMessages()` function #33

Closed drewdeponte closed 3 years ago

drewdeponte commented 3 years ago

Turns out that when a user is using git hooks or something like Husky to manage git hooks if they have previously created a commit before with the --no-verify switch to skip the pre-commit & commit-msg hooks. When git-ps attempts to amend the commit message to add the ps-id to the commit message. It can fail because of the git hook rejection.

I think it makes sense in this use case to always skipe the commit hooks as they should have already been run by the user or explicitly skiped by the user to even get to this point.

drewdeponte commented 3 years ago

@hanx2cho do you think this is a good idea?

hanx2cho commented 3 years ago

Usually, when i skip the Husky git hook during the initial commit, I don't run into issues during git ps rr later on. In my specific scenario last week, Husky had some install issues that were blocking git-ps from amending the commit message, but this is the first time git-ps wasn't able to play nice with the git hooks from my skipping the git hooks at least 20-30 times before.

drewdeponte commented 3 years ago

Closing this as a non-issue for now. Can be re-open if becomes a real issue.

drewdeponte commented 3 years ago

I am re-opening this issue as there has been some further discussion out of band with @ctsstc. After that discussion I now believe that git-ps should take the stance of generally not verifying. So I believe we should be using the --no-verify on -n switch to bypass pre-commit hooks & commit-message hooks.

drewdeponte commented 3 years ago

This has been merged into the main branch.