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

sub-fetches discard --ipv4|6 option

From
Alex Riesen <alexander.riesen@cetitec.com>
Date
Sep 14, 2020, 12:19 UTC
Message-ID
<20200914121906.GD4705@pflmari>
Hi everyone,

I have a slight problem with IPv6 configuration in my local network (connect works but transfers do not) and would like to temporarily disable use of the transport for a series of fetches. The fetches are all done from within a script to which I can pass options for "git fetch" commands in its command-line. The options will be appended to the fetch commands, i.e.:

    git fetch <hard-coded-script-options> --ipv4

Unfortunately, it only worked for the fetches which didn't use --all or --multiple. After a light searching, I failed to find an explanation as to why --all|--multiple are handled so inconsistently with single remote fetches and added the options (similar to --force or --keep) to the argument list for sub-fetches:

diff --git a/builtin/fetch.c b/builtin/fetch.c
index 82ac4be8a5..5e06c07106 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1531,6 +1531,10 @@ static void add_options_to_argv(struct argv_array *argv)
 		argv_array_push(argv, "-v");
 	else if (verbosity < 0)
 		argv_array_push(argv, "-q");
+	if (family == TRANSPORT_FAMILY_IPV4)
+		argv_array_push(argv, "--ipv4");
+	else if (family == TRANSPORT_FAMILY_IPV6)
+		argv_array_push(argv, "--ipv6");
 
 }
 
Am I missing something obvious?

Regards,
Alex
Next: Jeff King
Message 1 of 49 in “sub-fetches discard --ipv4|6 option”
  1. Alex RiesenSep 14, 2020
  2. Jeff KingSep 14, 2020
  3. Alex RiesenSep 15, 2020
  4. Pass --ipv4 and --ipv6 options to sub-fetches when fetching multiple remotes and submodulesAlex Riesen, Sep 15, 2020
  5. Junio C HamanoSep 15, 2020
  6. Alex RiesenSep 16, 2020
  7. Jeff KingSep 15, 2020
  8. Junio C HamanoSep 16, 2020
  9. Alex RiesenSep 16, 2020
  10. Jeff KingSep 15, 2020
  11. Alex RiesenSep 15, 2020
  12. Jeff KingSep 15, 2020
  13. Junio C HamanoSep 15, 2020
  14. Jeff KingSep 15, 2020
  15. Junio C HamanoSep 15, 2020
  16. Jeff KingSep 16, 2020
  17. Junio C HamanoSep 16, 2020
  18. Alex RiesenSep 15, 2020
  19. Jeff KingSep 16, 2020
  20. Alex RiesenSep 17, 2020
  21. Jeff KingSep 22, 2020
  22. config: option transfer.ipversion to set transport protocol version for network fetchesAlex Riesen, Sep 15, 2020
  23. Jeff KingSep 16, 2020
  24. Alex RiesenSep 17, 2020
  25. Config option to set the transport protocol version for network fetchesAlex Riesen, Sep 17, 2020
  26. Jeff KingSep 17, 2020
  27. Alex RiesenSep 17, 2020
  28. Jeff KingSep 17, 2020
  29. Alex RiesenSep 17, 2020
  30. Junio C HamanoDec 22, 2020
  31. Alex RiesenJan 7, 2021
  32. Alex RiesenSep 17, 2020
  33. Alex RiesenSep 17, 2020
  34. Junio C HamanoSep 16, 2020
  35. Jeff KingSep 16, 2020
  36. Junio C HamanoSep 16, 2020
  37. Junio C HamanoSep 16, 2020
  38. Jeff KingSep 17, 2020
  39. Junio C HamanoSep 17, 2020
  40. Junio C HamanoSep 16, 2020
  41. Alex RiesenSep 17, 2020
  42. Junio C HamanoSep 17, 2020
  43. Alex RiesenSep 18, 2020
  44. Junio C HamanoSep 18, 2020
  45. Alex RiesenSep 21, 2020
  46. Jeff KingSep 22, 2020
  47. Alex RiesenSep 17, 2020
  48. Alex RiesenSep 17, 2020
  49. Junio C HamanoSep 14, 2020

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.