pass transport verbosity down to git_connect
PATCH 1/1 pass transport verbosity down to git_connect
While working in connect.c to perform non-blocking connections, I noticed calling "git fetch -v" was not causing the progress messages inside git_tcp_connect_sock to be emitted as I expected.
Looking at history, it seems connect_setup has never been called with the verbose parameter. Since transport already has a "verbose" field, use that field instead of another parameter in connect_setup.
---
Related, but independent of my other change to connect.c:
http://mid.gmane.org/[email protected]
("attempt connects in parallel for IPv6-capable builds")
transport.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
transport.c +6 -5
@@ -481,9 +481,10 @@ static int set_git_option(struct git_transport_options *opts,return 1 ; } -static int connect_setup (struct transport *transport,int for_push,int verbose) +static int connect_setup (struct transport *transport,int for_push) {struct git_transport_data *data = transport->data; +int flags = transport->verbose >0 ?CONNECT_VERBOSE :0 ;if (data->conn)return 0 ;
@@ -491,7 +492,7 @@ static int connect_setup(struct transport *transport, int for_push, int verbose) data->conn =git_connect (data->fd, transport->url, for_push ? data->options.receivepack : data->options.uploadpack, - verbose ?CONNECT_VERBOSE :0 ); + flags);return 0 ; }
@@ -501,7 +502,7 @@ static struct ref *get_refs_via_connect(struct transport *transport, int for_pusstruct git_transport_data *data = transport->data;struct ref *refs; -connect_setup (transport, for_push,0 ); +connect_setup (transport, for_push); get_remote_heads(data->fd[0], NULL, 0, &refs, for_push ? REF_NORMAL : 0, &data->extra_have,
@@ -536,7 +537,7 @@ static int fetch_refs_via_pack(struct transport *transport, args.update_shallow = data->options.update_shallow;if (!data->got_remote_heads) { -connect_setup (transport,0 ,0 ); +connect_setup (transport,0 );get_remote_heads (data->fd[0 ],NULL ,0 , &refs_tmp,0 ,NULL , &data->shallow); data->got_remote_heads =1 ;
@@ -812,7 +813,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_reif (!data->got_remote_heads) {struct ref *tmp_refs; -connect_setup (transport,1 ,0 ); +connect_setup (transport,1 );get_remote_heads (data->fd[0 ],NULL ,0 , &tmp_refs,REF_NORMAL ,NULL , &data->shallow);
Signature · 1 line
EW
Quoted 9 lines · Eric Wong
While working in
connect.cto perform non-blocking connections, I noticed calling "git fetch -v" was not causing the progress messages insidegit_tcp_connect_sockto be emitted as I expected.Looking at history, it seems
connect_setuphas never been called with the verbose parameter. Since transport already has a "verbose" field, use that field instead of another parameter inconnect_setup.
That makes sense, but...
transport.c static int set_git_option(struct git_transport_options *opts, · line 487
Quoted 5 lines
transport.c +2
-1-static int connect_setup (struct transport *transport,int for_push,int verbose) +static int connect_setup (struct transport *transport,int for_push) {struct git_transport_data *data = transport->data; +int flags = transport->verbose >0 ?CONNECT_VERBOSE :0 ;
Do we want to trigger this only for "transport->verbose > 1"?
Right now, "git fetch -v" gives us a verbose status table (i.e., includes up-to-date refs), but no more debugging than that. Should we reserve more debug-ish information like for "git fetch -vv"?
-Peff
Quoted 9 lines · Jeff King
transport.c static int set_git_option(struct git_transport_options *opts, · line 487
Quoted 5 lines · Eric Wong
transport.c +2
-1-static int connect_setup (struct transport *transport,int for_push,int verbose) +static int connect_setup (struct transport *transport,int for_push) {struct git_transport_data *data = transport->data; +int flags = transport->verbose >0 ?CONNECT_VERBOSE :0 ;Do we want to trigger this only for "
transport->verbose> 1"?
Quoted 3 lines
Right now, "git fetch -v" gives us a verbose status table (i.e., includes up-to-date refs), but no more debugging than that. Should we reserve more debug-ish information like for "git fetch -vv"?
I'm not sure, I've never used "-v" at all in the past with fetch.
On one hand, I suspect someone who looks up "-v" and uses it is likely
wondering: "why is it so slow?" At least, that's what I did before resorting to strace :)
On the other hand, I'm not sure if there's anything parsing the stderr out of "git fetch -v" right now. In that case, perhaps only changing "-vv" (and documenting it) is a better idea. I've always been of the opinion stderr is for humans and test suites, only; and not considered an interface somebody should be parsing.
For reference, "curl -v" includes connection info which I rely on all the time.
Junio:
I'm leaning towards putting the test into t/t5570-git-daemon.sh to avoid potential port conflicts if that's OK with you. It doesn't seem like we have a lot of fetch tests on the git://
at all.
Quoted 2 lines · Eric Wong
On the other hand, I'm not sure if there's anything parsing the stderr out of "git fetch -v" right now.
It would also affect end-user experience, depending on what new pieces of lines are emitted to the terminal. From "git fetch -v", I expect to see the transfer progress and the final listing of fetched and updated refs, and as long as the line "remote: Compressing objects" and the lines that follow do not get garbled, I would imagine it would be fine.
...
remote: Compressing objects: 100% (1195/1195), done.
remote: Total 1869 (delta 1551), reused 841 (delta 672) Receiving objects: 100% (1869/1869), 462.80 KiB | 0 bytes/s, done. Resolving deltas: 100% (1551/1551), completed with 335 local objects. From $over_there
* branch pu -> FETCH_HEAD
Quoted 2 lines
In that case, perhaps only changing
"-vv" (and documenting it) is a better idea.
I just reviewed the output that are protected by CONNECT_VERBOSE; they look somewhere between pure debugging aid (like the protocol dump that are shown by "fetch -vv") and progress display, and at least to me they are much closer to the latter than the former, in the sense that they are not _so_ annoying as the protocol dump that are clearly not meant for the end users, and that they say "I am looking up this host's address", "Now connecting to this host:port", etc.
So, I personally find this addtional output not _too_ bad if we give it with "fetch -v" (not limiting to "fetch -vv").
I dunno.
Quoted 11 lines · Junio C Hamano
I just reviewed the output that are protected by
CONNECT_VERBOSE; they look somewhere between pure debugging aid (like the protocol dump that are shown by "fetch -vv") and progress display, and at least to me they are much closer to the latter than the former, in the sense that they are not _so_ annoying as the protocol dump that are clearly not meant for the end users, and that they say "I am looking up this host's address", "Now connecting to this host:port", etc.So, I personally find this addtional output not _too_ bad if we give it with "fetch -v" (not limiting to "fetch -vv").
Yeah, I do not feel that strongly, and am OK if it is attached to a single "-v". I don't think we make any promises about scraping stderr, so it is really just about end-user experience. It is mostly just my gut feeling on what I'd expect based on other parts of git (especially "fetch -vv" in other circumstances).
-Peff
Quoted 11 lines · Jeff King
Quoted 9 lines · Junio C Hamano
I just reviewed the output that are protected by
CONNECT_VERBOSE; they look somewhere between pure debugging aid (like the protocol dump that are shown by "fetch -vv") and progress display, and at least to me they are much closer to the latter than the former, in the sense that they are not _so_ annoying as the protocol dump that are clearly not meant for the end users, and that they say "I am looking up this host's address", "Now connecting to this host:port", etc.
Quoted 8 lines
Quoted 2 lines
So, I personally find this addtional output not _too_ bad if we give it with "fetch -v" (not limiting to "fetch -vv").
Yeah, I do not feel that strongly, and am OK if it is attached to a single "-v". I don't think we make any promises about scraping stderr, so it is really just about end-user experience. It is mostly just my gut feeling on what I'd expect based on other parts of git (especially "fetch -vv" in other circumstances).
Yeah, after re-reading the messages in this thread, I realize that I missed the fact that you do consider these CONNECT_VERBOSE messages as debugging aid and from that point of view "fetch -v" that shows these messagse in addition to what you get from "fetch" may be a bad idea.
But after inspecting what CONNECT_VERBOSE would add to the output, I am inclined to say that, especially if some of these steps can exhibit multi-second stalls, they fall more into the "progress indicator" (aka "do not worry, we are not stuck, be patient") category than "debugging aid" category. The former includes "remote: Counting objects..." that is shown by default (you need to give --quiet to squelch). So I think it is OK to show the CONNECT_VERBOSE messages with "fetch -v"; if somebody feels strongly that these messages should be shown unless --quiet is given, I might even be persuaded to agree, but I am not that somebody, so...
Quoted 11 lines · Junio C Hamano
Yeah, after re-reading the messages in this thread, I realize that I missed the fact that you do consider these
CONNECT_VERBOSEmessages as debugging aid and from that point of view "fetch -v" that shows these messagse in addition to what you get from "fetch" may be a bad idea.But after inspecting what
CONNECT_VERBOSEwould add to the output, I am inclined to say that, especially if some of these steps can exhibit multi-second stalls, they fall more into the "progress indicator" (aka "do not worry, we are not stuck, be patient") category than "debugging aid" category.
OK, I can buy that line of reasoning (and I agree it implies showing with a single "-v").
-Peff
Quoted 4 lines · Eric Wong
While working in
connect.cto perform non-blocking connections, I noticed calling "git fetch -v" was not causing the progress messages insidegit_tcp_connect_sockto be emitted as I expected.
Nice. Can we demonstrate and protect this fix with simple tests?
Thanks. Will queue.
Quoted 55 lines
transport.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)transport.c +6
-5@@ -481,9 +481,10 @@ static int set_git_option(struct git_transport_options *opts,return 1 ; } -static int connect_setup (struct transport *transport,int for_push,int verbose) +static int connect_setup (struct transport *transport,int for_push) {struct git_transport_data *data = transport->data; +int flags = transport->verbose >0 ?CONNECT_VERBOSE :0 ;if (data->conn)return 0 ;@@ -491,7 +492,7 @@ static int connect_setup(struct transport *transport, int for_push, int verbose) data->conn =git_connect (data->fd, transport->url, for_push ? data->options.receivepack : data->options.uploadpack, - verbose ?CONNECT_VERBOSE :0 ); + flags);return 0 ; }@@ -501,7 +502,7 @@ static struct ref *get_refs_via_connect(struct transport *transport, int for_pusstruct git_transport_data *data = transport->data;struct ref *refs; -connect_setup (transport, for_push,0 ); +connect_setup (transport, for_push); get_remote_heads(data->fd[0], NULL, 0, &refs, for_push ? REF_NORMAL : 0, &data->extra_have,@@ -536,7 +537,7 @@ static int fetch_refs_via_pack(struct transport *transport, args.update_shallow = data->options.update_shallow;if (!data->got_remote_heads) { -connect_setup (transport,0 ,0 ); +connect_setup (transport,0 );get_remote_heads (data->fd[0 ],NULL ,0 , &refs_tmp,0 ,NULL , &data->shallow); data->got_remote_heads =1 ;@@ -812,7 +813,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_reif (!data->got_remote_heads) {struct ref *tmp_refs; -connect_setup (transport,1 ,0 ); +connect_setup (transport,1 );get_remote_heads (data->fd[0 ],NULL ,0 , &tmp_refs,REF_NORMAL ,NULL , &data->shallow);
PATCH v2 1/1 pass transport verbosity down to git_connect
Quoted 1 line · Junio C Hamano
Nice. Can we demonstrate and protect this fix with simple tests?
I just added the tests to t5570 since we don't use git://
much in the tests and I didn't want to introduce potential port conflicts.
----------------8<----------------
Subject: [PATCH] pass transport verbosity down to git_connect
While working in connect.c to perform non-blocking connections, I noticed calling "git fetch -v" was not causing the progress messages inside git_tcp_connect_sock to be emitted as I expected.
Looking at history, it seems connect_setup has never been called with the verbose parameter. Since transport already has a "verbose" field, use that field instead of another parameter in connect_setup.
v2: add "-v" tests for clone/fetch/pull to t5570-git-daemon.sh
--- t/t5570-git-daemon.sh | 25 +++++++++++++++++++++++-- transport.c | 11 ++++++----- 2 files changed, 29 insertions(+), 7 deletions(-)
t/t5570-git-daemon.sh +23 -2
@@ -6,6 +6,13 @@ test_description='test fetching over git protocol' . "$TEST_DIRECTORY"/lib-git-daemon.sh start_git_daemon +check_verbose_connect () { + grep -qF "Looking up 127.0.0.1 ..." stderr && + grep -qF "Connecting to 127.0.0.1 (port " stderr && + grep -qF "done." stderr && + rm stderr +} + test_expect_success 'setup repository' ' git config push.default matching && echo content >file &&
@@ -24,18 +31,32 @@ test_expect_success 'create git-accessible bare repository' ' ' test_expect_success 'clone git repository' ' - git clone "$GIT_DAEMON_URL/repo.git" clone && + git clone -v "$GIT_DAEMON_URL/repo.git" clone 2>stderr && test_cmp file clone/file ' +test_expect_success 'clone -v stderr is as expected' check_verbose_connect + test_expect_success 'fetch changes via git protocol' ' echo content >>file && git commit -a -m two && git push public && - (cd clone && git pull) && + (cd clone && git pull -v) 2>stderr && test_cmp file clone/file ' +test_expect_success 'pull -v stderr is as expected' check_verbose_connect + +test_expect_success 'no-op fetch -v stderr is as expected' ' + (cd clone && git fetch -v) 2>stderr && + check_verbose_connect +' + +test_expect_success 'no-op fetch without "-v" is quiet' ' + (cd clone && git fetch) 2>stderr && + ! test -s stderr +' + test_expect_success 'remote detects correct HEAD' ' git push public master:other && (cd clone &&
transport.c +6 -5
@@ -481,9 +481,10 @@ static int set_git_option(struct git_transport_options *opts,return 1 ; } -static int connect_setup (struct transport *transport,int for_push,int verbose) +static int connect_setup (struct transport *transport,int for_push) {struct git_transport_data *data = transport->data; +int flags = transport->verbose >0 ?CONNECT_VERBOSE :0 ;if (data->conn)return 0 ;
@@ -491,7 +492,7 @@ static int connect_setup(struct transport *transport, int for_push, int verbose) data->conn =git_connect (data->fd, transport->url, for_push ? data->options.receivepack : data->options.uploadpack, - verbose ?CONNECT_VERBOSE :0 ); + flags);return 0 ; }
@@ -501,7 +502,7 @@ static struct ref *get_refs_via_connect(struct transport *transport, int for_pusstruct git_transport_data *data = transport->data;struct ref *refs; -connect_setup (transport, for_push,0 ); +connect_setup (transport, for_push); get_remote_heads(data->fd[0], NULL, 0, &refs, for_push ? REF_NORMAL : 0, &data->extra_have,
@@ -536,7 +537,7 @@ static int fetch_refs_via_pack(struct transport *transport, args.update_shallow = data->options.update_shallow;if (!data->got_remote_heads) { -connect_setup (transport,0 ,0 ); +connect_setup (transport,0 );get_remote_heads (data->fd[0 ],NULL ,0 , &refs_tmp,0 ,NULL , &data->shallow); data->got_remote_heads =1 ;
@@ -812,7 +813,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_reif (!data->got_remote_heads) {struct ref *tmp_refs; -connect_setup (transport,1 ,0 ); +connect_setup (transport,1 );get_remote_heads (data->fd[0 ],NULL ,0 , &tmp_refs,REF_NORMAL ,NULL , &data->shallow);
Signature · 1 line
EW
[PATCH 2/1] support -4 and -6 switches for remote operations
Sometimes, it is necessary to force IPv4-only or IPv6-only operation on networks where name lookups may return a non-routable address and stall remote operations.
The ssh(1) command has an equivalent switches which we may pass when we run them.
rsync support is untouched for now since it is deprecated and scheduled to be removed.
--- Documentation/fetch-options.txt | 8 ++++++++ Documentation/git-push.txt | 7 +++++++ builtin/clone.c | 4 ++++ builtin/fetch.c | 4 ++++ builtin/push.c | 4 ++++ connect.c | 8 ++++++++ connect.h | 2 ++ http.c | 9 +++++++++ http.h | 1 + remote-curl.c | 19 +++++++++++++++++++ transport-helper.c | 7 +++++++ transport.c | 18 ++++++++++++++++++ transport.h | 11 +++++++++++ 13 files changed, 102 insertions(+)
Documentation/fetch-options.txt +8 -0
@@ -158,3 +158,11 @@ endif::git-pull[] by default when it is attached to a terminal, unless -q is specified. This flag forces progress status even if the standard error stream is not directed to a terminal. + +-4:: +--ipv4:: + Resolve IPv4 addresses only, ignoring IPv6 addresses. + +-6:: +--ipv6:: + Resolve IPv6 addresses only, ignoring IPv4 addresses.
Documentation/git-push.txt +7 -0
@@ -277,6 +277,13 @@ origin +master` to force a push to the `master` branch). See the default is --verify, giving the hook a chance to prevent the push. With --no-verify, the hook is bypassed completely. +-4:: +--ipv4:: + Resolve IPv4 addresses only, ignoring IPv6 addresses. + +-6:: +--ipv6:: + Resolve IPv6 addresses only, ignoring IPv4 addresses. include::urls-remotes.txt[]
builtin/clone.c +4 -0
@@ -47,6 +47,7 @@ static const char *real_git_dir;static char *option_upload_pack ="git-upload-pack" ;static int option_verbosity;static int option_progress =-1 ; +static int ipv4, ipv6;static struct string_list option_config;static struct string_list option_reference;static int option_dissociate;
@@ -92,6 +93,8 @@ static struct option builtin_clone_options[] = { N_("separate git dir from working tree")),OPT_STRING_LIST ('c' ,"config" , &option_config,N_ ("key=value" ),N_ ("set config inside the new repository" )), +OPT_BOOL ('4' ,"ipv4" , &ipv4,N_ ("resolve IPv4 addresses only" )), +OPT_BOOL ('6' ,"ipv6" , &ipv6,N_ ("resolve IPv6 addresses only" )), OPT_END() };
@@ -970,6 +973,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) remote =remote_get (option_origin); transport =transport_get (remote, remote->url[0 ]);transport_set_verbosity (transport, option_verbosity, option_progress); +transport_set_family (transport, ipv4, ipv6); path =get_repo_path (remote->url[0 ], &is_bundle); is_local = option_local !=0 && path && !is_bundle;
builtin/fetch.c +4 -0
@@ -37,6 +37,7 @@ static int prune = -1; /* unspecified */static int all, append, dry_run, force, keep, multiple, update_head_ok, verbosity;static int progress =-1 , recurse_submodules =RECURSE_SUBMODULES_DEFAULT ;static int tags =TAGS_DEFAULT , unshallow, update_shallow; +static int ipv4, ipv6;static int max_children =1 ;static const char *depth;static const char *upload_pack;
@@ -127,6 +128,8 @@ static struct option builtin_fetch_options[] = { N_("accept refs that update .git/shallow")), {OPTION_CALLBACK ,0 ,"refmap" ,NULL ,N_ ("refmap" ), N_("specify fetch refmap"), PARSE_OPT_NONEG, parse_refmap_arg }, +OPT_BOOL ('4' ,"ipv4" , &ipv4,N_ ("resolve IPv4 addresses only" )), +OPT_BOOL ('6' ,"ipv6" , &ipv6,N_ ("resolve IPv6 addresses only" )),OPT_END () };
@@ -864,6 +867,7 @@ static struct transport *prepare_transport(struct remote *remote)struct transport *transport; transport =transport_get (remote,NULL );transport_set_verbosity (transport, verbosity, progress); +transport_set_family (transport, ipv4, ipv6);if (upload_pack)set_option (transport,TRANS_OPT_UPLOADPACK , upload_pack);if (keep)
builtin/push.c +4 -0
@@ -23,6 +23,7 @@ static const char *receivepack;static int verbosity;static int progress =-1 ;static int recurse_submodules =RECURSE_SUBMODULES_DEFAULT ; +static int ipv4, ipv6;static struct push_cas_option cas;
@@ -346,6 +347,7 @@ static int push_with_options(struct transport *transport, int flags)unsigned int reject_reasons;transport_set_verbosity (transport, verbosity, progress); +transport_set_family (transport, ipv4, ipv6);if (receivepack) transport_set_option(transport,
@@ -565,6 +567,8 @@ int cmd_push(int argc, const char **argv, const char *prefix) 0, "signed", &push_cert, "yes|no|if-asked", N_("GPG sign the push"), PARSE_OPT_OPTARG, option_parse_push_signed }, OPT_BIT(0, "atomic", &flags, N_("request atomic transaction on remote side"), TRANSPORT_PUSH_ATOMIC), + OPT_BOOL('4', "ipv4", &ipv4, N_("resolve IPv4 addresses only")), + OPT_BOOL('6', "ipv6", &ipv6, N_("resolve IPv6 addresses only")),OPT_END () };
connect.c +8 -0
@@ -357,6 +357,10 @@ static int git_tcp_connect_sock(char *host, int flags) port ="<none>" ;memset (&hints,0 ,sizeof (hints)); +if (flags &CONNECT_IPV4ONLY ) + hints.ai_family =AF_INET ; +else if (flags &CONNECT_IPV6ONLY ) + hints.ai_family =AF_INET6 ; hints.ai_socktype =SOCK_STREAM ; hints.ai_protocol =IPPROTO_TCP ;
@@ -783,6 +787,10 @@ struct child_process *git_connect(int fd[2], const char *url, }argv_array_push (&conn->args, ssh); +if (flags &CONNECT_IPV4ONLY ) +argv_array_push (&conn->args,"-4" ); +else if (flags &CONNECT_IPV6ONLY ) +argv_array_push (&conn->args,"-6" );if (tortoiseplink)argv_array_push (&conn->args,"-batch" );if (port) {
connect.h +2 -0
@@ -3,6 +3,8 @@#define CONNECT_VERBOSE (1u << 0)#define CONNECT_DIAG_URL (1u << 1) +#define CONNECT_IPV4ONLY (1u << 2) +#define CONNECT_IPV6ONLY (1u << 3)extern struct child_process *git_connect (int fd[2 ],const char *url,const char *prog,int flags);extern int finish_connect (struct child_process *conn);extern int git_connection_is_socket (struct child_process *conn);
http.c +9 -0
@@ -11,6 +11,11 @@#include "gettext.h" #include "transport.h" +#if LIBCURL_VERSION_NUM >=0x070a08 +long int git_curl_ipresolve =CURL_IPRESOLVE_WHATEVER ; +#else +long int git_curl_ipresolve; +#endif int active_requests;int http_is_verbose;size_t http_post_buffer =16 *LARGE_PACKET_MAX ;
@@ -692,6 +697,10 @@ struct active_request_slot *get_active_slot(void)curl_easy_setopt (slot->curl,CURLOPT_HTTPGET ,1 );curl_easy_setopt (slot->curl,CURLOPT_FAILONERROR ,1 );curl_easy_setopt (slot->curl,CURLOPT_RANGE ,NULL ); + +#if LIBCURL_VERSION_NUM >=0x070a08 +curl_easy_setopt (slot->curl,CURLOPT_IPRESOLVE , git_curl_ipresolve); +#endif #ifdef LIBCURL_CAN_HANDLE_AUTH_ANY curl_easy_setopt (slot->curl,CURLOPT_HTTPAUTH , http_auth_methods);#endif
http.h +1 -0
@@ -106,6 +106,7 @@ extern void http_init(struct remote *remote, const char *url, int proactive_auth);extern void http_cleanup (void ); +extern long int git_curl_ipresolve;extern int active_requests;extern int http_is_verbose;extern size_t http_post_buffer;
remote-curl.c +19 -0
@@ -119,6 +119,25 @@ static int set_option(const char *name, const char *value)else return -1 ;return 0 ; + +#if LIBCURL_VERSION_NUM >=0x070a08 + } else if (!strcmp(name, "ipv4")) { +if (!strcmp (value,"true" )) + git_curl_ipresolve =CURL_IPRESOLVE_V4 ; +else if (!strcmp (value,"false" )) + git_curl_ipresolve =CURL_IPRESOLVE_WHATEVER ; +else +return -1 ; +return 0 ; + }else if (!strcmp (name,"ipv6" )) { +if (!strcmp (value,"true" )) + git_curl_ipresolve =CURL_IPRESOLVE_V6 ; +else if (!strcmp (value,"false" )) + git_curl_ipresolve =CURL_IPRESOLVE_WHATEVER ; +else +return -1 ; +return 0 ; +#endif /* LIBCURL_VERSION_NUM >= 0x070a08 */ }else {return 1 /* unsupported */ ; }
transport-helper.c +7 -0
@@ -258,6 +258,8 @@ static const char *boolean_options[] = {TRANS_OPT_THIN ,TRANS_OPT_KEEP ,TRANS_OPT_FOLLOWTAGS , +TRANS_OPT_IPV4 , + TRANS_OPT_IPV6, }; static int set_helper_option(struct transport *transport,
@@ -321,6 +323,11 @@ static void standard_options(struct transport *t)if (n >=sizeof (buf))die ("impossibly large verbosity value" );set_helper_option (t,"verbosity" , buf); + +if (t->ipv4) +set_helper_option (t,"ipv4" ,"true" ); +if (t->ipv6) +set_helper_option (t,"ipv6" ,"true" ); }static int release_helper (struct transport *transport)
transport.c +18 -0
@@ -489,6 +489,10 @@ static int connect_setup(struct transport *transport, int for_push)if (data->conn)return 0 ; +if (transport->ipv4) + flags |=CONNECT_IPV4ONLY ; +if (transport->ipv6) + flags |=CONNECT_IPV6ONLY ; data->conn = git_connect(data->fd, transport->url, for_push ? data->options.receivepack : data->options.uploadpack,
@@ -1086,6 +1090,20 @@ void transport_set_verbosity(struct transport *transport, int verbosity, transport->progress = verbosity >=0 &&isatty (2 ); } +void transport_set_family (struct transport *transport,int ipv4,int ipv6) +{ +if (ipv4 && ipv6) +die ("-4/--ipv4 and -6/--ipv6 are incompatible" ); +if (ipv4) { + transport->ipv4 =1 ; +transport_set_option (transport,TRANS_OPT_IPV4 ,"true" ); + } +if (ipv6) { + transport->ipv6 =1 ; +transport_set_option (transport,TRANS_OPT_IPV6 ,"true" ); + } +} +static void die_with_unpushed_submodules (struct string_list *needs_pushing) {int i;
transport.h +11 -0
@@ -104,6 +104,10 @@ struct transport {* in transport_set_verbosity(). **/ unsigned progress : 1; + +/* mutually exclusive, set by transport_set_family */ + unsigned ipv4 : 1; + unsigned ipv6 : 1;/* * If transport is at least potentially smart, this points to * git_transport_options structure to use in case transport
@@ -180,6 +184,12 @@ int transport_restrict_protocols(void);/* Send push certificates */ #define TRANS_OPT_PUSH_CERT "pushcert" +/* Limit to IPv4 only */ +#define TRANS_OPT_IPV4 "ipv4" + +/* Limit to IPv6 only */ +#define TRANS_OPT_IPV6 "ipv6" +/** * Returns 0 if the option was used, non-zero otherwise. Prints a * message to stderr if the option is not used.
@@ -188,6 +198,7 @@ int transport_set_option(struct transport *transport, const char *name, const char *value);void transport_set_verbosity (struct transport *transport,int verbosity,int force_progress); +void transport_set_family (struct transport *transport,int ipv4,int ipv6);#define REJECT_NON_FF_HEAD 0x01#define REJECT_NON_FF_OTHER 0x02
Signature · 1 line
EW
Re: [PATCH 2/1] support -4 and -6 switches for remote operations
Quoted 2 lines · Eric Wong
rsync support is untouched for now since it is deprecated and scheduled to be removed.
I forgot add I'm not sure how to actually go about testing these changes automatically since they involve DNS setups. And the test suite seems really slow nowadays, I guess/hope our test coverage has improved much in the past few years?
I did test the ssh push case manually and all the fetch/clone cases, including rsync (where I encountered the breakage from 2007). So I reverted my rsync change for now to avoid conflicting with its removal.
Re: [PATCH 2/1] support -4 and -6 switches for remote operations
In reply to Eric WongOn 2016-01-30 14.13, Eric Wong wrote:
Nicely done, some minor questions inline.
Quoted 6 lines
Sometimes, it is necessary to force IPv4-only or IPv6-only operation on networks where name lookups may return a non-routable address and stall remote operations.
The ssh(1) command has an equivalent switches which we may pass when we run them.
Should we mention that putty and tortoiseplink don't have these options ? At least in the commit message ?
Quoted 59 lines
rsync support is untouched for now since it is deprecated and scheduled to be removed.
Signed-off-by Eric Wong <[email protected]>--- Documentation/fetch-options.txt | 8 ++++++++ Documentation/git-push.txt | 7 +++++++ builtin/clone.c | 4 ++++ builtin/fetch.c | 4 ++++ builtin/push.c | 4 ++++ connect.c | 8 ++++++++ connect.h | 2 ++ http.c | 9 +++++++++ http.h | 1 + remote-curl.c | 19 +++++++++++++++++++ transport-helper.c | 7 +++++++ transport.c | 18 ++++++++++++++++++ transport.h | 11 +++++++++++ 13 files changed, 102 insertions(+)Documentation/fetch-options.txt +8
-0@@ -158,3 +158,11 @@ endif::git-pull[] by default when it is attached to a terminal, unless -q is specified. This flag forces progress status even if the standard error stream is not directed to a terminal. + +-4:: +--ipv4:: + Resolve IPv4 addresses only, ignoring IPv6 addresses. + +-6:: +--ipv6:: + Resolve IPv6 addresses only, ignoring IPv4 addresses.Documentation/git-push.txt +7
-0@@ -277,6 +277,13 @@ origin +master` to force a push to the `master` branch). See the default is --verify, giving the hook a chance to prevent the push. With --no-verify, the hook is bypassed completely. +-4:: +--ipv4:: + Resolve IPv4 addresses only, ignoring IPv6 addresses. + +-6:: +--ipv6:: + Resolve IPv6 addresses only, ignoring IPv4 addresses. include::urls-remotes.txt[]builtin/clone.c +0
-0
builtin/clone.c static const char *real_git_dir; · line 50
Quoted 4 lines
builtin/clone.c +1
-0@@ -47,6 +47,7 @@ static const char *real_git_dir;static char *option_upload_pack ="git-upload-pack" ;static int option_verbosity;static int option_progress =-1 ; +static int ipv4, ipv6;
Do we need 2 variables here ?
Or would
int preferred_ip_version
be better ?
builtin/clone.c static struct option builtin_clone_options[] = { · line 97
Quoted 9 lines
builtin/clone.c +2
-0static struct string_list option_config;static struct string_list option_reference;static int option_dissociate;@@ -92,6 +93,8 @@ static struct option builtin_clone_options[] = { N_("separate git dir from working tree")),OPT_STRING_LIST ('c' ,"config" , &option_config,N_ ("key=value" ),N_ ("set config inside the new repository" )), +OPT_BOOL ('4' ,"ipv4" , &ipv4,N_ ("resolve IPv4 addresses only" )), + OPT_BOOL('6', "ipv6", &ipv6, N_("resolve IPv6 addresses only")),
Technically OK to mention resolve, but does it give any information to the user ? s/resolve IPv4 addresses only/use IPv4 addresses only/
builtin/clone.c int cmd_clone(int argc, const char **argv, const char *prefix) · line 977
Quoted 9 lines
builtin/clone.c +1
-0OPT_END() };@@ -970,6 +973,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) remote =remote_get (option_origin); transport =transport_get (remote, remote->url[0 ]);transport_set_verbosity (transport, option_verbosity, option_progress); +transport_set_family (transport, ipv4, ipv6);
Does it make sense to name the variable into ipv4only (to make clear that it does not mean ipv4_allowed ?) (and similar in the rest of the code)
[snip]
Re: [PATCH 2/1] support -4 and -6 switches for remote operations
Quoted 6 lines · Torsten Bögershausen
Quoted 2 lines · Eric Wong
The ssh(1) command has an equivalent switches which we may pass when we run them.
Should we mention that putty and tortoiseplink don't have these options ? At least in the commit message ?
Sure, will remember for v2 and document in the manpages.
Curious, do these ssh implementations throw out a meaningful error message when given these options?
Quoted 8 lines
builtin/clone.c static const char *real_git_dir; · line 50
Quoted 7 lines
builtin/clone.c +1
-0@@ -47,6 +47,7 @@ static const char *real_git_dir;static char *option_upload_pack ="git-upload-pack" ;static int option_verbosity;static int option_progress =-1 ; +static int ipv4, ipv6;Do we need 2 variables here ?
Yes, I'm not sure how else to use OPT_BOOL below...
Quoted 14 lines
Or would
intpreferred_ip_version
be better ?builtin/clone.c static struct option builtin_clone_options[] = { · line 97
Quoted 9 lines
builtin/clone.c +2
-0static struct string_list option_config;static struct string_list option_reference;static int option_dissociate;@@ -92,6 +93,8 @@ static struct option builtin_clone_options[] = { N_("separate git dir from working tree")),OPT_STRING_LIST ('c' ,"config" , &option_config,N_ ("key=value" ),N_ ("set config inside the new repository" )), +OPT_BOOL ('4' ,"ipv4" , &ipv4,N_ ("resolve IPv4 addresses only" )), + OPT_BOOL('6', "ipv6", &ipv6, N_("resolve IPv6 addresses only")),Technically OK to mention resolve, but does it give any information to the user ? s/resolve IPv4 addresses only/use IPv4 addresses only/
I suppose "use" is shorter and just as informational. Will prepare that for v2.
Quoted 9 lines
builtin/clone.c int cmd_clone(int argc, const char **argv, const char *prefix) · line 977
Quoted 6 lines
builtin/clone.c +1
-0@@ -970,6 +973,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) remote =remote_get (option_origin); transport =transport_get (remote, remote->url[0 ]);transport_set_verbosity (transport, option_verbosity, option_progress); +transport_set_family (transport, ipv4, ipv6);Does it make sense to name the variable into ipv4only (to make clear that it does not mean
ipv4_allowed?) (and similar in the rest of the code)
I actually had "only" in the variables originally, but didn't want to line-wrap in builtin/push.c
Furthermore, the non-"only" name is used by the long switch (just like in both curl(1) and rsync(1)), so I figured we should remain consistent with what the user will see in documentation.
I think I will drop "ONLY" from the CONNECT_* macros instead...
Will await further comments and prepare v2 in a day or two. Thanks for the comments.
Re: [PATCH 2/1] support -4 and -6 switches for remote operations
Quoted 10 lines · Eric Wong
Quoted 8 lines
builtin/clone.c static const char *real_git_dir; · line 50
Quoted 7 lines
builtin/clone.c +1
-0@@ -47,6 +47,7 @@ static const char *real_git_dir;static char *option_upload_pack ="git-upload-pack" ;static int option_verbosity;static int option_progress =-1 ; +static int ipv4, ipv6;Do we need 2 variables here ?
Yes, I'm not sure how else to use
OPT_BOOLbelow...
If they're mutually exclusive, and saying "-6" cancels "-4", you probably want something like:
enum {
USE_NET_ALL = 0,
USE_NET_IPV4,
USE_NET_IPV6, } use_net;
...
OPT_SET_INT('4', "ipv4", &use_net,
N_("resolve IPv4 addresses only"), USE_NET_IPV4),
OPT_SET_INT('6', "ipv6", &use_net,
N_("resolve IPv6 addresses only"), USE_NET_IPV6),
Using --no-ipv4 will set it back to USE_NET_ALL, which is probably OK. It will cancel a previous "--ipv4", which is logically consistent, though I guess some people might assume that "--no-ipv4" means "do not use ipv4 addresses". Supporting that would be more complicated.
-Peff
Re: [PATCH 2/1] support -4 and -6 switches for remote operations
In reply to Eric WongQuoted 7 lines · Eric Wong
Quoted 6 lines · Torsten Bögershausen
Quoted 2 lines · Eric Wong
The ssh(1) command has an equivalent switches which we may pass when we run them.
Should we mention that putty and tortoiseplink don't have these options ? At least in the commit message ?
I may need to take that back;
Just did a test with putty (under Debian)
And both -4 and -6 are supported, nice.
I couldn't find it first, but here seems to be the latest documentation, which mentions -4 and -6.
http://the.earth.li/~sgtatham/putty/0.66/puttydoc.txt
And even plink acceptes -4 and -6 (again under Debian)
Sorry for the noise.
[PATCH v2 2/1] support -4 and -6 switches for remote operations
In reply to Jeff KingQuoted 4 lines · Jeff King
OPT_SET_INT('4', "ipv4",
&use_net,
N_("resolve IPv4 addresses only"),USE_NET_IPV4),
OPT_SET_INT('6', "ipv6",&use_net,
N_("resolve IPv6 addresses only"),USE_NET_IPV6),
Thanks, I missed OPT_SET_INT before.
Quoted 4 lines
Using --no-ipv4 will set it back to
USE_NET_ALL, which is probably OK. It will cancel a previous "--ipv4", which is logically consistent, though I guess some people might assume that "--no-ipv4" means "do not use ipv4 addresses". Supporting that would be more complicated.
Right, not worth the effort to support that and I prefer leaving the "--no-" variants undocumented as an implementation artifact.
(no rush to review this, unlikely to be around the next few days)
-----------------8<------------------
Subject: [PATCH] support -4 and -6 switches for remote operations
Sometimes it is necessary to force IPv4-only or IPv6-only operation on networks where name lookups may return a non-routable address and stall remote operations.
The ssh(1) command has an equivalent switches which we may pass when we run them. There may be old ssh(1) implementations out there which do not support these switches; they should report the appropriate error in that case.
rsync support is untouched for now since it is deprecated and scheduled to be removed.
v2:
- switch from boolean ints to enum
- shorted CONNECT_* macro names to be consistent with switches
- remove unneeded TRANS_OPT_* macros and usage
- remove transport_set_family wrapper, enum is enough validation
- s/resolve/use/ in documentation
- document potential (but unconfirmed) problems with some ssh(1)
--- Documentation/fetch-options.txt | 8 ++++++++ Documentation/git-push.txt | 7 +++++++ builtin/clone.c | 6 ++++++ builtin/fetch.c | 6 ++++++ builtin/push.c | 6 ++++++ connect.c | 8 ++++++++ connect.h | 2 ++ http.c | 9 +++++++++ http.h | 1 + remote-curl.c | 13 +++++++++++++ transport-helper.c | 15 +++++++++++++++ transport.c | 6 ++++++ transport.h | 8 ++++++++ 13 files changed, 95 insertions(+)
Documentation/fetch-options.txt +8 -0
@@ -158,3 +158,11 @@ endif::git-pull[] by default when it is attached to a terminal, unless -q is specified. This flag forces progress status even if the standard error stream is not directed to a terminal. + +-4:: +--ipv4:: + Use IPv4 addresses only, ignoring IPv6 addresses. + +-6:: +--ipv6:: + Use IPv6 addresses only, ignoring IPv4 addresses.
Documentation/git-push.txt +7 -0
@@ -277,6 +277,13 @@ origin +master` to force a push to the `master` branch). See the default is --verify, giving the hook a chance to prevent the push. With --no-verify, the hook is bypassed completely. +-4:: +--ipv4:: + Use IPv4 addresses only, ignoring IPv6 addresses. + +-6:: +--ipv6:: + Use IPv6 addresses only, ignoring IPv4 addresses. include::urls-remotes.txt[]
builtin/clone.c +6 -0
@@ -47,6 +47,7 @@ static const char *real_git_dir;static char *option_upload_pack ="git-upload-pack" ;static int option_verbosity;static int option_progress =-1 ; +static enum transport_family family;static struct string_list option_config;static struct string_list option_reference;static int option_dissociate;
@@ -92,6 +93,10 @@ static struct option builtin_clone_options[] = { N_("separate git dir from working tree")),OPT_STRING_LIST ('c' ,"config" , &option_config,N_ ("key=value" ),N_ ("set config inside the new repository" )), +OPT_SET_INT ('4' ,"ipv4" , &family,N_ ("use IPv4 addresses only" ), +TRANSPORT_FAMILY_IPV4 ), +OPT_SET_INT ('6' ,"ipv6" , &family,N_ ("use IPv6 addresses only" ), +TRANSPORT_FAMILY_IPV6 ), OPT_END() };
@@ -970,6 +975,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) remote =remote_get (option_origin); transport =transport_get (remote, remote->url[0 ]);transport_set_verbosity (transport, option_verbosity, option_progress); + transport->family = family; path =get_repo_path (remote->url[0 ], &is_bundle); is_local = option_local !=0 && path && !is_bundle;
builtin/fetch.c +6 -0
@@ -37,6 +37,7 @@ static int prune = -1; /* unspecified */static int all, append, dry_run, force, keep, multiple, update_head_ok, verbosity;static int progress =-1 , recurse_submodules =RECURSE_SUBMODULES_DEFAULT ;static int tags =TAGS_DEFAULT , unshallow, update_shallow; +static enum transport_family family;static int max_children =1 ;static const char *depth;static const char *upload_pack;
@@ -127,6 +128,10 @@ static struct option builtin_fetch_options[] = { N_("accept refs that update .git/shallow")), {OPTION_CALLBACK ,0 ,"refmap" ,NULL ,N_ ("refmap" ), N_("specify fetch refmap"), PARSE_OPT_NONEG, parse_refmap_arg }, +OPT_SET_INT ('4' ,"ipv4" , &family,N_ ("use IPv4 addresses only" ), +TRANSPORT_FAMILY_IPV4 ), +OPT_SET_INT ('6' ,"ipv6" , &family,N_ ("use IPv6 addresses only" ), +TRANSPORT_FAMILY_IPV6 ),OPT_END () };
@@ -864,6 +869,7 @@ static struct transport *prepare_transport(struct remote *remote)struct transport *transport; transport =transport_get (remote,NULL );transport_set_verbosity (transport, verbosity, progress); + transport->family = family;if (upload_pack)set_option (transport,TRANS_OPT_UPLOADPACK , upload_pack);if (keep)
builtin/push.c +6 -0
@@ -23,6 +23,7 @@ static const char *receivepack;static int verbosity;static int progress =-1 ;static int recurse_submodules =RECURSE_SUBMODULES_DEFAULT ; +static enum transport_family family;static struct push_cas_option cas;
@@ -346,6 +347,7 @@ static int push_with_options(struct transport *transport, int flags)unsigned int reject_reasons;transport_set_verbosity (transport, verbosity, progress); + transport->family = family;if (receivepack) transport_set_option(transport,
@@ -565,6 +567,10 @@ int cmd_push(int argc, const char **argv, const char *prefix) 0, "signed", &push_cert, "yes|no|if-asked", N_("GPG sign the push"), PARSE_OPT_OPTARG, option_parse_push_signed }, OPT_BIT(0, "atomic", &flags, N_("request atomic transaction on remote side"), TRANSPORT_PUSH_ATOMIC), + OPT_SET_INT('4', "ipv4", &family, N_("use IPv4 addresses only"), + TRANSPORT_FAMILY_IPV4), + OPT_SET_INT('6', "ipv6", &family, N_("use IPv6 addresses only"), + TRANSPORT_FAMILY_IPV6),OPT_END () };
connect.c +8 -0
@@ -357,6 +357,10 @@ static int git_tcp_connect_sock(char *host, int flags) port ="<none>" ;memset (&hints,0 ,sizeof (hints)); +if (flags &CONNECT_IPV4 ) + hints.ai_family =AF_INET ; +else if (flags &CONNECT_IPV6 ) + hints.ai_family =AF_INET6 ; hints.ai_socktype =SOCK_STREAM ; hints.ai_protocol =IPPROTO_TCP ;
@@ -783,6 +787,10 @@ struct child_process *git_connect(int fd[2], const char *url, }argv_array_push (&conn->args, ssh); +if (flags &CONNECT_IPV4 ) +argv_array_push (&conn->args,"-4" ); +else if (flags &CONNECT_IPV6 ) +argv_array_push (&conn->args,"-6" );if (tortoiseplink)argv_array_push (&conn->args,"-batch" );if (port) {
connect.h +2 -0
@@ -3,6 +3,8 @@#define CONNECT_VERBOSE (1u << 0)#define CONNECT_DIAG_URL (1u << 1) +#define CONNECT_IPV4 (1u << 2) +#define CONNECT_IPV6 (1u << 3)extern struct child_process *git_connect (int fd[2 ],const char *url,const char *prog,int flags);extern int finish_connect (struct child_process *conn);extern int git_connection_is_socket (struct child_process *conn);
http.c +9 -0
@@ -11,6 +11,11 @@#include "gettext.h" #include "transport.h" +#if LIBCURL_VERSION_NUM >=0x070a08 +long int git_curl_ipresolve =CURL_IPRESOLVE_WHATEVER ; +#else +long int git_curl_ipresolve; +#endif int active_requests;int http_is_verbose;size_t http_post_buffer =16 *LARGE_PACKET_MAX ;
@@ -692,6 +697,10 @@ struct active_request_slot *get_active_slot(void)curl_easy_setopt (slot->curl,CURLOPT_HTTPGET ,1 );curl_easy_setopt (slot->curl,CURLOPT_FAILONERROR ,1 );curl_easy_setopt (slot->curl,CURLOPT_RANGE ,NULL ); + +#if LIBCURL_VERSION_NUM >=0x070a08 +curl_easy_setopt (slot->curl,CURLOPT_IPRESOLVE , git_curl_ipresolve); +#endif #ifdef LIBCURL_CAN_HANDLE_AUTH_ANY curl_easy_setopt (slot->curl,CURLOPT_HTTPAUTH , http_auth_methods);#endif
http.h +1 -0
@@ -106,6 +106,7 @@ extern void http_init(struct remote *remote, const char *url, int proactive_auth);extern void http_cleanup (void ); +extern long int git_curl_ipresolve;extern int active_requests;extern int http_is_verbose;extern size_t http_post_buffer;
remote-curl.c +13 -0
@@ -119,6 +119,19 @@ static int set_option(const char *name, const char *value)else return -1 ;return 0 ; + +#if LIBCURL_VERSION_NUM >=0x070a08 + } else if (!strcmp(name, "family")) { +if (!strcmp (value,"ipv4" )) + git_curl_ipresolve =CURL_IPRESOLVE_V4 ; +else if (!strcmp (value,"ipv6" )) + git_curl_ipresolve =CURL_IPRESOLVE_V6 ; +else if (!strcmp (value,"all" )) + git_curl_ipresolve =CURL_IPRESOLVE_WHATEVER ; +else +return -1 ; +return 0 ; +#endif /* LIBCURL_VERSION_NUM >= 0x070a08 */ }else {return 1 /* unsupported */ ; }
transport-helper.c +15 -0
@@ -321,6 +321,21 @@ static void standard_options(struct transport *t)if (n >=sizeof (buf))die ("impossibly large verbosity value" );set_helper_option (t,"verbosity" , buf); + +switch (t->family) { +case TRANSPORT_FAMILY_ALL : +/* +* this is already the default, +* do not break old remote helpers by setting "all" here +*/ +break ; +case TRANSPORT_FAMILY_IPV4 : +set_helper_option (t,"family" ,"ipv4" ); +break ; +case TRANSPORT_FAMILY_IPV6 : +set_helper_option (t,"family" ,"ipv6" ); +break ; + } }static int release_helper (struct transport *transport)
transport.c +6 -0
@@ -489,6 +489,12 @@ static int connect_setup(struct transport *transport, int for_push)if (data->conn)return 0 ; +switch (transport->family) { +case TRANSPORT_FAMILY_ALL :break ; +case TRANSPORT_FAMILY_IPV4 : flags |=CONNECT_IPV4 ;break ; +case TRANSPORT_FAMILY_IPV6 : flags |=CONNECT_IPV6 ;break ; + } + data->conn = git_connect(data->fd, transport->url, for_push ? data->options.receivepack : data->options.uploadpack,
transport.h +8 -0
@@ -18,6 +18,12 @@ struct git_transport_options {struct push_cas_option *cas; }; +enum transport_family { +TRANSPORT_FAMILY_ALL =0 , +TRANSPORT_FAMILY_IPV4 , +TRANSPORT_FAMILY_IPV6 +}; +struct transport {struct remote *remote;const char *url;
@@ -110,6 +116,8 @@ struct transport {* actually turns out to be smart. */ struct git_transport_options *smart_options; + +enum transport_family family; };#define TRANSPORT_PUSH_ALL 1
Signature · 1 line
EW
Re: [PATCH v2 2/1] support -4 and -6 switches for remote operations
Quoted 1 line · Eric Wong
(no rush to review this, unlikely to be around the next few days)
Ping on v2. I will be online the next few days and likely working on some other git stuff anyways :)
Re: [PATCH v2 2/1] support -4 and -6 switches for remote operations
Quoted 4 lines · Eric Wong
Quoted 1 line · Eric Wong
(no rush to review this, unlikely to be around the next few days)
Ping on v2. I will be online the next few days and likely working on some other git stuff anyways :)
Patch V2 looks OK for me.