feature-requestgithelp wanted
Description
I use two git repositories within project folder - one is .git and second is .git_dev. First is for project and second is to track my local config files. I used to work with second via alias git dev which stands for git --git-dir=.git_dev, but for now I explore ways to list changes within both repos in git sideview.
What I did:
- I create folder aside the main project folder(consider it
project) and call itproject_dev - Initialize new repo in new folder with
git init --separate-git-dir ../project/.git_dev. It creates fileproject_dev/.gitwith related line. - Then create new file within
project_devfolder and open it in Code. Now I'm able to view changes for both repos, but one calledproject_devtracks theproject_devfolder, not theproject - So my next step is to add setting
worktree=/path/to/projectin.git_dev/cofig. Now git sideview perfectly represents current changes forproject_devaside to mainproject.
And here I run into two issues:
- if I try to click on changed file in
project_devsection of sideview, an error occurs with message:Unable to open 'filename (Working Tree)': Unable to read file (Error: File not found (/path/to/project_dev/filename)).like it doen't respect settingworktreeat all. - If I reload Code, even if I open file from
project_devfolder, second repo is not shown. If I removeworktreesetting,project_devrepo is shown again and I have to addworktreesetting again to get changes properly.
Example repo: https://github.com/deitry/vscode-two-git-repos-issues
So, on the one hand I consider current behaviour as buggy. On the other hand, I make a request to add option to pass as many --git-dirs as I want by making it a list:
"git.gitdirs: [ ".git", ".git_dev"]