Re: [Outreachy PATCH] environment: move commit_encoding into repo_config_values
- From
- Okhuomon Ajayi <okhuomonajayi54@gmail.com>
- Date
- Oct 21, 2026, 21:20 UTC
- Message-ID
- <CAFpMFfCZdz4WLcwJFefXTQ1v_g+mgFQOHxzkf0aZoPqTz3o-=A@mail.gmail.com>
- In-Reply-To
- <xmqq33tyn5qi.fsf@gitster.g>
On Wed, Oct 21, 2026 at 9:44 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> 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, that makes sense.
So for v2, write_commit_tree() and commit_tree_extended() would both take the encoding as a "const char *" parameter. The callers of commit_tree_extended() would look up i18n.commitEncoding from the config and pass it in, and commit_tree() would do the same for its own callers. Nothing would be added to repo_config_values.
Does that match what you had in mind?