From: Patrick Steinhardt <ps@pks.im>
To: Shashank S via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
Kaartic Sivaraam <kaartic.sivaraam@gmail.com>,
Christian Couder <christian.couder@gmail.com>,
Siddharth Asthana <siddharthasthana31@gmail.com>,
Usman Akinyemi <usmanakinyemi202@gmail.com>,
Junio C Hamano <gitster@pobox.com>,
Shashank S <shashu8660@gmail.com>
Subject: Re: [PATCH] prune-packed: remove USE_THE_REPOSITORY_VARIABLE
Date: Mon, 19 Oct 2026 09:09:11 +0200 [thread overview]
Message-ID: <atXCFxxe3Lg7fV2W@pks.im> (raw)
In-Reply-To: <pull.2266.git.1792341073005.gitgitgadget@gmail.com>
On Sun, Oct 18, 2026 at 04:31:12PM +0000, Shashank S via GitGitGadget wrote:
> From: Shashank <shashu8660@gmail.com>
>
> Right now, the prune_packed_objects() function uses the global
Nit: we typically refrain from saying "now", as it's implicitly clear
that you're describing the status quo in your commit message unless you
explicitly refer to an older commit.
> the_repository variable. To help with the libification effort,
> change this function so it takes a 'struct repository' pointer
> as an argument instead.
>
> The function for_each_loose_file_in_source() uses a callback
> that only takes a single 'void *data' pointer. This means we
> cannot pass both the repository pointer and the 'opts' integer
> at the same time. To fix this, create a new 'struct prune_data'
> to hold both of them together, and update the prune_subdir() and
> prune_object() callbacks to read from this new struct.
>
> Update the builtins that call this function (builtin/prune-packed.c,
> builtin/prune.c, and builtin/repack.c) to pass their local `repo`
> variables. Because we are now actually using the 'repo' parameter
> in these files, we can safely remove the UNUSED macro from them.
The question isn't really whether we can safely remove the UNUSED macro.
The question is rather whether we can assume that `repo` always points
to a proper repository. And for that you need to research whether these
commands can be invoked outside of a repository, because if so the repo
may be `NULL`.
> finally, drop the USE_THE_REPOSITORY_VARIABLE macro from
s/finally/Finally
> prune-packed.c.
>
> Signed-off-by: Shashank <shashu8660@gmail.com>
We typically ask contributors to spell out their full name, see
Documentation/SubmittingPatches [[real-name]].
The changes all look sensible to me, thanks!
Patrick
next prev parent reply other threads:[~2026-10-19 7:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-18 16:31 [PATCH] prune-packed: remove USE_THE_REPOSITORY_VARIABLE Shashank S via GitGitGadget
2026-10-19 7:09 ` Patrick Steinhardt [this message]
2026-10-19 16:38 ` Shashank S
2026-10-19 21:05 ` Junio C Hamano
2026-10-19 16:53 ` [PATCH v2] [Outreachy Patch] " Shashank S via GitGitGadget
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=atXCFxxe3Lg7fV2W@pks.im \
--to=ps@pks.im \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=kaartic.sivaraam@gmail.com \
--cc=shashu8660@gmail.com \
--cc=siddharthasthana31@gmail.com \
--cc=usmanakinyemi202@gmail.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.