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

Re: [PATCH v2 2/3] midx.c: use `pack-objects --stdin-packs` when repacking

From
Derrick Stolee <derrickstolee@github.com>
Date
Sep 23, 2022, 18:23 UTC
Message-ID
<5172dbb7-61d1-7249-f9bb-d760e6f4450a@github.com>
In-Reply-To
<4218d9e08aba629d8f64b5a999f60d12e5d8785b.1663706401.git.me@ttaylorr.com>
On 9/20/2022 4:40 PM, Taylor Blau wrote:
Show 5 quoted lines
> +	for (i = 0; i < m->num_packs; i++) {
> +		struct repack_info *info = &pack_info[i];
>  
> -		if (!include_pack[pack_int_id])
> -			continue;
...
> +		fprintf(cmd_in, "%s%s\n", include_pack[info->pack_int_id] ? "" : "^", scratch.buf);

Outside of how the object set is provided (a list of objects or a list of packs) it seems this is equivalent. The only difference is that we are writing a line for _every_ pack in the multi-pack-index, but we preface the line with "^" to say "not this pack".

Do you know if there is any reason to do this explicitly? Does this change the set of objects in any way (perhaps by not including duplicates that are tracked in those other packs)?

Personally, I would have kept the "if (...) continue;" pattern, so maybe you had a concrete idea why this approach is better.

Thanks, -Stolee

Previous: Taylor BlauNext: Taylor Blau
Message 4 of 10 in “midx: use `--stdin-packs` to implement `repack`”
  1. 0/3 midx: use `--stdin-packs` to implement `repack`Taylor Blau, Sep 20, 2022
  2. 1/3 midx.c: compute pack_info array outside of fill_included_packs_batch()Taylor Blau, Sep 20, 2022
  3. 2/3 midx.c: use `pack-objects --stdin-packs` when repackingTaylor Blau, Sep 20, 2022
  4. Derrick StoleeSep 23, 2022
  5. Taylor BlauSep 23, 2022
  6. Derrick StoleeSep 23, 2022
  7. 3/3 midx.c: unify `include_pack` array into `pack_info` structTaylor Blau, Sep 20, 2022
  8. Jeff KingSep 20, 2022
  9. Junio C HamanoSep 21, 2022
  10. Taylor BlauSep 23, 2022

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.