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

clone: Allow cloning a repo that doesn't have a parent (a personal "blessed" repo) #43

Open
mihails-strasuns-sociomantic opened this issue Oct 14, 2013 · 7 comments · May be fixed by #293

Comments

@mihails-strasuns-sociomantic

Traceback:

Traceback (most recent call last):
  File "/usr/bin/git-hub", line 1534, in <module>
    main()
  File "/usr/bin/git-hub", line 1528, in main
    args.run(parser, args)
  File "/usr/bin/git-hub", line 616, in run
    repo_url = repo['parent'][config.urltype]
KeyError: 'parent'

Problem is that own repo is not a fork and thus can't have upstream/parent

@leandro-lucarella-sociomantic
Copy link
Contributor

Could you add the clone invocation you used for completeness?

@leandro-lucarella-sociomantic
Copy link
Contributor

Also, what would you expect in this situation? To succeed and set your own repo as upstream? To fail with a better error message? I don't think having no upstream makes sense, because most of the commands use it, so git hub wouldn't be very useful in that case.

@mihails-strasuns-sociomantic
Copy link
Author

Will having both origin and upstream same work? I'd love to keep git hub functionality of listing pulls and issues, as well as shorter URL typing via owner/repo even if it is my personal project / repository.

@leandro-lucarella-sociomantic
Copy link
Contributor

On Tue, Oct 15, 2013 at 10:17:46AM -0700, mihails-strasuns-sociomantic wrote:

Will having both origin and upstream same work? I'd love to keep
git hub functionality of listing pulls and issues, as well as
shorter URL typing via owner/repo even if it is my personal project
/ repository.

There is no "origin", I'm refering to the hub.upstream variable. I'm
not sure it will just work if you use your fork as hub.upstream out of
the box, but you are welcome to investigate :)

@mihails-strasuns-sociomantic
Copy link
Author

but you are welcome to investigate :)

OK, will be one my TODO list.

@leandro-lucarella-sociomantic
Copy link
Contributor

I'll rephrase the issue as a feature request then

@jwilk
Copy link
Contributor

jwilk commented Jul 15, 2015

For completeness, this is the invocation that failed for me:

$ git hub clone jwilk/didjvu
Forking jwilk/didjvu to jwilk/didjvu
Cloning [email protected]:jwilk/didjvu.git to didjvu
Traceback (most recent call last):
  File "/usr/bin/git-hub", line 2003, in <module>
    main()
  File "/usr/bin/git-hub", line 1997, in main
    args.run(parser, args)
  File "/usr/bin/git-hub", line 614, in check_config_and_run
    cmd.run(parser, args)
  File "/usr/bin/git-hub", line 799, in run
    remote_url = repo['parent'][config.urltype]
KeyError: 'parent'

OTOH cloning your own repo works if you omit the "owner/" part:

$ git hub clone didjvu
Warning: Repository jwilk/didjvu is not a fork, just clonning, upstream will not be set
Cloning [email protected]:jwilk/didjvu.git to didjvu

The latter doesn't set hub.upstream, even though it probably wouldn't hurt if it did.

@llucax llucax modified the milestones: Future, v2.2.0 Feb 14, 2021
@llucax llucax modified the milestones: v2.2.0, Future Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants