nbgitpuller icon indicating copy to clipboard operation
nbgitpuller copied to clipboard

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

Open nthiery opened this issue 4 years ago • 0 comments

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)

nthiery avatar Aug 29 '21 06:08 nthiery