-
Notifications
You must be signed in to change notification settings - Fork 913
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
Fix/top level #784
Fix/top level #784
Conversation
…module not able to work properly
Ok, so the issue is that commitlint doesn't work with submodules, because the path of Commitlint searches for the latest commit using the (cc @escapedcat) |
@huanghai21 I'm refactoring
This should point Commitlint to the commit edit msg from the submodule 😄 |
Hi, @byCedric Here is more detail want to share with you.
One more thing: we can downgrade the commitlint to "7.6.1" and it worked for our situation. But still, do hope you can fix this and publish a new version to the npm registry. Thank you. |
Hi @huanghai21, thanks for your detailed explanation! This helps a lot trying to come up with something here 😄 As for
So one way I'm thinking of right now is this:
I think this is also something @marionebl and @escapedcat should take a look at. Cheers, |
Hi @byCedric Today I spent some time on this and found more information. Thanks |
…rect .git path which can be file or directory (conventional-changelog#784)
Awesome! Yeah, that's similar to what I had in mind 😄 I'm still a bit concerned about the spec though, it states that if it's a file, it contains a gitdir: . So this is how I interpret that: "If |
Hi @byCedric const gitFile = await sander.readFile(dotgitPath, {encoding: 'utf-8'});
const relativeGitPath = gitFile.replace('gitdir: ', '').replace('\n', '');
editFilePath = path.resolve(top, relativeGitPath, 'COMMIT_EDITMSG'); It explains how to locate the |
Oh wouw! I totally missed that one! Yeah, let's get this merged then 😄 |
do NOT specify the .git to be a directory in case of the git submodule not able to
work properly
Description
After the top level codes refactor here:
6a6a8b0 | 2019-07-07 [Cedric van Putten] refactor: rewrite top level to typescript (#679)
The commitlint can't work properly with the git submodule situation. The root cause is that in the submodule situation, the
.git
can be a file, not a directory.Motivation and Context
When we try to use commitlint in a submodule, the commitlint will pick the message from the .git/COMMIT_EDITMSG, but actually we hope it can pick the message from the .git/modules/${submoduleName}/COMMIT_EDITMSG.
This issue is closed but I think it is the most related one, so I still paste it here:
#448
Types of changes
Checklist: