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

Re: [PATCH] fetch: fix duplicate remote parallel fetch bug

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 19, 2023, 22:40 UTC
Message-ID
<xmqq8rhy172q.fsf@gitster.g>
In-Reply-To
<20230119220538.1522464-1-calvinwan@google.com>
Calvin Wan <calvinwan@google.com> writes:
Show 24 quoted lines
> Fetching in parallel from a remote group with a duplicated remote results
> in the following:
>
> error: cannot lock ref '<ref>': is at <oid> but expected <oid>
>
> This doesn't happen in serial since fetching from the same remote that
> has already been fetched from is a noop. Therefore, remove any duplicated
> remotes after remote groups are parsed.
>
> Signed-off-by: Calvin Wan <calvinwan@google.com>
> ---
>  builtin/fetch.c          | 1 +
>  t/t5506-remote-groups.sh | 9 +++++++++
>  2 files changed, 10 insertions(+)
>
> diff --git a/builtin/fetch.c b/builtin/fetch.c
> index b06e454cbd..508ab2670c 100644
> --- a/builtin/fetch.c
> +++ b/builtin/fetch.c
> @@ -2225,6 +2225,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
>  			argv++;
>  		}
>  	}
> +	string_list_remove_duplicates(&list, 0);

As it always is possible to edit .git/config manually, it is necessary to perform deduplication like this patch does on the consumer side of the list, but do you know if our tool create duplication, or is it entirely something the end-user does manually?

If it is the former, I am wondering if we should also fix such a code path that does so in the first place.

Will queue.  Thanks.
Previous: Calvin WanNext: Calvin Wan
Message 2 of 3 in “fetch: fix duplicate remote parallel fetch bug”
  1. fetch: fix duplicate remote parallel fetch bugCalvin Wan, Jan 19, 2023
  2. Junio C HamanoJan 19, 2023
  3. Calvin WanJan 19, 2023

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.