-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Allow path relative-to to use parent directory symbols #14055
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
base: main
Are you sure you want to change the base?
Conversation
Hi, thank you for your contribution! |
I added a single test example that targets this feature, should I add more? |
Thank you for your contribution! After looking into the pr, and relative issue. I think it's better to make it as a opt-in flag. Can you please add a flag for the new behavior? I think > 'a/b/c' | path relative-to 'a/d/e' # still raise error
> 'a/b/c' | path relative-to 'a/d/e' --walkup # returns ../../b/c |
@WindSoilder is there a specific concern why Python locks that behind a kwarg? Are there situations where it is problematic in certain ways or was it just added on pythons side to preserve backwards-compatibiliity? |
After looking into relative pr: python/cpython#118780 |
It was added in python/cpython#19813 to satisfy python/cpython#84538 which requested it to be hidden behind a switch. The behavioral difference was whether symlinks are resolved in the process. Haven't thought through how that may affect us? With the current impl there is no attempt at resolving links or hitting the file system. It just assumes clean Unix paths (do we need to consider Windows specialties here?) |
Some other thoughts in neovim/neovim#31790 (comment) |
Description
Addresses #13969. Allows
path relative-to
to generate relative paths that use the parent directory..
within them. Also changes the error type to be slightly more informative than the previous one.User-Facing Changes
Tests + Formatting
Added test example:
'a/b/c' | path relative-to 'a/d/e'