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

Re: What's cooking in git.git (Aug 2020, #07; Thu, 27)

From
Jeff King <peff@peff.net>
Date
Aug 28, 2020, 08:31 UTC
Message-ID
<20200828083125.GA2139751@coredump.intra.peff.net>
In-Reply-To
<20200828062619.GA2100989@coredump.intra.peff.net>
On Fri, Aug 28, 2020 at 02:26:19AM -0400, Jeff King wrote:
Show 33 quoted lines
> On Thu, Aug 27, 2020 at 08:39:40PM -0400, Taylor Blau wrote:
> 
> > > >> * tb/repack-clearing-midx (2020-08-26) 1 commit
> > > >>   (merged to 'next' on 2020-08-27 at a465875cbb)
> > > >>  + builtin/repack.c: invalidate MIDX only when necessary
> > [...]
> > Thanks indeed. I started looking into this tonight thinking that it'd be
> > an easy fix, but I think there is a deeper bug that is worth
> > investigating further.
> 
> I imagine this is part of it:
> 
> diff --git a/builtin/repack.c b/builtin/repack.c
> index f10f52779c..2cc05f968a 100644
> --- a/builtin/repack.c
> +++ b/builtin/repack.c
> @@ -134,7 +134,7 @@ static void remove_redundant_pack(const char *dir_name, const char *base_name)
>  {
>  	struct strbuf buf = STRBUF_INIT;
>  	struct multi_pack_index *m = get_multi_pack_index(the_repository);
> -	strbuf_addf(&buf, "%s.pack", base_name);
> +	strbuf_addf(&buf, "%s.idx", base_name);
>  	if (m && midx_contains_pack(m, buf.buf))
>  		clear_midx_file(the_repository);
>  	strbuf_insertf(&buf, 0, "%s/", dir_name);
> 
> but maybe that is just the "easy" part you meant. Several tests still
> seem to fail, which I guess is the "deeper" part. :)
> 
> If I'm understanding midx_contains_pack() correctly, then the code
> looking for ".pack" could never have matched, and we would never have
> deleted a midx here. Which makes me wonder why the "repack removes
> multi-pack-index when deleting packs" test ever succeeded.
Sorry, this is all nonsense.

I forgot about the hackery added in 013fd7ada3 (midx: check both pack and index names for containment, 2019-04-05). And anyway, the patch above is totally bogus because we need the ".pack" form in the buffer when we call unlink_pack_path().

So there's definitely something more odd going on in that failing test.
-Peff
Previous: Jeff KingNext: Taylor Blau
Message 6 of 17 in “What's cooking in git.git (Aug 2020, #07; Thu, 27)”
  1. Junio C HamanoAug 27, 2020
  2. Jeff KingAug 27, 2020
  3. Junio C HamanoAug 27, 2020
  4. Taylor BlauAug 28, 2020
  5. Jeff KingAug 28, 2020
  6. Jeff KingAug 28, 2020
  7. Taylor BlauAug 28, 2020
  8. Elijah NewrenAug 28, 2020
  9. Matheus Tavares BernardinoAug 29, 2020
  10. ds/maintenance-part-[1-2] (was: What's cooking in git.git (Aug 2020, #07; Thu, 27))Derrick Stolee, Aug 28, 2020
  11. Hariom vermaAug 28, 2020
  12. Junio C HamanoAug 28, 2020
  13. Hariom vermaAug 29, 2020
  14. Hariom vermaAug 29, 2020
  15. Junio C HamanoAug 29, 2020
  16. Hariom vermaAug 29, 2020
  17. Junio C HamanoAug 29, 2020

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.