From: Junio C Hamano <gitster@pobox.com>
To: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
Cc: git@vger.kernel.org, christian.couder@gmail.com,
usmanakinyemi202@gmail.com, siddharthasthana31@gmail.com,
kaartic.sivaraam@gmail.com
Subject: Re: [Outreachy PATCH] environment: move commit_encoding into repo_config_values
Date: Wed, 21 Oct 2026 13:44:37 -0700 [thread overview]
Message-ID: <xmqq33tyn5qi.fsf@gitster.g> (raw)
In-Reply-To: <20261021155608.58509-1-okhuomonajayi54@gmail.com> (Okhuomon Ajayi's message of "Wed, 21 Oct 2026 16:56:08 +0100")
Okhuomon Ajayi <okhuomonajayi54@gmail.com> writes:
> Move i18n.commitEncoding from the global git_commit_encoding variable
> into struct repo_config_values.
>
> Initialize and release the value with the other repository config
> values.
>
> Pass the repository to write_commit_tree().
>
> Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
> ---
> commit.c | 16 ++++++++++------
> environment.c | 15 +++++++++++----
> environment.h | 4 +++-
> 3 files changed, 24 insertions(+), 11 deletions(-)
I am not sure if this change makes sense. The 'git_commit_encoding'
variable is declared in 'environment.h' to be globally available and
defined in 'environment.c', but its only user is the 'commit.c' file.
I do not think it is worth contaminating the repository configuration
with it. Instead, shouldn't we allow the functions that use this
global to take a "const char *git_commit_encoding" parameter (instead
of a 'repository_config' or a 'repository' structure) and pass it
through? The callers may need to query the config subsystem to learn
the appropriate encoding for the repository they are working with
before calling these functions, but there is no need to pass the
entire repository structure down the call graph.
Thanks.
next prev parent reply other threads:[~2026-10-21 20:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 15:56 [Outreachy PATCH] environment: move commit_encoding into repo_config_values Okhuomon Ajayi
2026-10-21 20:44 ` Junio C Hamano [this message]
2026-10-21 21:20 ` Okhuomon Ajayi
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=xmqq33tyn5qi.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=kaartic.sivaraam@gmail.com \
--cc=okhuomonajayi54@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox