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

Re: [PATCH] pack-bitmap.c: ensure pack validity for all reuse packs

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 18, 2024, 19:41 UTC
Message-ID
<xmqqa5cspym9.fsf@gitster.g>
In-Reply-To
<7fdbfadc04926efc094633b238a55168c92e3d58.1734117577.git.me@ttaylorr.com>
Taylor Blau <me@ttaylorr.com> writes:
Show 17 quoted lines
> @@ -445,18 +444,6 @@ static int open_midx_bitmap_1(struct bitmap_index *bitmap_git,
>  		}
>  	}
>  
> -	if (midx_preferred_pack(bitmap_git->midx, &preferred_pack) < 0) {
> -		warning(_("could not determine MIDX preferred pack"));
> -		goto cleanup;
> -	}
> -
> -	preferred = bitmap_git->midx->packs[preferred_pack];
> -	if (!is_pack_valid(preferred)) {
> -		warning(_("preferred pack (%s) is invalid"),
> -			preferred->pack_name);
> -		goto cleanup;
> -	}
> -
>  	return 0;

This is a pure removal, not the block of code moved elsewhere. I am having a hard time resolving the conflict between this one and what f34db3f6 (pack-bitmap.c: open and store incremental bitmap layers, 2024-11-19) did to the same part of the file, which is:

@@ -459,13 +478,20 @@ static int open_midx_bitmap_1(struct bitmap_index *bitmap_git,
 		goto cleanup;
 	}
 
-	preferred = bitmap_git->midx->packs[preferred_pack];
+	preferred = nth_midxed_pack(bitmap_git->midx, preferred_pack);
 	if (!is_pack_valid(preferred)) {
 		warning(_("preferred pack (%s) is invalid"),
 			preferred->pack_name);
 		goto cleanup;
 	}
 
+	if (midx->base_midx) {
+		bitmap_git->base = prepare_midx_bitmap_git(midx->base_midx);
+		bitmap_git->base_nr = bitmap_git->base->base_nr + 1;
+	} else {
+		bitmap_git->base_nr = 1;
+	}
+
 	return 0;
 
 cleanup:

Both are from you, and I am guessing that you have tried all of your
topics in flight together, if not the other topics.  I wonder what
we can do better to make sure the work a contributor has already
done (in this case, resolve interaction between two topics) is not
wasted and recreated (possibly incorrectly) by the maintainer.

Thanks.
Previous: Jeff KingNext: Taylor Blau
Message 3 of 6 in “pack-bitmap.c: ensure pack validity for all reuse packs”
  1. pack-bitmap.c: ensure pack validity for all reuse packsTaylor Blau, Dec 13, 2024
  2. Jeff KingDec 18, 2024
  3. Junio C HamanoDec 18, 2024
  4. Taylor BlauDec 18, 2024
  5. Junio C HamanoDec 19, 2024
  6. Taylor BlauDec 19, 2024

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.