git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Derrick Stolee <derrickstolee@github.com>
To: Taylor Blau <me@ttaylorr.com>, git@vger.kernel.org
Cc: gitster@pobox.com, peff@peff.net
Subject: Re: [PATCH v2 2/3] midx.c: use `pack-objects --stdin-packs` when repacking
Date: Fri, 23 Sep 2022 14:23:30 -0400	[thread overview]
Message-ID: <5172dbb7-61d1-7249-f9bb-d760e6f4450a@github.com> (raw)
In-Reply-To: <4218d9e08aba629d8f64b5a999f60d12e5d8785b.1663706401.git.me@ttaylorr.com>

On 9/20/2022 4:40 PM, Taylor Blau wrote:

> +	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

  reply	other threads:[~2022-09-23 18:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <YyokIf%2FSd7SYztKQ@nand.local>
2022-09-20 20:40 ` [PATCH v2 0/3] midx: use `--stdin-packs` to implement `repack` Taylor Blau
2022-09-20 20:40   ` [PATCH v2 1/3] midx.c: compute pack_info array outside of fill_included_packs_batch() Taylor Blau
2022-09-20 20:40   ` [PATCH v2 2/3] midx.c: use `pack-objects --stdin-packs` when repacking Taylor Blau
2022-09-23 18:23     ` Derrick Stolee [this message]
2022-09-23 18:28       ` Taylor Blau
2022-09-23 19:05         ` Derrick Stolee
2022-09-20 20:40   ` [PATCH v2 3/3] midx.c: unify `include_pack` array into `pack_info` struct Taylor Blau
2022-09-20 21:54   ` [PATCH v2 0/3] midx: use `--stdin-packs` to implement `repack` Jeff King
2022-09-21 19:09   ` Junio C Hamano
2022-09-23 18:29     ` Taylor Blau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5172dbb7-61d1-7249-f9bb-d760e6f4450a@github.com \
    --to=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).