git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/1] support -4 and -6 switches for remote operations

From
EWEric Wong <normalperson@yhbt.net>
Date
Jan 31, 2016, 00:01 UTC
Message-ID
<20160131000144.GA10117@dcvr.yhbt.net>
In-Reply-To
<56AD4887.3070207@web.de>
Torsten Bögershausen <tboegi@web.de> wrote:
> On 2016-01-30 14.13, Eric Wong wrote:
> > 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?

Show 8 quoted lines
> > --- a/builtin/clone.c
> > +++ b/builtin/clone.c
> > @@ -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...
Show 14 quoted lines
> Or would
> int preferred_ip_version
> be better ?
> >  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")),
> 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.

Show 9 quoted lines
> > @@ -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.

Previous: Torsten BögershausenNext: Jeff King
Message 7 of 18 in “pass transport verbosity down to git_connect”
  1. pass transport verbosity down to git_connectEric Wong, Jan 28, 2016
  2. Junio C HamanoJan 28, 2016
  3. pass transport verbosity down to git_connectEric Wong, Jan 30, 2016
  4. 2/1 support -4 and -6 switches for remote operationsEric Wong, Jan 30, 2016
  5. Eric WongJan 30, 2016
  6. Torsten BögershausenJan 30, 2016
  7. Eric WongJan 31, 2016
  8. Jeff KingJan 31, 2016
  9. 2/1 support -4 and -6 switches for remote operationsEric Wong, Feb 3, 2016
  10. Eric WongFeb 12, 2016
  11. Torsten BögershausenFeb 12, 2016
  12. Torsten BögershausenJan 31, 2016
  13. Jeff KingJan 28, 2016
  14. Eric WongJan 29, 2016
  15. Junio C HamanoJan 29, 2016
  16. Jeff KingJan 29, 2016
  17. Junio C HamanoJan 29, 2016
  18. Jeff KingJan 29, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.