dotfiles-public icon indicating copy to clipboard operation
dotfiles-public copied to clipboard

fix: Commitizen needs specify which command

Open tony-sn opened this issue 9 months ago • 3 comments

Hi craftzdog,

When I follow your config for lazygit, whenever I click C it will show the CLI screen with only option press enter to return to lazygit and when I look at lazygit the example instruction is shown as

customCommands:
  - key: "C"
    command: "git cz c"
    description: "commit with commitizen"
    context: "files"
    loadingText: "opening commitizen commit tool"
    subprocess: true

So it is likely we need to append c at the end of the command, to enhance normal c shortcut from lazygit to commitizen

tony-sn avatar May 09 '24 05:05 tony-sn

It still says the same message:

Screenshot 2024-05-09 at 22 00 37

craftzdog avatar May 09 '24 13:05 craftzdog

It gets an error

error: pathspec 'c' did not match any file(s) known to git

where is the c option documented? https://github.com/commitizen/cz-cli

craftzdog avatar May 09 '24 13:05 craftzdog

Hi Takuya,

I believe it's the link from lazygit: lazygit custom commands

Also, lazygit's config file located differently based on OS: Linux: ~/.config/lazygit/config.yml MacOS: ~/Library/Application\ Support/lazygit/config.yml Windows: %LOCALAPPDATA%\lazygit\config.yml (default location, but it will also be found in %APPDATA%\lazygit\config.yml

Source: Lazygit User Config

Therefore, if you're using a Mac, you need to copy custom command to Application Support location above, it looks like lazygit on Mac will not understand config from .config/ folder

One more thing I notice, you may install commitizen from npm install commitizen -g, while Mac or Linux can use brew install commitizen

EDIT: I see you might change the config folder for mac export XDG_CONFIG_HOME="$HOME/.config", so perhaps the way commitizen installed would be the case here.

This is the result from my Mac after the config: PR_Commitizen

tony-sn avatar May 09 '24 14:05 tony-sn

The commitizen on Homebrew is a different tool. It is confusing that they have the same name. You have to install it via npm.

craftzdog avatar May 10 '24 00:05 craftzdog