Vscode: Support git repositories inside git repositories

Created on 13 Nov 2017  路  8Comments  路  Source: microsoft/vscode

  • VSCode Version: Code 1.18.0
  • OS Version: Windows_NT x64 10.0.15063

Hey,

The new support for Multi Root Workspaces (alongside multiple source control providers) is awesome, only I noticed an issue. If you add several projects where each of them is under source control (a git repo), the source control tracking works as expected (i.e. making changes in 2 different projects will show 2 pending changes). However, if one of the projects has child folders that are under source control themselves, the source tracking will only work for that one project and stop tracking the rest of the projects in Multi Root.

The above situation can be "resolved" if the project (the one with child repos) is moved at the bottom of .code-workspace file. Any projects above that one project will begin to be tracked properly, and the projects below will stop being tracked.

I wonder if it's just me.

*duplicate bug git help wanted

Most helpful comment

@eriawan
If someone can be confused with this feature, it can be optional.
But I also need it :)

All 8 comments

I couldn't understand the full scenario... can you narrow it down to a simple example, like C:\A is a git repo, C:\B is a git repo, open both folders in Code, etc...

Sure!

  1. Open VSCode > File > Add Folder to Workspace ...
  2. We add 3 folders (for example), where each one is a git repo:

    • C:\ProjectA

    • C:\ProjectB

    • C:\ProjectC

Everything works as expected, i.e. each change in any folder will increase the total "pending changes" counter.

Now, we further add project C:\BigProject. It is also a git repo and it has a child folder that includes the other 3 projects like so:
- C:\BigProject\develop\ProjectA
- C:\BigProject\develop\ProjectB
- C:\BigProject\develop\ProjectC

The reason for this odd configuration is that work is being done by individual team members on ProjectA, ProjectB and ProjectC, but everyone at all times must have BigProject with the most up-to-date versions of ProjectA, ProjectB and ProjectC. That's a legacy story for another day though...

If you add BigProject individually as the last project (after A, B and C), the git tracking will still work. But, if you add BigProject first and then Add to Workspace the rest of the projects - the tracking will stop working for Project A, B and C, and only work for BigProject.

Like I said earlier, the issue is resolved (tracking starts working again for all projects) if BigProject is moved to the bottom of .code-workspace file. Any projects above it will be tracked properly, any projects below will not be tracked.

Does this help?

Seems like a dupe of #37947 to me.

@stoberov
This nested git project repos is confusing and often causing problems, IMHO.
Why don't you use git submodules instead? It is less confusing and it's easier to manage.

@eriawan
If someone can be confused with this feature, it can be optional.
But I also need it :)

If it's not possible to implement it, maybe just add an option in settings when we can provide which git repo should be shown in SCM tab...

/duplicate #37947

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

Was this page helpful?
0 / 5 - 0 ratings