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

Error when commiting #61

Closed
DavideCarvalho opened this issue Jan 21, 2019 · 7 comments
Closed

Error when commiting #61

DavideCarvalho opened this issue Jan 21, 2019 · 7 comments

Comments

@DavideCarvalho
Copy link

I was using pretty-quick and it was working fine, but since yesterday i'm getting this error:

C:\Users\davi.carvalho\Documents\afe-pipeline\node_modules\pretty-quick\dist\scms\git.js:43
    throw error;
    ^

Error
    at Function.module.exports.sync (C:\Users\davi.carvalho\Documents\afe-pipeline\node_modules\pretty-quick\node_modules\execa\index.js:303:26)
    at runGit (C:\Users\davi.carvalho\Documents\afe-pipeline\node_modules\pretty-quick\dist\scms\git.js:29:53)
    at Object.exports.getSinceRevision (C:\Users\davi.carvalho\Documents\afe-pipeline\node_modules\pretty-quick\dist\scms\git.js:38:12)
    at exports.default (C:\Users\davi.carvalho\Documents\afe-pipeline\node_modules\pretty-quick\dist\index.js:44:33)
    at Object.<anonymous> (C:\Users\davi.carvalho\Documents\afe-pipeline\node_modules\pretty-quick\bin\pretty-quick.js:13:1)
    at Module._compile (internal/modules/cjs/loader.js:707:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
    at Module.load (internal/modules/cjs/loader.js:605:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
    at Function.Module._load (internal/modules/cjs/loader.js:536:3)
husky > pre-commit hook failed (add --no-verify to bypass)

I tried reinstalling the dependencies but it didn't work

@jantimon
Copy link
Collaborator

Did it also show an error message?

@DavideCarvalho
Copy link
Author

Nope, only this

@DavideCarvalho
Copy link
Author

Since i’m working inside a client, it’s possible that it’s a network problem, I’ll take a look

@jantimon
Copy link
Collaborator

The error happens here:

https://unpkg.com/pretty-quick@1.10.0/dist/scms/git.js

const getSinceRevision = exports.getSinceRevision = (directory, { staged, branch }) => {
  try {
    const revision = staged ? 'HEAD' : runGit(directory, ['merge-base', 'HEAD', branch || 'master']).stdout.trim();
    return runGit(directory, ['rev-parse', '--short', revision]).stdout.trim();
  } catch (error) {
    if (/HEAD/.test(error.message) || staged && /Needed a single revision/.test(error.message)) {
      return null;
    }
    throw error;
  }
};

But this is quite unrelated to the last changes we did.

@DavideCarvalho
Copy link
Author

Okay, these were my steps

  • npm cache clean --force
  • remove package-lock.json
  • I was using pretty-quick version 1.8, so I updated to 1.10
  • deleted node_modules and installed everything again
    Now it's working

@jantimon
Copy link
Collaborator

Cool 👍- can we close this issue then?

@azz
Copy link
Member

azz commented Jan 22, 2019

Let's close it. Sounds like git itself exited nonzero with no output. If it props up again we can investigate further.

@azz azz closed this as completed Jan 22, 2019
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

3 participants