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
Jeff King <peff@peff.net>
Date
Jan 31, 2016, 01:13 UTC
Message-ID
<20160131011314.GA22855@sigill.intra.peff.net>
In-Reply-To
<20160131000144.GA10117@dcvr.yhbt.net>
On Sun, Jan 31, 2016 at 12:01:44AM +0000, Eric Wong wrote:
Show 10 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...

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
Previous: Eric WongNext: Eric Wong
Message 8 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.