Zhengqbbb / cz-git

cz-git | czg 🛠️ DX first and more engineered, lightweight, customizable, standard output format Commitizen adapter and CLI
https://cz-git.qbb.sh
MIT License
1.05k stars 39 forks source link

[Bug report] 进行N个项目测试,试了十八般配置,每一次能出来交互命令都是弹出编辑页 #143

Closed Jason11Q closed 1 year ago

Jason11Q commented 1 year ago

✅ Checklist

📄 System Info

System:
    OS: Windows 10 10.0.19045
    Memory: 5.87 GB / 15.86 GB
  Binaries:
    Node: 16.19.0 - ~\AppData\Roaming\nvm\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\nvm\nodejs\yarn.CMD
    npm: 8.19.3 - ~\AppData\Roaming\nvm\nodejs\npm.CMD
    pnpm: 8.6.10 - ~\AppData\Roaming\nvm\nodejs\node_global\pnpm.CMD
  npmPackages:
    commitizen: ^4.3.0 => 4.3.0
    cz-git: ^1.7.1 => 1.7.1

🔎 Description

Concise Description

没有使用全局配置,在项目中使用的,开始有配置commitizen、commitlint-config-cz、cz-customizable等,后面总是不行也给删除了,删除了也是不行。

Expected behavior

[SUCCESS] stylelint --fix [SUCCESS] .{html,css,less,scss} — 9 files [SUCCESS] eslint --fix [SUCCESS] .{js,vue,ts,jsx,tsx} — 19 files [SUCCESS] package.json — 50 files [SUCCESS] Running tasks for staged files... [STARTED] Applying modifications from tasks... [SUCCESS] Applying modifications from tasks... [STARTED] Restoring unstaged changes to partially staged files... [SUCCESS] Restoring unstaged changes to partially staged files... [STARTED] Cleaning up temporary files... [SUCCESS] Cleaning up temporary files... hint: Waiting for your editor to close the file...

Steps to reproduce

直接执行npm run commit(配置的git-cz),或者直接执行npx git-cz等等都测试过,作者那几页的文档博客翻烂了,开始配置比较多,担心冲突,把博客上没有说要加的和commit相关的配置全都删了,只留了eslint和stylelint,还是不行,折腾这玩意三天,实在是没脾气了,我也不求能用了,暂能不能整个官方的示例demo,我照搬也行啊,或者直接给个cli,能把必须依赖都安装好和常用配置给弄好。

Screenshots or Screen Recording(if possible)

🔗 Reproduction link / repo:

No response

Zhengqbbb commented 1 year ago

每一次能出来交互命令都是弹出编辑页? 命令 git commit -m 'hello' 后也会弹出类似 vim 的编辑器吗? 如果会你应该是自动运行了 git hook,你在项目中输出这个命令看看有没有 git hook 配置

git config core.hookspath

然后看看 prepare-commit-msg 这个 hook 是不是配置了 这个钩子就会拦截你的 git commit 然后强制使用交互模式,最后还会打开编辑器

CleanShot 2023-08-14 at 10 58 18@2x
Zhengqbbb commented 1 year ago

或者给我瞄一眼,你说的 "作者" 是哪个项目的,我去看看

Jason11Q commented 1 year ago

我看到这个提示了,把hook去了也不行

Jason11Q commented 1 year ago

或者给我瞄一眼,你说的 "作者" 是哪个项目的,我去看看

https://cz-git.qbb.sh/zh/guide/ 就你自己的博客网站

Jason11Q commented 1 year ago

现在几个项目都让我加这个给搞乱完了,script里加的cz,git-cz,czg。好几个版本了,我自己都理不清了,我试试都删了重新加最开始的ommitlint-config-cz吧

Zhengqbbb commented 1 year ago

现在几个项目都让我加这个给搞乱完了,script里加的cz,git-cz,czg。好几个版本了,我自己都理不清了,我试试都删了重新加最开始的ommitlint-config-cz吧

你选一个最小例子发我看看 https://github.com/Zhengqbbb/czgit-playground

Zhengqbbb commented 1 year ago

或者给我瞄一眼,你说的 "作者" 是哪个项目的,我去看看

https://cz-git.qbb.sh/zh/guide/ 就你自己的博客网站

啊?我的博客网站应该都没有用 hook 呀 如果还是会,你还要检查一下你全局是不是有没有设置

git config --global core.hookspath
Jason11Q commented 1 year ago

算了,我删了吧,在这个基础上按博客示例全局安装那样执行能成功,项目里不行,我要是能摘出来最小的也就知道是哪里冲突就能解决了,我回退了,不折腾了,头发不多了。