zielu / GitWorktree

Issue tracker for Git Worktree plugin
0 stars 0 forks source link

[BUG] Worktree Missing from Worktree View #8

Closed njlaw closed 2 months ago

njlaw commented 3 months ago

Describe the bug A clear and concise description of what the bug is.

A worktree is visible from the console with git worktree list, but does not appear in the Worktree tab.

To Reproduce Steps to reproduce the behavior:

  1. Go to Git Worktree Tab.
  2. Right click on current repository and select 'Add Worktree'
  3. Enter a new folder location, select an existing branch as the source (or leave the Source as HEAD and select the branch checkbox and enter a new branch name; both flows result in the issue for me)
  4. The worktree is created and can be seen on the filesystem and with git worktree list, but does not appear in the Git Worktree Tab in IntelliJ or WebStorm.

Expected behavior The worktrees visible with git worktree list shoud also be visible in the WebStorm Git Worktree tab.

Plugin version 1.0.4+231

IDE version

WebStorm 2024.1.3
Build #WS-241.17011.90, built on May 23, 2024
Licensed to **** / ****
Subscription is active until August 25, 2024.
Runtime version: 17.0.11+1-b1207.24 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.5.0-35-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 20
Registry:
  debugger.watches.in.variables=false
  debugger.new.tool.window.layout=true
  ide.experimental.ui=true
Non-Bundled Plugins:
  net.sf.opk.avro-schema-support (223.3.0)
  net.sjrx.intellij.plugins.systemdunitfiles (223.240127.136)
  org.intellij.plugins.hcl (241.17011.119)
  com.jetbrains.space (241.17011.48)
  com.github.zzehring.intellijjsonnet (0.2.1)
  Key Promoter X (2024.1.0)
  com.intellij.mermaid (0.0.22+IJ.232)
  com.intellij.kubernetes (241.17011.162)
  pro.bashsupport (4.1.3.241)
  com.intellij.ml.llm (241.17011.2)
  com.intellij.database (241.14494.180)
  zielu.gitworktree (1.0.4+231)
  zielu.gittoolbox (500.2.9+233)
Current Desktop: i3

This also affects IntelliJ for me:

IntelliJ IDEA 2024.1.2 (Ultimate Edition)
Build #IU-241.17011.79, built on May 22, 2024
Licensed to **** / ****
Subscription is active until August 25, 2024.
Runtime version: 17.0.11+1-b1207.24 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.5.0-35-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 3072M
Cores: 20
Registry:
  debugger.new.tool.window.layout=true
  ide.experimental.ui=true
  editor.minimap.enabled=true
Non-Bundled Plugins:
  net.sf.opk.avro-schema-support (223.3.0)
  uk.co.hadoopathome.intellij.avro.intellijavroviewer (3.1.0)
  aws.toolkit.core (3.9-241)
  com.jetbrains.space (241.17011.48)
  com.github.zzehring.intellijjsonnet (0.2.1)
  com.intellij.guice (241.14494.158)
  net.ashald.envfile (3.4.2)
  pro.bashsupport (4.1.3.241)
  com.intellij.ml.llm (241.17011.2)
  com.haulmont.jpab (241.15989.21)
  org.mapstruct.intellij (1.7.0)
  zielu.gitworktree (1.0.4+231)
  zielu.gittoolbox (500.2.9+233)
  aws.toolkit (3.9-241)
Kotlin: 241.17011.79-IJ
Current Desktop: i3

Screenshots image image

zielu commented 2 months ago

Hi, so it does not work even after reopening the project, correct ?

njlaw commented 2 months ago

Hi Łukasz, that is correct. Closing and reopening the project does not make a difference.

zielu commented 2 months ago

Ok, so I need to create release with more logging to find the root cause. I'll let you know when it's ready.

zielu commented 2 months ago

I released version with more logging to plugin test channel. You can download it from here https://plugins.jetbrains.com/plugin/23813-git-worktree/versions/test

  1. To install - Settings > Plugins > "Cog icon" > Install plugin from disk
  2. Enable additional logging - Help > Diagnostic tools > Debug log settings > Add zielu.gitworktree:trace
  3. Reopen project and open Worktrees view
  4. Next open logs - Help > Show log or Open log
  5. Find entries from zielu.gitworktree category and please share them (you can send them to plugins"at"lukasz-zielinski.com if you don't want to put them here)

There might also be some warnings coming from zielu.gitworktree now, because I was missing logs in case when git command would fail.

njlaw commented 2 months ago

Thank you! The only zielu.gitworktree log lines that show up are:

2024-06-12 14:30:42,183 [  51316]   WARN - #zielu.gitworktree.git - List worktree failed: unknown switch `z'
usage: git worktree add [<options>] <path> [<commit-ish>]
or: git worktree list [<options>]
or: git worktree lock [<options>] <path>
or: git worktree move <worktree> <new-path>
or: git worktree prune [<options>]
or: git worktree remove [<options>] <worktree>
or: git worktree unlock <path>

--porcelain           machine-readable output
-v, --verbose         show extended annotations and reasons, if available
--expire <expiry-date>
add 'prunable' annotation to worktrees older than <time>
zielu commented 2 months ago

Ok, looks like this is what I was looking for. Could you also do git --version ?

njlaw commented 2 months ago

git version 2.34.1

I also skipped your instructions to enable trace logging, so I'll do that as well and post the results.

zielu commented 2 months ago

I think thats enough - I need to update how worktree list is callled to take into account that -z might not be there

zielu commented 2 months ago

-z was added around git 2.36

zielu commented 2 months ago

I pushed 1.0.6 to test channel - it should be fine now. If it's ok, it will go to regular release channel.

njlaw commented 2 months ago

1.0.6 is working for me.

image

Thank you kindly!

zielu commented 2 months ago

Perfect, thanks for checking !