Skip to content
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

Worktree Create button (+) does not do anything, under certain conditions #2530

Closed
jospvl opened this issue Feb 28, 2023 · 14 comments
Closed
Assignees
Labels
area-worktrees Issues or features related to worktrees bug Something isn't working verified ✔ Verified
Milestone

Comments

@jospvl
Copy link

jospvl commented Feb 28, 2023

Description

When there are two or more worktrees and the active worktree is not Main, the + button does not do anything.
It does work when the Main worktree is active, though.

This is probably related to issue #2301 but still occurring in v13.3.1 and in pre-release v2023.2.2411.

When it doesn't work, GitLens debugging output pane reports:
Vc.execute — failed
TypeError: Cannot read properties of undefined (reading 'path')

GitLens Version

13.3.1

VS Code Version

Version: 1.75.1
Commit: 441438abd1ac652551dbe4d408dfcec8a499b8bf
Date: 2023-02-08T21:34:59.000Z
Electron: 19.1.9
Chromium: 102.0.5005.194
Node.js: 16.14.2
V8: 10.2.154.23-electron.0
OS: Darwin x64 22.3.0
Sandboxed: No

Git Version

git version 2.39.2

Logs, Screenshots, Screen Captures, etc

No response

@jospvl jospvl added potential-bug triage Needs to be looked at labels Feb 28, 2023
@d13
Copy link
Member

d13 commented Mar 1, 2023

Unfortunately, I'm not able to reproduce this.

Can you please enable debug logging by running the GitLens: Enable Debug Logging command from the Command Palette (F1 or ctrl/cmd+shift+p). This will enable logging to the GitLens & GitLens (Git) channels in the Output pane.

Once enabled, please reproduce the issue, and attach the logs from the GitLens channel, and if its Git related please also attach the logs from the GitLens (Git) channel.

Thank you!

@d13 d13 added needs-more-info Needs further information, steps, details, etc. and removed triage Needs to be looked at labels Mar 1, 2023
@sedghi
Copy link

sedghi commented Mar 1, 2023

happening again for me. I reported it before here and it was fixed but it is happening again. My log is

[2023-03-01 18:59:56.074] [  6a3] ViewCommands.createWorktree
[2023-03-01 18:59:56.081] [  6a8] GitProviderService.getOrOpenRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git), t={"closeOnOpen":true})
[2023-03-01 18:59:56.081] [  6a9] GitProviderService.getRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git))
[2023-03-01 18:59:56.081] [  6a9] GitProviderService.getRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git)) returned undefined • 0 ms
[2023-03-01 18:59:56.082] [  6a8] GitProviderService.getOrOpenRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git), t={"closeOnOpen":true}) returned undefined • 0 ms
[2023-03-01 18:59:56.082] [  6a4] Vc.execute — failed
TypeError: Cannot read properties of undefined (reading 'path')

and then it become bigger

