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 on commit, if package.json in subdirectory #62

Closed
imrekq opened this issue Aug 17, 2017 · 3 comments · Fixed by #64
Closed

error on commit, if package.json in subdirectory #62

imrekq opened this issue Aug 17, 2017 · 3 comments · Fixed by #64
Labels

Comments

@imrekq
Copy link
Contributor

imrekq commented Aug 17, 2017

In root directory(has .git) make subdirectory and in her package.json with "commitmsg": "conventional-changelog-lint -e". After trying commit I have:
Error: Command failed: git rev-parse --show-toplevel
fatal: Not a git repository: '.git'

@marionebl marionebl added the bug label Aug 18, 2017
@marionebl
Copy link
Contributor

marionebl commented Aug 18, 2017

Can not reproduce with the following sequence. Are you using the latest version of commitlint?

npm install -g npx
mkdir -p test/packages/test
git init
cd packages/test
npm init -y
npm install --save-dev @commitlint/config-angular
git add . 
git commit -m "chore: initial commit"
npx commitlint -x @commitlint/config-angular -e

⧗   input: chore: initial commit
✔   found 0 problems, 0 warnings

@imrekq
Copy link
Contributor Author

imrekq commented Aug 18, 2017

I reproduced as follows:

mkdir -p test/subdir
cd test
git init
cd subdir
npm init -y
npm install --save-dev @commitlint/cli husky

added "scripts": {
"commitmsg": "commitlint -e"
}

git commit -m "chore: initial commit"

Result:

Error: Command failed: git rev-parse --show-toplevel
fatal: Not a git repository: '.git'

@marionebl
Copy link
Contributor

Thanks for the refined use case! Will have a look at this over the weekend.

@marionebl marionebl removed the review label Aug 18, 2017
marionebl added a commit that referenced this issue Aug 21, 2017
* test(cli): add failing integration test

* fix: determine git root correctly from sub directories

* fixup! make git initializing work

fixes #62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants