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

Re: [PATCH] git-pull: Pass -4/-6 option to git-fetch

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 21, 2017, 08:03 UTC
Message-ID
<xmqqzi7gys5w.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20171119110132.folfzddhdorb6wqd@debian-dorm>
Shuyu Wei <wsy@dogben.com> writes:
Show 5 quoted lines
> The -4/-6 option should be passed through to git-fetch
> to be consistent with the git-pull man page.
>
> Signed-off-by: Wei Shuyu <wsy@dogben.com>
> ---

Sounds sensible. "git pull -h" output automatically gets extended with this change, too.

Thanks.
Show 40 quoted lines
>  builtin/pull.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/builtin/pull.c b/builtin/pull.c
> index f7e2c4f2e..166b777ed 100644
> --- a/builtin/pull.c
> +++ b/builtin/pull.c
> @@ -113,6 +113,8 @@ static char *opt_depth;
>  static char *opt_unshallow;
>  static char *opt_update_shallow;
>  static char *opt_refmap;
> +static char *opt_ipv4;
> +static char *opt_ipv6;
>  
>  static struct option pull_options[] = {
>  	/* Shared options */
> @@ -218,6 +220,12 @@ static struct option pull_options[] = {
>  	OPT_PASSTHRU(0, "refmap", &opt_refmap, N_("refmap"),
>  		N_("specify fetch refmap"),
>  		PARSE_OPT_NONEG),
> +	OPT_PASSTHRU('4',  "ipv4", &opt_ipv4, NULL,
> +		N_("use IPv4 addresses only"),
> +		PARSE_OPT_NOARG),
> +	OPT_PASSTHRU('6',  "ipv6", &opt_ipv6, NULL,
> +		N_("use IPv6 addresses only"),
> +		PARSE_OPT_NOARG),
>  
>  	OPT_END()
>  };
> @@ -522,6 +530,10 @@ static int run_fetch(const char *repo, const char **refspecs)
>  		argv_array_push(&args, opt_update_shallow);
>  	if (opt_refmap)
>  		argv_array_push(&args, opt_refmap);
> +	if (opt_ipv4)
> +		argv_array_push(&args, opt_ipv4);
> +	if (opt_ipv6)
> +		argv_array_push(&args, opt_ipv6);
>  
>  	if (repo) {
>  		argv_array_push(&args, repo);
Previous: Shuyu Wei
Message 2 of 2 in “git-pull: Pass -4/-6 option to git-fetch”
  1. git-pull: Pass -4/-6 option to git-fetchShuyu Wei, Nov 19, 2017
  2. Junio C HamanoNov 21, 2017

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.