jupyterhub / nbgitpuller

Jupyter server extension to sync a git repository one-way to a local path
https://nbgitpuller.readthedocs.io
BSD 3-Clause "New" or "Revised" License
212 stars 86 forks source link

Detect repo url from file / directory. Or allow to pull only part of a repo. #270

Open markperri opened 2 years ago

markperri commented 2 years ago

Proposed change

I have some users who try to pull one file or a directory from a repo. This doesn't work and just gives ValueError: Problem accessing HEAD branch. It would be nice if the nbpuller could derive the repo url from the file or directory and pull the entire repo.

Alternative options

It would be even better if it would just pull the file / directory requested, but I don't know how it would reconcile with further requests without a .git directory.

Who would use this feature?

Users who are unfamiliar with git and try to use it like Google Drive.

(Optional): Suggest a solution

I don't know if github provides an api to get the repo url from a file, but I suppose just deleting paths from right to left and adding .git then trying to clone it would be a brute force way.

welcome[bot] commented 2 years ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada: