On Thu, 21 Sep 2017 03:43:52 +0100 peter green <plugw...@p10link.net> wrote: > It appears that git_remote_connect has added a new parameter called "proxy" > of type git_proxy_options in the second to last position. > > Unfortunately the documentation seems to be very thin on the ground. In > particular it says nothing about whether this new parameter can simply be set > to NULL or if it needs some other kind of handling. So I went digging in the > libgit2 source. > > git_remote_connect seems to do some kind of version check on the proxy > options if they are not null which suggests that they can be NULL. it then > passes them off to t->connect. > > Afaict for the standard transports t->connect will point to > git_smart__connect which passes the proxy options to git_proxy_options_dup > and fails if git_proxy_options_dup fails. > > And it appears that git_proxy_options_dup succeeds if the source is NULL > filling in a default set of proxy options. > > So it looks like it is safe to set the "proxy" parameter to NULL. > > ccing the libgit2 maintainers so they can check my analysis and preferablly > get some statements on this added to the documentation. > > I have tested that setting the new parameter to NULL makes the package build. > I have not tested it beyond that. I have uploaded the change to raspbian. >
That sounds good to me. Another data point is that NULL is indeed used a bunch of times in the tests: libgit2$ git grep git_remote_connect [..] tests/network/remote/local.c: cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH, NULL, NULL, NULL)); tests/network/remote/local.c: cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH, NULL, NULL, NULL)); tests/network/remote/local.c: cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH, NULL, NULL, NULL)); tests/network/remote/local.c: cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL, NULL, NULL)); Looking at `git blame` for that file, this leads me to this commit: https://github.com/libgit2/libgit2/commit/07bd3e57d9a9930727695be690c8757f79117d45 where that param was added and NULL was also added at the same time to a bunch of call-sites. So indeed your analysis seems correct. > No immediate intent to NMU in Debian but if I get positive feedback on the > patch I may do so later. > NMU sounds good to me too, feel free to do that. X -- GPG: ed25519/56034877E1F87C35 GPG: rsa4096/1318EFAC5FBBDBCE https://github.com/infinity0/pubkeys.git