Open Kushalkr opened 1 year ago
Can you please add more detail as to the issue you are experiencing and/or the steps to reproduce it?
Also, if this issue is reproducible, can you please enable debug logging by running from GitLens: Enable Debug Logging from the Command Palette (F1 or ctrl/cmd+shift+p). This will enable logging to the GitLens and GitLens (Git) channel in the Output pane.
Once enabled, please reproduce the issue, and attach the log from the both GitLens and GitLens (Git) channels.
Thank you!
Hello! Thank you for reaching out! I've update the description and included some steps to reproduce. Hope this helps!
I've just encountered the same problem in my setup. This is not a bug in GitLens but in the user's devcontainer configuration. In order for Git (and, by extension, GitLens) to work correctly, both the worktree and the original working copy must be mounted into the devcontainer.
That's because the .git
file inside the worktree refers to a path under the original working copy. If Git is unable to access that path, it cannot find the associated repository metadata.
I am having exactly the same problem. @mp-chet, your explanation makes sense. Did you manage to make it work by editing the devcontainer?
For my specific use case, I decided to clone a separate working copy after all.
I made that choice because it would feel wrong to commit a highly user-specific bit of devcontainer configuration into a shared Git repository used by many other people. Unfortunately, devcontainer config files are not composable...
Yeah, fair point. For what it's worth, I found this feature request in the devcontainers repo. Let's hope it's picked up: devcontainers/cli#796
Description
On VSCode, opening a dev container within worktrees doesn't recognize files as part of a git repo.
Steps to reproduce
main
branch using Gitlens' worktree feature using the option highlighted below (I named my worktree astest
):test
worktree (in the current window or a new one) when VScode prompts you to.Reopen in Container
(Note: You needDocker
installed for this) as shown below:+
on theTERMINAL
tab) inside the container.git
command which will give you the following error:GitLens Version
14.1.1
VS Code Version
Version: 1.80.1 (Universal) Commit: 74f6148eb9ea00507ec113ec51c489d6ffb4b771 Date: 2023-07-12T17:20:23.298Z Electron: 22.3.14 ElectronBuildId: 21893604 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Darwin x64 22.5.0
Git Version
git version 2.34.1
Logs, Screenshots, Screen Captures, etc
Logs attached gitlens_git.log gitlens.log