Describe the Bug
Depth-search for repositories does not work in Workspaces.
This used to work brilliantly with Git-Graph 1.12.1 and previous versions. In fact, a downgrade fixes this behaviour, so it is not a problem with my version of VsCode.
Steps to Reproduce
Steps to reproduce the behaviour:
git-graph.maxDepthOfRepoSearch to 10$ pwd
/tmp/git_graph_test
$ tree -a -L 4
.
โโโ one
โย ย โโโ folder
โย ย โโโ repo1
โย ย โย ย โโโ .git
โย ย โย ย โโโ what.txt
โย ย โโโ repo2
โย ย ย ย โโโ ever.txt
โย ย ย ย โโโ .git
โโโ two
โ โโโ folder
โ โโโ repo3
โ โโโ .git
โ โโโ something.txt
โโโ workspace.code-workspace
workspace.code-workspace should be like this:{
"folders": [
{"path": "/tmp/git_graph_test/one/folder"},
{"path": "/tmp/git_graph_test/two/folder"}
]
}
workspace.code-workspace as a workspace in VsCodeExpected Behaviour
All repositorys in the workspace should be listed, and this does work in previous versions.
Environment
Additional Context (optional)
Output of Git-graph:
[2019-08-28 11:18:39.322] Starting Git Graph ...
[2019-08-28 11:18:39.350] Using git (version: 2.23.0)
[2019-08-28 11:18:39.361] > git rev-parse --show-toplevel
[2019-08-28 11:18:39.362] Started Git Graph - Ready to use!
[2019-08-28 11:18:39.363] Transferred repo state: /tmp/git_graph_test/two/folder/repo3 -> /.
[2019-08-28 11:18:39.363] Searching workspace for new repos ...
[2019-08-28 11:18:39.372] > git rev-parse --show-toplevel
[2019-08-28 11:18:39.476] > git rev-parse --show-toplevel
[2019-08-28 11:18:39.486] > git rev-parse --show-toplevel
[2019-08-28 11:18:39.498] Added new repo: /tmp/git_graph_test/one/folder/repo1
[2019-08-28 11:18:39.498] Added new repo: /.
[2019-08-28 11:18:39.509] > git rev-parse --show-toplevel
[2019-08-28 11:18:39.598] > git rev-parse --show-toplevel
[2019-08-28 11:18:39.607] Added new repo: /.
[2019-08-28 11:18:39.607] Completed searching workspace for new repos
[2019-08-28 11:18:50.750] Created Git Graph View
[2019-08-28 11:18:51.078] > git branch -a --no-color
[2019-08-28 11:18:51.089] > git rev-parse --show-toplevel
[2019-08-28 11:18:51.090] Started watching repo: /.
[2019-08-28 11:18:51.104] > git rev-parse --show-toplevel
[2019-08-28 11:18:51.122] > git rev-parse --show-toplevel
[2019-08-28 11:18:51.123] Removed repo: /.
[2019-08-28 11:18:51.137] > git branch -a --no-color
[2019-08-28 11:18:51.141] Stopped watching repo: /.
[2019-08-28 11:18:51.141] Started watching repo: /tmp/git_graph_test/one/folder/repo1
[2019-08-28 11:18:51.158] > git log --max-count=301 --format=... --date-order --branches --tags --remotes HEAD
[2019-08-28 11:18:51.175] > git show-ref -d --head
[2019-08-28 11:18:51.193] > git remote
[2019-08-28 11:18:51.205] > git status -s --branch --untracked-files --porcelain
[2019-08-28 11:18:54.696] Stopped watching repo: /tmp/git_graph_test/one/folder/repo1
[2019-08-28 11:18:54.696] Disposed Git Graph View
[2019-08-28 11:19:39.933] Created Git Graph View
[2019-08-28 11:19:40.247] > git branch -a --no-color
[2019-08-28 11:19:40.249] Started watching repo: /tmp/git_graph_test/one/folder/repo1
[2019-08-28 11:19:40.283] > git log --max-count=301 --format=... --date-order --branches --tags --remotes HEAD
[2019-08-28 11:19:40.298] > git show-ref -d --head
[2019-08-28 11:19:40.312] > git remote
[2019-08-28 11:19:40.323] > git status -s --branch --untracked-files --porcelain
[2019-08-28 11:24:54.769] Stopped watching repo: /tmp/git_graph_test/one/folder/repo1
[2019-08-28 11:32:44.222] > git branch -a --no-color
[2019-08-28 11:32:44.225] Started watching repo: /tmp/git_graph_test/one/folder/repo1
[2019-08-28 11:32:44.239] > git log --max-count=301 --format=... --date-order --branches --tags --remotes HEAD
[2019-08-28 11:32:44.253] > git show-ref -d --head
[2019-08-28 11:32:44.270] > git remote
[2019-08-28 11:32:44.279] > git status -s --branch --untracked-files --porcelain
Also note, in the dropdown-menu sometimes appears a repository with the name of /., which dissappears after some time. Did not see/notice that in previous versions.
Thanks for identifying this, and providing such clear instructions to replicate it.
I've been able to reproduce this issue on Linux only, as I've found that it doesn't occur on Windows or Mac. I'll have a look into what might be causing this (interesting that it seems platform specific), and get a fix available for this asap.
I've just released a fix for this in v1.14.0-beta.2, which will be available in the full release v1.14.0 by 02/09/2019 (this coming Monday morning).
The issue was unrelated to the repository search, it just so happened that it was the most impacted. It was caused by a race condition in the stdout buffer of the spawned git command used to retrieve the absolute path of repos in the repo search. It only occurred on some platforms, for some workspace structures, during high CPU load.
You can download v1.14.0-beta.2, and install it following the instructions provided here.
Please confirm that this has resolved the issue for you.
I can confirm the fix working for my Workspaces where I first noticed, so looking good!
Thanks a lot for the quick fix!
Thanks @Konsonanz for confirming that this issue if resolved for you!