{"thread":{"id":"47237","subject":"[PATCH] git-pull: Pass -4/-6 option to git-fetch","startedAt":"2017-11-19T11:20:00Z","lastAt":"2017-11-21T08:04:01Z","messageCount":2,"participants":["Shuyu Wei","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"332845","messageId":"20171119110132.folfzddhdorb6wqd@debian-dorm","threadId":"47237","inReplyTo":null,"subject":"[PATCH] git-pull: Pass -4/-6 option to git-fetch","fromName":"Shuyu Wei","fromEmail":"wsy@dogben.com","sentAt":"2017-11-19T11:01:32Z","receivedAt":"2017-11-19T11:20:00Z","isPatch":true,"sender":{"key":"wsy@dogben.com","avatar":"https://avatars.githubusercontent.com/u/7259503?v=4"},"body":"The -4/-6 option should be passed through to git-fetch\nto be consistent with the git-pull man page.\n\nSigned-off-by: Wei Shuyu <wsy@dogben.com>\n---\n builtin/pull.c | 12 ++++++++++++\n 1 file changed, 12 insertions(+)\n\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex f7e2c4f2e..166b777ed 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -113,6 +113,8 @@ static char *opt_depth;\n static char *opt_unshallow;\n static char *opt_update_shallow;\n static char *opt_refmap;\n+static char *opt_ipv4;\n+static char *opt_ipv6;\n \n static struct option pull_options[] = {\n \t/* Shared options */\n@@ -218,6 +220,12 @@ static struct option pull_options[] = {\n \tOPT_PASSTHRU(0, \"refmap\", &opt_refmap, N_(\"refmap\"),\n \t\tN_(\"specify fetch refmap\"),\n \t\tPARSE_OPT_NONEG),\n+\tOPT_PASSTHRU('4',  \"ipv4\", &opt_ipv4, NULL,\n+\t\tN_(\"use IPv4 addresses only\"),\n+\t\tPARSE_OPT_NOARG),\n+\tOPT_PASSTHRU('6',  \"ipv6\", &opt_ipv6, NULL,\n+\t\tN_(\"use IPv6 addresses only\"),\n+\t\tPARSE_OPT_NOARG),\n \n \tOPT_END()\n };\n@@ -522,6 +530,10 @@ static int run_fetch(const char *repo, const char **refspecs)\n \t\targv_array_push(&args, opt_update_shallow);\n \tif (opt_refmap)\n \t\targv_array_push(&args, opt_refmap);\n+\tif (opt_ipv4)\n+\t\targv_array_push(&args, opt_ipv4);\n+\tif (opt_ipv6)\n+\t\targv_array_push(&args, opt_ipv6);\n \n \tif (repo) {\n \t\targv_array_push(&args, repo);\n-- \n2.15.0\n\n\n"},{"id":"333085","messageId":"xmqqzi7gys5w.fsf@gitster.mtv.corp.google.com","threadId":"47237","inReplyTo":"20171119110132.folfzddhdorb6wqd@debian-dorm","subject":"Re: [PATCH] git-pull: Pass -4/-6 option to git-fetch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-21T08:03:55Z","receivedAt":"2017-11-21T08:04:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shuyu Wei <wsy@dogben.com> writes:\n\n> The -4/-6 option should be passed through to git-fetch\n> to be consistent with the git-pull man page.\n>\n> Signed-off-by: Wei Shuyu <wsy@dogben.com>\n> ---\n\nSounds sensible.  \"git pull -h\" output automatically gets extended\nwith this change, too.\n\nThanks.\n\n>  builtin/pull.c | 12 ++++++++++++\n>  1 file changed, 12 insertions(+)\n>\n> diff --git a/builtin/pull.c b/builtin/pull.c\n> index f7e2c4f2e..166b777ed 100644\n> --- a/builtin/pull.c\n> +++ b/builtin/pull.c\n> @@ -113,6 +113,8 @@ static char *opt_depth;\n>  static char *opt_unshallow;\n>  static char *opt_update_shallow;\n>  static char *opt_refmap;\n> +static char *opt_ipv4;\n> +static char *opt_ipv6;\n>  \n>  static struct option pull_options[] = {\n>  \t/* Shared options */\n> @@ -218,6 +220,12 @@ static struct option pull_options[] = {\n>  \tOPT_PASSTHRU(0, \"refmap\", &opt_refmap, N_(\"refmap\"),\n>  \t\tN_(\"specify fetch refmap\"),\n>  \t\tPARSE_OPT_NONEG),\n> +\tOPT_PASSTHRU('4',  \"ipv4\", &opt_ipv4, NULL,\n> +\t\tN_(\"use IPv4 addresses only\"),\n> +\t\tPARSE_OPT_NOARG),\n> +\tOPT_PASSTHRU('6',  \"ipv6\", &opt_ipv6, NULL,\n> +\t\tN_(\"use IPv6 addresses only\"),\n> +\t\tPARSE_OPT_NOARG),\n>  \n>  \tOPT_END()\n>  };\n> @@ -522,6 +530,10 @@ static int run_fetch(const char *repo, const char **refspecs)\n>  \t\targv_array_push(&args, opt_update_shallow);\n>  \tif (opt_refmap)\n>  \t\targv_array_push(&args, opt_refmap);\n> +\tif (opt_ipv4)\n> +\t\targv_array_push(&args, opt_ipv4);\n> +\tif (opt_ipv6)\n> +\t\targv_array_push(&args, opt_ipv6);\n>  \n>  \tif (repo) {\n>  \t\targv_array_push(&args, repo);\n"}]}