From: Patrick Steinhardt <ps@pks.im>
To: Tian Yuchen <cat@malon.dev>
Cc: git@vger.kernel.org, gitster@pobox.com, karthik.188@gmail.com,
phillip.wood@dunelm.org.uk, jltobler@gmail.com
Subject: Re: [PATCH v1] builtin/mktree: remove USE_THE_REPOSITORY_VARIABLE
Date: Thu, 12 Mar 2026 07:55:28 +0100 [thread overview]
Message-ID: <abJjYNq_sxeH8yLQ@pks.im> (raw)
In-Reply-To: <20260311181704.958509-1-cat@malon.dev>
On Thu, Mar 12, 2026 at 02:17:03AM +0800, Tian Yuchen wrote:
> The 'cmd_mktree' already receives a 'struct repository *repo' but was
> previously marked as UNUSED.
>
> Pass the 'repo' down the 'mktree-line()' and 'write_tree()'.
I guess s/the/to/? Also, it's `mktree_line()`, not `mktree-line()`.
One thing that commit messages should also explain is why a certain
refactoring is safe to do. That is, can `repo` ever be `NULL`? For that
you have to look at "git.c" and figure out whether or not the command
requires a repository to exist.
> The 'oid_to_hex' function appears to use 'the_hash_algo' internally.
> Seems that it also implicitly relying on global state. Is there
> anything we should be aware of?
`oid_to_hex()` falls back to using `the_hash_algo` in case the object ID
you have doesn't have a proper hash specified. So this depends on how
exactly you construct the object IDs: if you parse them with a proper
hash algorithm, then you're fine.
> I've always been unsure about who to CC on domain-specific patches,
> so I've only been sending them to Junio and the mailing list. Could
> this be why my previous patch for a global variable refactor didn't
> receive any review feedback? Here is the link:
It's typically fine to just send to the mailing list, so you wouldn't
even Cc Junio. Sometimes it's just a matter of capacity, and it's fine
to eventually send a ping after a week or two have passed without any
feedback.
The patch itself looks good to me, thanks!
Patrick
next prev parent reply other threads:[~2026-03-12 6:55 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 [this message]
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
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=abJjYNq_sxeH8yLQ@pks.im \
--to=ps@pks.im \
--cc=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 \
/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