All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: git@vger.kernel.org, Derrick Stolee <derrickstolee@github.com>,
	Jeff King <peff@peff.net>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Victoria Dye <vdye@github.com>
Subject: Re: [PATCH 2/2] builtin/repack.c: avoid dir traversal in `collect_pack_filenames()`
Date: Mon, 10 Jul 2023 14:35:19 -0700	[thread overview]
Message-ID: <xmqqa5w34fhk.fsf@gitster.g> (raw)
In-Reply-To: <b3d0d9308ef1a0aab8dd5a65354044568c65388b.1689017830.git.me@ttaylorr.com> (Taylor Blau's message of "Mon, 10 Jul 2023 15:37:18 -0400")

Taylor Blau <me@ttaylorr.com> writes:

> However, manually enumerating a repository's packs via `readdir()` is
> confusing and error-prone. It leads to frustrating inconsistencies
> between which packs Git considers to be part of a repository (i.e.,
> could be found in the list of packs from `get_all_packs()`), and which
> packs `collect_pack_filenames()` considers to meet the same criteria.

Makes sense.

> One gotcha here is that we have to ignore non-local packs, since the
> original version of `collect_pack_filenames()` only looks at the local
> pack directory to collect existing packs.

Yup.

Does this "fix" anything, or just makes the resulting code clearer
and protects it from future breakage?  I think it is the latter and
not having any test is justified.

Thanks.

  reply	other threads:[~2023-07-10 21:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10 19:37 [PATCH 0/2] repack: make `collect_pack_filenames()` consistent Taylor Blau
2023-07-10 19:37 ` [PATCH 1/2] builtin/repack.c: only repack `.pack`s that exist Taylor Blau
2023-07-10 20:09   ` Junio C Hamano
2023-07-11 17:28     ` Taylor Blau
2023-07-10 19:37 ` [PATCH 2/2] builtin/repack.c: avoid dir traversal in `collect_pack_filenames()` Taylor Blau
2023-07-10 21:35   ` Junio C Hamano [this message]
2023-07-11 17:29     ` Taylor Blau
2023-07-11 17:32 ` [PATCH v2 0/2] repack: make `collect_pack_filenames()` consistent Taylor Blau
2023-07-11 17:32   ` [PATCH v2 1/2] builtin/repack.c: only repack `.pack`s that exist Taylor Blau
2023-07-11 17:32   ` [PATCH v2 2/2] builtin/repack.c: avoid dir traversal in `collect_pack_filenames()` 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

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

  git send-email \
    --in-reply-to=xmqqa5w34fhk.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=peff@peff.net \
    --cc=vdye@github.com \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.