-
Notifications
You must be signed in to change notification settings - Fork 933
Error when working from within a branch worktree #787
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
Comments
Hi @PachowStudios! Thanks for the report, does your use case match this issue?
|
@byCedric not quite. I'm not using submodules, I'm using worktrees. |
Thanks for reporting, this is the first time I heard of git worktrees.
A possible fix for this would be to replace our custom implementation with a call to |
I've been using commitlint with worktrees for several months now without any issue. I started to see this problem this week.
Update: We updated commitlint to 8.2 from 7.6.1 a few days ago. I've downgraded to test: it works with worktrees on 7.6.1. |
Hi @Zelnox, thanks for your info! ❤️ I believe the issue is related to some refactoring we did to port to TypeScript. We had to update a library, which "behaves" a bit different now. That being said, we already fixed some of these issues. We also have a new version in testing right now, and it includes some rewrites that we had to do to support a new commit parser. You can try if version You can install this version with:
It would definitely help us determine a proper fix if you could test this one. 😄 |
The 8.2 version of commitlint has issues working with git worktrees. This upgrades to 8.3.3 which doesn't manifest these. Ref conventional-changelog/commitlint#787
@zregvart Thanks for checking! 😄 The issues you mentioned with Commitlint appears to be fixed with v8.3.3, right? |
@byCedric, well, works on my machine 😄 8.2 had the issue, 8.3 doesn't. Thank you for fixing it. |
I seem to be having an issue with commitlint and worktrees but not this exact one (happy to create another issue if needed)
I have my main worktree under develop and two linked trees for active features
note the full path of the module is my project directory. the no such file error is being cut off before the space in my project path. Going to try removing the space in my directory, but some program has it locked. ok I will try cloning into a different folder. renaming a parent directory screwed up so many things in git |
Is this problem being worked on? Blocks our workflow. :( |
@pegak nope, it's labeled with |
I will try to find time as it blocks the colleague work flow and I am more focused on platform. :) |
For those encountering the issue with
A dirty workaround for this is to manually specify where the # pnpx commitlint --edit D:/thisjt-projects/svelte-main/.git/worktrees/svelte-test/COMMIT_EDITMSG
pnpx commitlint --edit $GIT_DIR/COMMIT_EDITMSG I have my main work branch inside |
I have an issue:
I want to know what I should do to solve the issue |
When trying to run commitlint from within a branch worktree directory, I get the following error:
could not find git root from undefined
Expected Behavior
The operation should succeed without error.
Current Behavior
The operation errors with
could not find git root from undefined
Affected packages
Steps to Reproduce (for bugs)
git worktree add -b my-branch ../my-branch
Your Environment
commitlint --version
git --version
node --version
The text was updated successfully, but these errors were encountered: