Skip to content
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

git-cz.js throwing error. Commit still goes through #308

Closed
jaylaw81 opened this issue Aug 4, 2016 · 6 comments
Closed

git-cz.js throwing error. Commit still goes through #308

jaylaw81 opened this issue Aug 4, 2016 · 6 comments

Comments

@jaylaw81
Copy link

jaylaw81 commented Aug 4, 2016

Getting the following error after running git cz. version commitizen@2.8.4

/node_modules/commitizen/dist/cli/strategies/git-cz.js:102
        throw error;

Commit seems to go through, however error doesn't provide much more details.

@LinusU
Copy link
Contributor

LinusU commented Aug 5, 2016

Hmm, that's no good... Ping @marionebl

@marionebl
Copy link
Contributor

marionebl commented Aug 5, 2016

@jaylaw81 could you provide more details?

  • OS
  • node and npm version
  • commitizen adapter in use
  • exact command executed
  • complete error printout

To make debugging for these cases easier we probably should attach stderr to the error object here: https://github.com/commitizen/cz-cli/blob/master/src/git/commit.js#L34

@brandonpayton
Copy link

@marionebl I am seeing the same thing. My info is below. It doesn't look too helpful though. I have to call it a night, but if I have time later, I'll make the change locally to include stderr and look for more info.

  • OS: OS X El Capitan (10.11.6)
  • node: v6.3.1
  • npm: 3.10.3
  • adapter: cz-conventional-changelog
  • command: simply git-cz

Error output:

/Users/brandon/src/most-proxy/node_modules/commitizen/dist/cli/strategies/git-cz.js:102
        throw error;
        ^
fix(dependencies): Add most.js to devDependencies

most.js is a development dependency of most-proxy and is now automatically installed with the rest
of the development dependencies.



npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/6.3.1/bin/node" "/usr/local/bin/npm" "run" "commit"
npm ERR! node v6.3.1
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! most-proxy@3.0.0 commit: `git-cz`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the most-proxy@3.0.0 commit script 'git-cz'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the most-proxy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     git-cz
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs most-proxy
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls most-proxy
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/brandon/src/most-proxy/npm-debug.log

@brandonpayton
Copy link

One more bit of info: I experience the error with 2.8.4 and 2.8.3 but not with 2.8.2. Since 2.8.3 contains a single error-related fix, it seems likely the issue was introduced there.

@marionebl
Copy link
Contributor

@brandonpayton Thanks for the enhanced bug report, debugging this right now

@marionebl
Copy link
Contributor

marionebl commented Aug 5, 2016

Ok, so this is what happend. With 0d4e0d5#diff-23495cac1ee02ad0f5c48671e7498c16R69 I added nodeback error handling to the commit callback passed to commitizen adapters.

This was an error on my part – because the current, implicit contract between adapters and commitizen for the commit callback is (commitMessage) => void.

Fixing this now by typechecking arguments[0] in commit

marionebl added a commit to marionebl/cz-cli that referenced this issue Aug 5, 2016
*  minor code cleanups (cli/strategies/git-cz.js)
*  pass error as first argument into `dispatchGitCommit` callback
*  handle errors raised by commitizen adapters via optional error argument
*  attach stderr to error message in case of `git commit` errors

Fix commitizen#308
LinusU pushed a commit that referenced this issue Aug 6, 2016
*  minor code cleanups (cli/strategies/git-cz.js)
*  pass error as first argument into `dispatchGitCommit` callback
*  handle errors raised by commitizen adapters via optional error argument
*  attach stderr to error message in case of `git commit` errors

Fix #308
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

4 participants