jupyterhub / jupyterhub/nbgitpuller

The .git extension of certain git repo urls should not propagate to targetPath and urlPath default values

Open
#205 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
237
Forks
86
PR merge metrics
No merged PRs in 30d

Description

### Bug description

Consider a git url such as https://gitlab.u-psud.fr/Info111/ComputerLab.git, which is typical
from gitlab.

#### Expected behaviour

The normal behavior of `git clone` is to produce a directory called `ComputerLab`,
without the .git extension. One would expect nbgitpuller to behave similarly.

#### Actual behaviour

Both nbgitpuller and nbgitpuller's url generator keep the `.git` extension, in the targetPath and urlPath

### How to reproduce

1. Go to https://jupyterhub.github.io/nbgitpuller/link?hub=https://datahub.berkeley.edu&repo=https://gitlab.u-psud.fr/Info111/ComputerLab.git
2. Check the produced URL
3. Replace the hub URL by your own
4. Try the produced URL
5. Check the name of the directory created

### Your personal set up

nbgitpuller 0.10.2
jupyterhub 1.3.0

### Work around

The problem can be worked around by setting explicitly targetPath and urlPath

### Note

Rather than stripping manually the .git extension, it could be safer and more general to ask git
for the directory name. This round-trip may be overkill though, especially for the url generator.

Thanks in advance! (and big kudos for nbgitpuller which makes distributing material to newbies
so much easier for them, and thus for us)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.