You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While git log features work and basic history searching seems functional, it seems that my current system creates a strange behavior where the path is being referenced to as the wrong relative path. This is probably system dependent as I have a docker/podman container (technically distrobox container) that I run visual studio code within that has a unique home folder. I symlink to my "real" code folder from my host home. Since paths are not canonicalized by this plugin, it cannot determine that the two paths point to same git directory (git itself does not seem to like this either.)
I have an overly complex setup compared to most users so the problem is likely not urgent, but it's worth knowing that symlinks might create strange behavior for users who have complex needs due to their system configuration (in my case, I'm using an immutable operating system where pet containers are a necessity.) VSCode seems to automatically canonicalize the paths to when dealing with git, but the behavior is not matched by the plugin which attempts to keep relative pathing but to the wrong folder structure. If I bypass the symlink by going directly to the target directory, this problem is resolved but it's a minor inconvenience.
Steps To Reproduce
On linux systems, you could do something akin to the following:
Install distrobox, create a custom home for an ubuntu image. See distrobox for more details. Custom home should be a location like ~/.container_hom/vscode_home.
Install vs code as one would for ubuntu using the deb file and running apt install ./code_****.deb. Install this plugin.
Symlink your code folder (lets say host ~/Code) to your guest system's home (canonical path ~/container_home/vscode_home/Code). Open your project through that symlinked path.
Try to view file history after viewing general git history. You'll see an output akin to the below:
git rev-list --full-history --count master -- (completed in 0.277s)
git log --full-history --pretty=oneline --date-order --decorate=full --skip=0 --max-count=100 master -- (completed in 0.31s)
git shortlog -e -s -n HEAD (completed in 0.366s)
git rev-list --full-history --count master -- ../../../../../Code/godot/repo/core/object/worker_thread_pool.cpp (completed in 0.009s)
fatal: ../../../../../Code/godot/repo/core/object/worker_thread_pool.cpp: '../../../../../Code/godot/repo/core/object/worker_thread_pool.cpp' is outside repository at '/home/eoin/Code/godot/repo'
git log --full-history --pretty=oneline --date-order --decorate=full --skip=0 --max-count=100 master --follow -- ../../../../../Code/godot/repo/core/object/worker_thread_pool.cpp (completed in 0.07s)
fatal: ../../../../../Code/godot/repo/core/object/worker_thread_pool.cpp: '../../../../../Code/godot/repo/core/object/worker_thread_pool.cpp' is outside repository at '/home/eoin/Code/godot/repo'
Conversely, opening the canonical path of the folder directly will work as expected (in my case, opening ~/Code/godot/repo works but opening ~/.container_home/vscode_home/Code/godot/repo does not.)
Expected Behavior
Ideally both paths would be canonicalized and then forced to be relative to the git repository. In the above example, the path should be made relative to /home/eoin/Code/godot/repo. If this cannot be done, then the file is not part of the project and the ability to view the file log should error stating such.
The text was updated successfully, but these errors were encountered:
Eoin-ONeill-Yokai
changed the title
[BUG] Relative paths inexplicably, perhaps related to using code in docker "container" environment?
[BUG] Relative paths inexplicably cause file history to fail in symlinked folder circumstances.
Dec 13, 2023
Describe the Bug
While git log features work and basic history searching seems functional, it seems that my current system creates a strange behavior where the path is being referenced to as the wrong relative path. This is probably system dependent as I have a docker/podman container (technically
distrobox
container) that I run visual studio code within that has a unique home folder. I symlink to my "real" code folder from my host home. Since paths are not canonicalized by this plugin, it cannot determine that the two paths point to same git directory (git itself does not seem to like this either.)I have an overly complex setup compared to most users so the problem is likely not urgent, but it's worth knowing that symlinks might create strange behavior for users who have complex needs due to their system configuration (in my case, I'm using an immutable operating system where pet containers are a necessity.) VSCode seems to automatically canonicalize the paths to when dealing with git, but the behavior is not matched by the plugin which attempts to keep relative pathing but to the wrong folder structure. If I bypass the symlink by going directly to the target directory, this problem is resolved but it's a minor inconvenience.
Steps To Reproduce
On linux systems, you could do something akin to the following:
~/.container_hom/vscode_home
.apt install ./code_****.deb
. Install this plugin.~/container_home/vscode_home/Code
). Open your project through that symlinked path.~/Code/godot/repo
works but opening~/.container_home/vscode_home/Code/godot/repo
does not.)Expected Behavior
Ideally both paths would be canonicalized and then forced to be relative to the git repository. In the above example, the path should be made relative to
/home/eoin/Code/godot/repo
. If this cannot be done, then the file is not part of the project and the ability to view the file log should error stating such.Environment
The text was updated successfully, but these errors were encountered: