bgreenlee / sublime-github

Sublime Text 2/3 plugin that provides a number of useful commands for GitHub.
MIT License
455 stars 98 forks source link

fix subst drive paths on Windows #126

Open adamkerz opened 1 year ago

adamkerz commented 1 year ago

On Windows, if you use subst to create a new drive from a subpath of another drive, some software resolves paths back to the previous drive and others don't.

Sublime doesn't, but git does, it appears.

Eg: D:\development\my_repo\architecture\models.py in Sublime gets turned into C:\d_drive\development\my_repo\architecture\models.py by git. To be more correct, running git rev-parse --show-toplevel returns C:\d_drive\development\my_repo which is clearly NOT a prefix of D:\development\my_repo\architecture\models.py and this breaks the relative file path calc in the RemoteUrlCommands.

adamkerz commented 1 year ago

Unfortunately, os.path.realpath DIDN'T resolve the path through subst paths until python3.8, so this necessitates an "upgrade" to py3.8, meaning Sublime4+ support only. Technically, the plugin should still work fine on older versions of sublime as the os.path function still exists and the .python-version file is ignored, but the bug won't be fixed on older versions. This is the obscure end of an obscure wedge...