Skip to content
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

Use filepath relative to repo root #24

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

juntyr
Copy link
Contributor

@juntyr juntyr commented Nov 12, 2024

Supersedes #22

The docs mention that the urlpath parameter is relative to the repository root (see https://litegitpuller.readthedocs.io/en/latest/index.html#parameters), which is currently not the case.

This PR fixes the code to interpret the urlpath parameter relative to the repository root, which is a breaking change. This behaviour is useful when the repo is not uploaded to a statically known path, e.g. by (in the future) uploading it to the currently opened working directory.

While we theoretically could detect paths starting with tree/ to get back the original behaviour, this would clash with folders named tree inside the repository. Opening a path outside the repo is still possible by giving an absolute path, e.g. /README.md (since absolute paths come out of a join unchanged and JupyterLab strips the leading slash).

Copy link

Binder 👈 Launch a Binder on branch juntyr/litegitpuller/relative-filepath

@brichet brichet added the bug Something isn't working label Nov 12, 2024
Copy link
Collaborator

@brichet brichet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @juntyr, this looks good

@brichet brichet merged commit fd07ac8 into jupyterlite:main Nov 14, 2024
21 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants