Skip to content

For me, I'm trying to use the single command git commit and it prompt to choose my type: #841

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

Closed
k2on opened this issue Jul 25, 2021 · 1 comment

Comments

@k2on
Copy link

k2on commented Jul 25, 2021

For me, I'm trying to use the single command git commit and it prompt to choose my type:

husky > pre-commit (node v12.17.0)
ℹ No staged files match any configured task.
husky > prepare-commit-msg (node v12.17.0)
? Select the type of change that you're committing: (Use arrow keys or type to search)
❯ test:       Adding missing tests 
  feat:       A new feature 
  fix:        A bug fix 
  chore:      Build process or auxiliary tool changes 
  docs:       Documentation only changes 
  refactor:   A code change that neither fixes a bug or adds a feature 
  style:      Markup, white-space, formatting, missing semi-colons... 

Then I make de description:

...
? Select the type of change that you're committing: chore:      Build process or auxiliary tool changes
? Write a short, imperative mood description of the change: 
  [-------------------------------------------------------------] 34 chars left
   chore: husky hook on git-cz

But it's falling back to VIM to edit COMMIT_EDITMSG:

chore: husky hook on git-cz
~                                                                                                                                           
~                                                                                                                                           
~                                                                                                                                           
~                                                                                                                                           
~                                                                                                                                           
~                                                                                                                                           
~                                                                                                                                           
~                                                                                                                                           
~                                                                                                                                           
~                                                                                                                                           
~                                                                                                                                           
"~/repo/.git/COMMIT_EDITMSG" [noeol] 1L, 27C

My pakcage.json husky config and version:

...
"dependencies": {
    "@commitlint/cli": "^11.0.0",
    "@commitlint/config-conventional": "^11.0.0",
    "@commitlint/config-lerna-scopes": "^11.0.0",
    "commitizen": "^4.2.3",
    "cz-conventional-changelog": "^3.3.0",
    "eslint": ">=6.0.0",
    "git-cz": "^4.7.6",
    "husky": "^4.3.8",
    "lerna": "^3.22.1",
    "lint-staged": "^10.5.3",
    "prettier": "^2.2.1",
    "stylelint": "^13.9.0"
  },
"husky": {
    "hooks": {
      "pre-commit": "lint-staged",
      "prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  },

-> Some can help me with this issue? There is some "thing" to avoid open the COMMIT_EDITMSG or is the default behavior?

Originally posted by @jaikme in #688 (comment)

@k2on
Copy link
Author

k2on commented Jul 25, 2021

Duplicate issues everywhere haha

@k2on k2on closed this as completed Jul 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant