commitizen / commitizen/cz-cli

Wizard exits into vim/COMMIT_EDITMSG

Đang mở
#934 14 bình luận 8 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
17.5k
Fork
566
Merge trung bình
8 giờ 16 phút
Pull request đã merge (30 ngày)
1

Mô tả

Hi,

Hoping for a bit of guidance,

I have setup this package following the instructions and have the wizard running. This uses husky and the `prepare-commit-message` hook runs `exec < /dev/tty && npx --no-install git-cz --hook || true`.

Then the `commit-msg` hook runs `npx --no -- commitlint --edit "\${1}"` to lint the commit message.

Relevant package versions:
```
"@commitlint/cli": "^16.2.4",
"@commitlint/config-conventional": "^16.2.4",
"@commitlint/cz-commitlint": "^16.2.4",
"commitizen": "^4.2.4",
"cz-customizable": "^6.3.0",
```

The trouble i'm facing is that every time i complete the wizard i'm dumped back into the vim in what looks like the `COMMIT_EDITMSG` git hook asking me to enter a commit message, and have to `:q` to exit which is annoying. Linting then runs after this as expected.

Steps to reproduce:

1. Run `git commit -a` in terminal
2. Proceed through wizard and choose `Yes` to the `confirmCommit` message.
3. Vim starts, `:q` to exit
4. Linting runs.

If i comment out the linting stage i do not enter the `COMMIT_EDITMSG` hook, so from what i can tell, this opens because the `--edit` flag of Commitlint says:
`read last commit message from the specified file or fallbacks to ./.git/COMMIT_EDITMSG` so looking at my lint command `npx --no -- commitlint --edit "\${1}"` - is the path/file not being passed correctly from cz to commitlint? Or is the git process thinking it also needs to launch?

Thanks

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.