Troubleshooting libgit2

I am trying to troubleshoot libgit2 failing behind a proxy (see Pkg.add() through proxy fails on Julia 0.5, Windows). I am looking through the libgit2 functions (https://github.com/JuliaLang/julia/tree/master/base/libgit2) to try to find some way to find out what proxy libgit2 is grabbing from gitconfig. I am confused by the different types and not sure which functions (if any) will accomplish my goal. Can someone point me in the right direction?

1 Like

Is this more of a development question? It seems to me it’s about usage but perhaps the people involved in the development of the libgit2 support would be a good resource.

All of the config should happen automatically. I just verified that it does, at least in a test rig, with Julia 0.5 on an IEEdge Windows VM. I set VirtualBox to allow only local traffic and installed squid 3 from homebrew (with default config except for dns_nameservers 8.8.8.8 8.8.4.4).

Config file at C:\Users\IEUsers\.gitconfig with contents:

[url "https://github.com/"]
    insteadOf = git://github.com/
[https]
    proxy = http://[vboxnet0 host IP]:3128
[http]
    proxy = http://[vboxnet0 host IP]:3128

(replace [vboxnet0 host IP] with your proxy server details)
Note that the standard git-bash client uses the same config file, so you could install it as well and cross-test.

I am confused by the different types and not sure which functions (if any) will accomplish my goal. Can someone point me in the right direction?

libgit2 is written in C, so I can only point you to the source code. libgit2 proxy-related functionality is not currently wrapped, except for a type stub for git_proxy_options. There is a function to set it manually (git_proxy_init_options), ref. If you want to see what happens in libgit2 internally, grep for the above keywords and some others like apply_proxy_config and git_proxy_t.

libgit2 should eventually be able to detect and use system-level Windows proxy config automatically.

Is this more of a development question? It seems to me it’s about usage but perhaps the people involved in the development of the libgit2 support would be a good resource.

The intersection of the sets “people who use Windows” and “people who develop Julia” is essentially empty.

4 posts were split to a new topic: Windows usage questions

Cross-ref suggestion from another thread: don’t use credentials, if you can avoid it:

0.6 definitely is different. Now though, I get a different error:

GitError(Code:ERROR, Class:OS, failed to send request: The operation timed out).

Should I open a separate thread?

(I moved over to the topic you started)

Does your proxy server require authentication?
Does GitHub desktop work for you? Or one of the other libgit2-based projects? If so then you can try to figure out what they are doing differently.