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

Re: [PATCH] receive-pack: avoid sending duplicate "have" lines

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 6, 2015, 23:38 UTC
Message-ID
<xmqq8u6a3dif.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1446851773-32390-1-git-send-email-lfleischer@lfos.de>
Lukas Fleischer <lfleischer@lfos.de> writes:
Show 6 quoted lines
> @@ -254,9 +255,9 @@ static void write_head_info(void)
>  	struct sha1_array sa = SHA1_ARRAY_INIT;
>  
>  	for_each_alternate_ref(collect_one_alternate_ref, &sa);
> +	for_each_ref(show_ref_cb, &sa);
>  	sha1_array_for_each_unique(&sa, show_one_alternate_sha1, NULL);

Heh, I didn't realize that we already have half a support for this deduping. Good find.

We used to show ".have" from alternates first and then our own, but now we show the refs that matter and then ".have"s from alternates and ".have"s for our repository outside the current namespace. That shouldn't cause problems and the result would probably make more sense from aesthetics point of view ;-)

I suspect that many of these that turn into ".have"s point the same object as those sit at the tip of our refs (e.g. tags in alternates we borrow from, which are the folks of the same project that copy the same tags from the same upstream). I wonder if it easy to filter them out? After all, if we say object X sits at refs/tags/v1.0 there is no point showing ".have" for that same object X.

>  	sha1_array_clear(&sa);
> -	for_each_ref(show_ref_cb, NULL);
>  	if (!sent_capabilities)
>  		show_ref("capabilities^{}", null_sha1);
Previous: Lukas FleischerNext: Lukas Fleischer
Message 2 of 3 in “receive-pack: avoid sending duplicate "have" lines”
  1. receive-pack: avoid sending duplicate "have" linesLukas Fleischer, Nov 6, 2015
  2. Junio C HamanoNov 6, 2015
  3. Lukas FleischerNov 7, 2015

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.