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

badly formatted git url for cloning from gitlab ? #73

Open
renal31 opened this issue Apr 19, 2021 · 0 comments
Open

badly formatted git url for cloning from gitlab ? #73

renal31 opened this issue Apr 19, 2021 · 0 comments

Comments

@renal31
Copy link

renal31 commented Apr 19, 2021

Hi,
Thanks for this tool that looks awesome !
I have an issue while trying to initiate a project with a template hosted on Gitlab.
For instance when I try this:

yh git://gitlab.com:renal31/py27-template.git
OR
yh https://gitlab.com:renal31/py27-template.git

I end up with following error:

git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git clone --depth=2 --single-branch -v git://gitlab.com:renal31/py27-template.git /home/renaud/.cache/gitfs2/repos/py27-template
  stderr: 'Cloning into '/home/renaud/.cache/gitfs2/repos/py27-template'...
Looking up gitlab.com:renal31 ... fatal: unable to look up gitlab.com:renal31 (port 9418) (Name or service not known)

I can workaround this error by doing:

git clone --depth=2 --single-branch -v [email protected]:renal31/py27-template.git /home/renaud/.cache/gitfs2/repos/py27-template
yh git://gitlab.com:renal31/py27-template.git

I also tried:

yh [email protected]:renal31/py27-template.git

But then I end up with following error:

Traceback (most recent call last):
  File "/home/renaud/.local/lib/python3.8/site-packages/moban/externals/file_system.py", line 37, in wrapper
    return function_in_this_module(*args, **kwds)
  File "/home/renaud/.local/lib/python3.8/site-packages/moban/externals/file_system.py", line 103, in read_unicode
    with open_file(path) as file_handle:
  File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/home/renaud/.local/lib/python3.8/site-packages/moban/externals/file_system.py", line 73, in open_file
    the_fs = fs.open_fs(dir_name)
  File "/home/renaud/.local/lib/python3.8/site-packages/fs/opener/registry.py", line 229, in open_fs
    _fs, _path = self.open(
  File "/home/renaud/.local/lib/python3.8/site-packages/fs/opener/registry.py", line 186, in open
    open_fs = opener.open_fs(fs_url, parse_result, writeable, create, cwd)
  File "/home/renaud/.local/lib/python3.8/site-packages/fs/opener/osfs.py", line 40, in open_fs
    osfs = OSFS(path, create=create)
  File "/home/renaud/.local/lib/python3.8/site-packages/fs/osfs.py", line 141, in __init__
    raise errors.CreateFailed(message)
fs.errors.CreateFailed: root path '/home/renaud/workspace/python/gitlab.com:renal31/py27-template.git' does not exist

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/renaud/.local/lib/python3.8/site-packages/yehua/main.py", line 59, in main
    yehua = cookiecutter_json_to_yehua_file(yehua_file)
  File "/home/renaud/.local/lib/python3.8/site-packages/yehua/cookiecutter_to_yehua.py", line 17, in cookiecutter_json_to_yehua_file
    content = read_unicode(url_join(path, "cookiecutter.json"))
  File "/home/renaud/.local/lib/python3.8/site-packages/moban/externals/file_system.py", line 41, in wrapper
    raise exceptions.FileNotFound(args[0])
moban.exceptions.FileNotFound: [email protected]:renal31/py27-template.git/cookiecutter.json

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/renaud/.local/bin/yh", line 8, in <module>
    sys.exit(main())
  File "/home/renaud/.local/lib/python3.8/site-packages/yehua/main.py", line 63, in main
    project = Project(yehua_file)
  File "/home/renaud/.local/lib/python3.8/site-packages/yehua/project.py", line 17, in __init__
    raise Exception("%s does not exist" % yehua_file)
Exception: [email protected]:renal31/py27-template.git does not exist

I do not get such issue while getting templates from Github...
I think it worth fixing this behaviour.

Thanks again for this great work !
Renaud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant