nbgitpuller
nbgitpuller copied to clipboard
Remove suffix from repo folder
When cloning a Git project .git suffix is repository URL is kept what results in the creation of a folder named repository_name.git.
That PR proposes to remove that .git suffix.
Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct.
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:
Thank you for the PR, @ctriquet-cs!
One question I have now is about backwards compatibility - what would happen in cases when the repo was previously already cloned with the .git prefix, and now that gets stripped out? That may lead to a new clone instead of just updating the currently existing clone, which may be alarming to the user if they have already done some work on the existing clone.
I think we can make this behavior backwards compatible in the following way:
- If
.gitis present in the URL of the repo, but we don't have an existing clone on the filesystem, strip.git - If
.gitis present in the URL of the repo but we do have an existing clone on the filesystem including the.gitsuffix, let it be.
We'll probably also need a test added to catch this.
How does that sound, @ctriquet-cs?
@yuvipanda Sorry for the delay in my response. Yes, that sounds like a good idea to maintain backwards compatibility. I have made the necessary modifications and added the corresponding unit tests.