[2023-03-01 18:59:56.074] [  6a3] ViewCommands.createWorktree
[2023-03-01 18:59:56.081] [  6a8] GitProviderService.getOrOpenRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git), t={"closeOnOpen":true})
[2023-03-01 18:59:56.081] [  6a9] GitProviderService.getRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git))
[2023-03-01 18:59:56.081] [  6a9] GitProviderService.getRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git)) returned undefined • 0 ms
[2023-03-01 18:59:56.082] [  6a8] GitProviderService.getOrOpenRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git), t={"closeOnOpen":true}) returned undefined • 0 ms
[2023-03-01 18:59:56.082] [  6a4] Vc.execute — failed
TypeError: Cannot read properties of undefined (reading 'path')
[2023-03-01 19:00:00.189] [  6aa] GitProviderService.onWindowStateChanged(e=focused=false)
[2023-03-01 19:00:00.199] [  6aa] GitProviderService.onWindowStateChanged(e=focused=false) completed • 9 ms
[2023-03-01 19:00:02.541] [  6ab] CommitsView.triggerNodeChange(e=CommitsViewNode)
[2023-03-01 19:00:02.541] [  6ab] CommitsView.triggerNodeChange(e=CommitsViewNode) completed • 0 ms
[2023-03-01 19:00:02.543] [  6ac] CommitsViewNode.ensureSubscription
[2023-03-01 19:00:02.544] [  6ac] CommitsViewNode.ensureSubscription completed • 0 ms
[2023-03-01 19:00:02.544] [  6ae] GitProviderService.getLastFetchedTimestamp(e=/Users/alireza/dev/cornerstone3D-beta.git/main)
[2023-03-01 19:00:02.544] [  6af] LocalGitProvider.getLastFetchedTimestamp(e=/Users/alireza/dev/cornerstone3D-beta.git/main)
[2023-03-01 19:00:02.544] [  6b0] LocalGitProvider.getGitDir(e=/Users/alireza/dev/cornerstone3D-beta.git/main)
[2023-03-01 19:00:02.545] [  6b0] LocalGitProvider.getGitDir(e=/Users/alireza/dev/cornerstone3D-beta.git/main) completed • 0 ms
[2023-03-01 19:00:02.565] [  6af] LocalGitProvider.getLastFetchedTimestamp(e=/Users/alireza/dev/cornerstone3D-beta.git/main) completed • 20 ms
[2023-03-01 19:00:02.565] [  6ae] GitProviderService.getLastFetchedTimestamp(e=/Users/alireza/dev/cornerstone3D-beta.git/main) completed • 20 ms
[2023-03-01 19:00:02.566] [  6b1] CommitsRepositoryNode(gitlens:repository(/Users/alireza/dev/cornerstone3D-beta.git/main)).ensureSubscription
[2023-03-01 19:00:02.567] [  6b1] CommitsRepositoryNode(gitlens:repository(/Users/alireza/dev/cornerstone3D-beta.git/main)).ensureSubscription completed • 0 ms
[2023-03-01 19:00:02.569] [  6b2] GitProviderService.getRemotesWithProviders(e=/Users/alireza/dev/cornerstone3D-beta.git/main)
[2023-03-01 19:00:02.569] [  6b3] GitProviderService.getRepository(e=/Users/alireza/dev/cornerstone3D-beta.git/main)
[2023-03-01 19:00:02.569] [  6b3] GitProviderService.getRepository(e=/Users/alireza/dev/cornerstone3D-beta.git/main) returned /Users/alireza/dev/cornerstone3D-beta.git/main • 0 ms
[2023-03-01 19:00:02.603] [  6b2] GitProviderService.getRemotesWithProviders(e=/Users/alireza/dev/cornerstone3D-beta.git/main) completed • 34 ms
[2023-03-01 19:00:15.734] [  6c3] GitProviderService.onWindowStateChanged(e=focused=true)
[2023-03-01 19:00:15.735] [  6c3] GitProviderService.onWindowStateChanged(e=focused=true) completed • 0 ms

@eamodio
Copy link
Member

eamodio commented Mar 1, 2023

@sedghi Can you provide more details on exactly what you have open in VS Code, e.g. a single folder for a normal repo, single folder for a worktree, multi-root workspace, etc?

From the log provided it looks like GL thinks the repo opened is a worktree (or a repo with its .git folder elsewhere), so it is attempting to find the "main" repo which is is failing to do properly. Where do you have your worktree folder stored? Is it nested within the main repo?

Thanks!

@eamodio eamodio closed this as completed in 4891099 Mar 1, 2023
@sedghi
Copy link

sedghi commented Mar 1, 2023

I use a clone --bare for my repo locally, so I have the following tree (I hope that helps) - I've been using gitlens worktree from the time you added it to the plus, and it was working fine

image

@eamodio eamodio reopened this Mar 1, 2023
@axosoft-ramint
Copy link
Contributor

axosoft-ramint commented Mar 3, 2023

@sedghi Can you check if your gitlens.detectNestedRepositories setting is on (in your user or workspace settings)?

image

If it is, can you temporarily turn it off and check if it fixes the issue?

@sedghi
Copy link

sedghi commented Mar 5, 2023

it is not checked for me, it is off

@nekocom3745
Copy link

gitlens.detectNestedRepositoriesje

@sedghi
Copy link

