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

Cannot clone non-github repository #74

Closed
martinus opened this issue Feb 3, 2023 · 3 comments · Fixed by #81
Closed

Cannot clone non-github repository #74

martinus opened this issue Feb 3, 2023 · 3 comments · Fixed by #81
Assignees

Comments

@martinus
Copy link

martinus commented Feb 3, 2023

Is ghr supposed to support non-github repositories? I tried to do

ghr clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

But I get the error

ERROR failed to resolve path '/home/martinus/.ghr/git.kernel.org/pub/scm': No such file or directory; class=Os (2); code=NotFound (-3)
@siketyan
Copy link
Owner

siketyan commented Feb 3, 2023

@martinus
Thank you for trying ghr and reporting this.
Of course supporting non-GitHub repos is in the objective, but ghr expects /[org]/[repo].git style paths.

Supporting other style paths is tracked in #45.
I am going to priotrise this issue.

@martinus
Copy link
Author

martinus commented Feb 3, 2023

good to hear, thank you!

@siketyan
Copy link
Owner

Hi @martinus, we have just published v0.3.2, a new version of ghr, including support of additional patterns for cloning.

Since ghr is oriented to manage repositories in host -> owner -> repo structure, ghr needs to identify which part in URL specifies host, owner, or repo. Thus we need to configure a pattern in regex in ~/.ghr/ghr.toml.

This is the example configuration to clone torvalds/linux:

[[patterns]]
regex = "^(?P<scheme>https)://(?P<host>git\\.kernel\\.org)/pub/scm/linux/kernel/git/(?P<owner>.+)/(?P<repo>.+)\\.git"

If there are any question(s), feel free to write here or open a new issue.
Thank you for using ghr!

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

Successfully merging a pull request may close this issue.

2 participants