git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Outreachy PATCH] environment: move commit_encoding into repo_config_values

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 21, 2026, 20:44 UTC
Message-ID
<xmqq33tyn5qi.fsf@gitster.g>
In-Reply-To
<20261021155608.58509-1-okhuomonajayi54@gmail.com>
Okhuomon Ajayi <okhuomonajayi54@gmail.com> writes:
Show 14 quoted lines
> 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.
Previous: Okhuomon AjayiNext: Okhuomon Ajayi
Message 2 of 3 in “environment: move commit_encoding into repo_config_values”
  1. environment: move commit_encoding into repo_config_valuesOkhuomon Ajayi, Oct 21, 2026
  2. Junio C HamanoOct 21, 2026
  3. Okhuomon AjayiOct 21, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.