sedghi commented Mar 6, 2023

I just noticed the Delete worktree doesn't work anymore too

@eamodio
Copy link
Member

eamodio commented Mar 7, 2023

@sedghi Can you see if the latest version (either stable or pre-release) fixes the issue for you?

@eamodio eamodio added bug Something isn't working and removed potential-bug labels Mar 7, 2023
@eamodio eamodio added this to the 13.3-patch milestone Mar 7, 2023
@sedghi
Copy link

sedghi commented Mar 7, 2023

No unfortunatellly,

clicking + results in

[2023-03-07 14:45:30.561] [  992] ViewCommands.createWorktree
[2023-03-07 14:45:30.569] [  997] W(/Users/alireza/dev/cornerstone3D-beta.git/feat/remaining-rtss).getMainRepository
[2023-03-07 14:45:30.572] [  998] GitProviderService.getOrOpenRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git), t={"detectNested":false,"force":true,"closeOnOpen":true})
[2023-03-07 14:45:30.572] [  999] GitProviderService.getRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git))
[2023-03-07 14:45:30.572] [  999] GitProviderService.getRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git)) returned undefined • 0 ms
[2023-03-07 14:45:30.573] [  998] GitProviderService.getOrOpenRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git), t={"detectNested":false,"force":true,"closeOnOpen":true}) returned undefined • 0 ms
[2023-03-07 14:45:30.573] [  997] W(/Users/alireza/dev/cornerstone3D-beta.git/feat/remaining-rtss).getMainRepository returned undefined • 3 ms
[2023-03-07 14:45:30.573] [  993] sh.execute — failed
Error: Missing repository

right clicking and delete

[2023-03-07 14:46:04.945] [  99b] ViewCommands.deleteWorktree(e=Zo(gitlens:repository(/Users/alireza/dev/cornerstone3D-beta.git/feat/remaining-rtss):worktree(/Users/alireza/dev/cornerstone3D-beta.git/feat/events-improv)), undefined)
[2023-03-07 14:46:04.949] [  9a0] W(/Users/alireza/dev/cornerstone3D-beta.git/feat/remaining-rtss).getMainRepository
[2023-03-07 14:46:04.950] [  9a1] GitProviderService.getOrOpenRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git), t={"detectNested":false,"force":true,"closeOnOpen":true})
[2023-03-07 14:46:04.950] [  9a2] GitProviderService.getRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git))
[2023-03-07 14:46:04.950] [  9a2] GitProviderService.getRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git)) returned undefined • 0 ms
[2023-03-07 14:46:04.951] [  9a1] GitProviderService.getOrOpenRepository(e=Uri(file:///Users/alireza/dev/cornerstone3D-beta.git), t={"detectNested":false,"force":true,"closeOnOpen":true}) returned undefined • 0 ms
[2023-03-07 14:46:04.951] [  9a0] W(/Users/alireza/dev/cornerstone3D-beta.git/feat/remaining-rtss).getMainRepository returned undefined • 1 ms
[2023-03-07 14:46:04.951] [  99c] sh.execute — failed
Error: Missing repository

@axosoft-ramint axosoft-ramint modified the milestones: 13.3-patch, 13.4 Mar 7, 2023
@axosoft-ramint
Copy link
Contributor

@sedghi Thanks for the info! Could you try the latest pre-release version (v2023.3.804 or later) of GitLens once more? We pushed an update to the pre-release since your last post that may have addressed this issue.

@sedghi
Copy link

sedghi commented Mar 8, 2023

It worked!

@axosoft-ramint axosoft-ramint added pending-release Resolved but not yet released to the stable edition verified ✔ Verified area-worktrees Issues or features related to worktrees and removed needs-more-info Needs further information, steps, details, etc. labels Mar 8, 2023
@axosoft-ramint
Copy link
Contributor

Fixed in commit: d8993ee

@eamodio eamodio removed the pending-release Resolved but not yet released to the stable edition label Mar 16, 2023
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-worktrees Issues or features related to worktrees bug Something isn't working verified ✔ Verified
Projects
None yet
Development

No branches or pull requests

6 participants