-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
[Feature Request] Can use 'prepare-commit-msg' hook --no-edit
#87
Comments
I will try |
We can, it's just we work in a team setting and making every dev do that is cumbersome. So thought of having a config |
It will be nice. I will consider adding it if it can work. Of course I also need to consider the version number of git |
Great! This feature would be extremely helpful in our situation. Thanks in advance. |
I'm very sorry to tell you, I tried many ways, but it didn't work.
|
Ah interesting, I see. Thanks for trying. I think I'll set up an alias or npm script for this. |
--no-edit
Yep In the future if I find out the solution I will reopen the ISSUE |
Will do the same thanks! |
work~ add git() {
local _cmd="$*"
if [ "$1" = "commit" ] && [ "${_cmd%%"--help"}" = "$_cmd" ]; then
shift 1; command git commit -m ''
else
command git "$@"
fi
} |
Finally !!! We find out a way to resolve open editor !!! 🤩 @FatehAK
git config core.editor cat
git commit # try it !
// package.json
"scripts": {
"postinstall": "git config core.editor cat",
} |
@Zhengqbbb this works as expected 👍 |
💭 Describe the feature
We are using czg as part of husky's 'prepare-commit-msg' hook like so -
exec < /dev/tty && npx --no-install czg --hook || true
It works as expected but it open the vim editor unnecessarily at the end.
Is it possible to add a flag
--no-edit
so that the editor is not opened at the end?💡 Proposed Solution
Add a
preventEditorOpen
flag which can befalse
by default and we can set it totrue
from .commitlintrc.jsIf the
preventEditorOpen
flag is true then the git commit command will begit commit --no-edit
The text was updated successfully, but these errors were encountered: