gh browse relative path enhancement #4007
Conversation
Don't think i would recommend supporting backslash as folder delimiter as this introduces inconsistencies between the shells. I would personally prefer the root folder to be the default is it is now and explicitly denote relative paths with |
Thanks for all of the feedback! I included both
Interesting, I also like this idea a lot but I would like another opinion. I'm not sure if this would make this feature too complex or not
I still need to test the |
@vilmibm will have better ideas, but just wanted to mention that you should probably take a look at using path/filepath in the Go standard library to help handle cross-platform file path issues. The first time I used this package, it was kind of life changing. There's this Stack Overflow answer too. |
The design of this seems good to me, but as @chemotaxis mentioned this PR should be making use of the Definitely check out the file separator stuff since it'll give you cross platform support for free. Also consider making use of helpers like |
To open the folder I'm in, |
This reverts commit 5e3ca02.
…p)', parent folder '..(path sep)', absolute 'folder | filename'
current folder '.', from current folder '.(pathsep)', parent folder '..(path sep)', absolute 'folder | filename'
Just bumping this, I revised the pr description at the top to show the current functionality. Looking forward to feedback on the new approach. |
Fixes #3952
gh browse
enhancement that allows users to use relative paths when opening the browser.assuming cli is the repository root
current functionality
new functionality
relative for linux
new functionality (
(s)
= operating system's path separator)current folder =
.
from current folder =
.(s)
parent folder =
..(s)
absolute =
folder | filename