From: shejialuo <shejialuo@gmail.com>
To: Karthik Nayak <karthik.188@gmail.com>
Cc: git@vger.kernel.org, ps@pks.im,
Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH v2] builtin: allow passing custom data to sub-commands
Date: Tue, 26 Nov 2024 19:57:34 +0800 [thread overview]
Message-ID: <Z0W3rgHQhmUxjgfp@ArchLinux> (raw)
In-Reply-To: <20241126-374-add-repository-to-subsubcommands-v2-1-417e0dc66c75@gmail.com>
On Tue, Nov 26, 2024 at 12:19:22PM +0100, Karthik Nayak wrote:
> In 9b1cb5070f (builtin: add a repository parameter for builtin
> functions, 2024-09-13) the repository was passed down to all builtin
> commands. This allowed the repository to be passed down to lower layers
> without depending on the global `the_repository` variable.
>
> To remove usage of global variables like `the_repository` in
> sub-commands, it makes sense to pass down the repository value from the
> commands to the sub-commands. But let's make it more generic and modify
> `parse_opt_subcommand_fn` to instead take a `void *` value. This way we
> can provide custom structures to each sub-command.
>
From my perspective, I think using either "struct repository *" or "void
*" is OK. However, I am a little concerned about using "void *" at
current. It gives me a feeling that we over-optimize here.
Thanks,
Jialuo
next prev parent reply other threads:[~2024-11-26 11:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-25 14:55 [PATCH] builtin: pass repository to sub commands Karthik Nayak
2024-11-26 8:46 ` Christian Couder
2024-11-26 9:50 ` karthik nayak
2024-11-26 8:56 ` Patrick Steinhardt
2024-11-26 9:56 ` karthik nayak
2024-11-26 19:26 ` Junio C Hamano
2024-11-26 11:19 ` [PATCH v2] builtin: allow passing custom data to sub-commands Karthik Nayak
2024-11-26 11:57 ` shejialuo [this message]
2024-11-26 16:41 ` karthik nayak
2024-11-26 19:27 ` Junio C Hamano
2024-11-27 9:15 ` karthik nayak
2024-11-27 12:23 ` karthik nayak
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=Z0W3rgHQhmUxjgfp@ArchLinux \
--to=shejialuo@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=karthik.188@gmail.com \
--cc=ps@pks.im \
/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 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 NNTP newsgroup(s).