From: Tian Yuchen <cat@malon.dev>
To: Junio C Hamano <gitster@pobox.com>
Cc: Patrick Steinhardt <ps@pks.im>,
git@vger.kernel.org, karthik.188@gmail.com,
phillip.wood@dunelm.org.uk, jltobler@gmail.com
Subject: Re: [PATCH v1] builtin/mktree: remove USE_THE_REPOSITORY_VARIABLE
Date: Sat, 14 Mar 2026 11:17:58 +0800 [thread overview]
Message-ID: <77a9fc5cb543579ab925eca9fc9c2b1b@purelymail.com> (raw)
In-Reply-To: <xmqqh5qj4h1z.fsf@gitster.g>
Hi Junio,
> Tian Yuchen <cat@malon.dev> writes:
>
>> On 3/14/26 01:54, Junio C Hamano wrote:
>>
>>> I strongly disagree your idea that 'z' is more business logic than
>>> 'h' is. Both are equally relevant.
>>
>> Perhaps I didn't explain myself clearly :(
>>
>> I do understand that *currently* both are part of the business logic.
>> However, what puzzles me is: why is it written this way? Why isn't -h
>> intercepted at the outer global level, but instead handed off to a
>> function like parse_options() for interception?
>>
>> Is this due to historical reasons?
>>
>> Please forgive my slowness. I would appreciate it if you could offer
>> some guidance!
>
> It is perfectly OK to be slow. Spend enough time to study the code
> so that you do not have to ask for forgiveness ;-)
>
> In order to make a useful response to "-h", that business logic
> needs to know what options are available and what argument they take
> etc., which is already given to parse_options API. What makes it
> make any sense to split it to separate codepath?
I see.
I’ve been thinking about it, and moving it to an external file seems
to break encapsulation also. If 'option[]' is no longer static, then the
code
that originally handled this logic would have to be moved to a file like
'git.c', and the codebase would increase significantly. That’s probably
not what we want, right?
This is not only semantically confusing, but it also doesn't work any
better in practice.
I kept thinking about maintaining a separate framework to intercept
all of this — I guess I’ve fallen into a certain mindset when it comes
to
modern CLIs. These changes, which do not offer any significant
advantages,
seem to actually undermine performance and local clarity. It really
isn’t
worth the effort.
I hadn't actually planned to migrate anything. I was just a bit confused
as
to why it was written this way.
Thank you,
Yuchen
prev parent reply other threads:[~2026-03-14 3:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-11 18:17 [PATCH v1] builtin/mktree: remove USE_THE_REPOSITORY_VARIABLE Tian Yuchen
2026-03-12 6:55 ` Patrick Steinhardt
2026-03-12 16:21 ` Tian Yuchen
2026-03-13 7:02 ` Patrick Steinhardt
2026-03-13 16:03 ` Junio C Hamano
2026-03-13 17:15 ` Tian Yuchen
2026-03-13 17:54 ` Junio C Hamano
2026-03-13 18:12 ` Tian Yuchen
2026-03-13 20:20 ` Junio C Hamano
2026-03-14 3:17 ` Tian Yuchen [this message]
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=77a9fc5cb543579ab925eca9fc9c2b1b@purelymail.com \
--to=cat@malon.dev \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jltobler@gmail.com \
--cc=karthik.188@gmail.com \
--cc=phillip.wood@dunelm.org.uk \
--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