Skip to content

Document possible values of CloneOptions #330

Closed

Description

@fatso83

I have given up trying to get this library working due to not being able to simply clone a public GH repo. The solution seems to lie somewhere in CloneOptions, but this options object seems totally undocumented, apart from referencing its C-type. Looking up git_clone_options, I cannot seem to find even the options mentioned in the examples.

This example uses { ignoreCertErrors: 1}), but I cannot seem to find any such thing mentioned in the C documentation.

Currently, trying to check out a public repo just leaves me with an error, and no way to solve it:

nodegit.Clone.clone("git@github.com:nodegit/nodegit", path.toString(), null)
.then(0, function(err){
    console.log(err); // ==> 'authentication required but no callback set'
})

I am not the only one left in confusion either.

Activity

  1. tbranyen commented on Dec 22, 2014

    @tbranyen
    Member

    @fatso83 as you are probably already aware this isn't a corporate-funded project that has loads of contributors and developers working on it every day. If you were frustrated and unable to figure out how to get this working, you could have opened a more friendly issue or visited us in our Gitter chat room for support: https://gitter.im/nodegit/nodegit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge

    ignoreCertErrors is absolutely documented in libgit2 here:
    https://libgit2.github.com/libgit2/#v0.21.3/type/git_clone_options but it's not the option you need.

    If you read our unit tests you'll see exactly how to clone a Git(protocol) repository:
    https://github.com/nodegit/nodegit/blob/master/test/tests/clone.js#L49-L58

    We'll get around to documenting them when we do, if it's not fast enough, we'd love your contributions and research.

  2. fatso83 commented on Jan 29, 2015

    @fatso83
    Author

    @tbranyen You are absolutely right that issue was frased in a bit of a douchy way, and I am sorry for the brash tone. I am also working on open source projects, so I can relate to the feeling of giving to a community that just demands, when you do this in your spare time.

    That being said: I don't understand why the issue was closed, since CloneOptions is still undocumented. Maybe you have another issue for documentation with sub-issues for each undocumented thing?

    You say ignoreCertErrors is absolutely documented on the page you linked, but searching for either "cert" or "ignore" does not show any meaningful documentation I can relate to ignoreCertErrors on that page. Wrong link?

    Anyway, the example from the unit tests is fine, so thank you for that. How can one contribute the the documentation page?

  3. johnhaley81 commented on Jan 29, 2015

    @johnhaley81
    Collaborator

    image

  4. tbranyen commented on Jan 29, 2015

    @tbranyen
    Member

    We also list all the options on the NodeGit website here on the left:

    Once we're able to, I'd like to expand the documentation to give example usage, but we haven't done that yet.

  5. fatso83 commented on Jan 30, 2015

    @fatso83
    Author

    @johnhaley81 Spooky. You are seeing a different version of the same url. When I open the url above for version 0.21.3 there is no mention of any ignore_cert_errors (see screenshot below)! But I can see that you have the exact same url open. Could it be that you are seeing some kind of draft mode that has not been published? It's present in the HEAD revision, though.

    v.0.21.3
    HEAD

    Thanks for making me aware of the side panel; I just looked at the main content for CloneOptions after clicking on the link, unaware of extra links that emerged onclick. But it seems a bit weird that all the documentation consists of is a link that opens up no further information. This is not meant as a critique of you not having time to fill out documention, just that the functionality of the documentation page is a bit unconventional :-)

  6. maxkorp commented on Jan 30, 2015

    @maxkorp
    Collaborator

    O.O
    I see it under 0.21.3 as well. Docurium (their generator) is weird and fairly inconsistent in my experience, but they have to push those changes upstream to the gh-pages branch on github (it commits to the branch locally automatically), and I don't see anything indicating that the 21.3 stuff changed in their pages history. Rather than a draft/preview, I'd be more skeptical that somehow the URI didn't update properly (so you were seeing 0.21.2 or something, even though the URI said 0.21.3. Whatever it is, it's weird. Do you get that result consistently? Dare I suggest unplugging your cache and plugging it back in again? That's just about the only other thing I can think of.

    Re: docs: We have to do a little work on opening things up a bit, but the repo is here (https://github.com/nodegit/nodegit.github.com), and anything you can do to make it more accurate or more intuitive would be a welcome PR. That said, it uses generated output from nodegit to make it work, so you'll have to work with both projects.

  7. fatso83 commented on Jan 30, 2015

    @fatso83
    Author

    I always get the same result when visiting the url: no mention of ignore_certificate_error. I tried opening in Chrome, Chrome Incognito Mode, Firefox and Safari.

    Maybe it could be the Level 3 CDN not propagating the changes to all the nodes?

  8. johnhaley81 commented on Jan 30, 2015

    @johnhaley81
    Collaborator

    Wow, that's really weird. We should open up a ticket on libgit2/libgit2.github.com but I have no idea how to repro this.

  9. fatso83 commented on Jan 30, 2015

    @fatso83
    Author

    @johnhaley81 : I contacted GH about the issue just to notify them. My bet is that it's their infrastructure that has the hiccups, so I guess they should look into it before you do anything more :-)

  10. johnhaley81 commented on Jan 30, 2015

    @johnhaley81
    Collaborator

    Oh ok, I was beginning to think we were being A/B tested in a bad way or something.

  11. fatso83 commented on Feb 4, 2015

    @fatso83
    Author

    Not sure if I should report this in a separate issue, but I am following up "the case of the missing docs". I seem to be able to reproduce the behaviour, and it has nothing to do with the Level 3 CDN (for which GH have refreshed their caches), but rather the Backbone SPA the page is made up from. What got me on track was trying to browse the page on my mobile, and actually seeing the ignore_certificate_errors on the 0.21.3 page.

    I still could not see it when going to the link directly, so two different ways of accessing the same url gave different results. Examining the network traffic and noticing that a small json file was sent over the wire: v0.21.3.json, I looked at that file, and lo and behold: it did contain the ignore_certificate_errors property. So why doesn't the page show it to me?

    From the network traffic (I haven't looked at the JS), I am guessing this is what's happening:

    • The SPA is first loading the default page (using the HEAD.json to fill the content)
    • Then when the page has loaded it fills the "Version : v0.21.3" field, but does not update the main content with the values from v0.21.3.json.

    Maybe I'm a bit off on the loading and logic, but at least I can reproduce this consistently, and I don't have to resort to magic explanations about the CDN :-)

  12. johnhaley81 commented on Feb 4, 2015

    @johnhaley81
    Collaborator

    Wow! That's crazy. So that's a bug in libgit2's doc page then. Open an issue there and reference this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions