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

[PATCH v2 0/3] migrate encoding settings and bubble up repository

From
Tian Yuchen <a3205153416@gmail.com>
Date
Feb 28, 2026, 19:01 UTC
Message-ID
<20260228190201.3684705-1-a3205153416@gmail.com>
In-Reply-To
<20260228040727.2057192-1-a3205153416@gmail.com>
Hi everyone,

As part of the ongoing libification effort and my GSoC 2026 proposal, this series migrates commit and log encoding settings into 'struct repo_settings' and bubbles up the 'struct repository *' dependency.

Previously, 'git_commit_encoding' and 'git_log_output_encoding' were global, where core APIs implicitly rely on 'the_repository'. This series resolves this in three steps:

  - Patch 1: Moves encoding configs into 'repo_settings' using lazy
    -loading, safely handling CLI overrides in 'revision.c'.
  - Patch 2: Updates 'commit_tree()' and related APIs in 'commit.c'
    to accept a repository context, passing it down the call chain.
  - Patch 3: Updates 'pretty_print_commit()' and 'pp_commit_easy()'.
    We leverage existing contextual pointers ('diffopt->repo' and 
    'revs->repo') to pass the repository downwards.

To maintain a clean boundary, leaf callers in 'builtin/' and top-level components (e.g., 'bundle.c') fall back to 'the_repository'.

(Though series passes the full test suite and is verified with 'S ANITIZE=address,undefined', I'm quite certain I must have inadvertently left out some parts. Therefore, this patch series is currently more of a self-archival exercise than a final submission.

For example, I might have left out some of the exsiting contextual pointers in patch 2. Will check in the following days.)

Regards,
Yuchen
Tian Yuchen (3):
  environment: migrate encoding settings to repo-settings
  commit: pass 'struct repository' to commit creation APIs
  pretty: pass 'struct repository' to pretty_print_commit()
 builtin/am.c          |  6 +++---
 builtin/blame.c       |  2 +-
 builtin/checkout.c    |  4 ++--
 builtin/commit-tree.c |  2 +-
 builtin/commit.c      |  8 ++++----
 builtin/history.c     |  2 +-
 builtin/log.c         |  4 ++--
 builtin/mailinfo.c    |  2 +-
 builtin/merge.c       |  6 +++---
 builtin/rebase.c      |  2 +-
 builtin/reset.c       |  2 +-
 builtin/rev-list.c    |  4 ++--
 builtin/shortlog.c    |  4 ++--
 builtin/show-branch.c |  2 +-
 builtin/stash.c       | 12 ++++++------
 bundle.c              |  4 ++--
 commit.c              | 31 +++++++++++++++++--------------
 commit.h              |  6 ++++--
 diff.c                |  2 +-
 environment.c         | 37 +++++++++++--------------------------
 environment.h         |  7 ++-----
 log-tree.c            |  6 +++---
 notes-cache.c         |  4 ++--
 notes-cache.h         |  2 +-
 notes-utils.c         |  2 +-
 pretty.c              | 13 +++++++------
 pretty.h              |  4 ++--
 range-diff.c          | 10 +++++-----
 remote-curl.c         |  3 ++-
 replay.c              |  4 ++--
 repo-settings.c       |  7 +++++++
 repo-settings.h       |  3 +++
 revision.c            | 11 ++++++-----
 sequencer.c           | 36 ++++++++++++++++++------------------
 submodule.c           |  2 +-
 35 files changed, 128 insertions(+), 128 deletions(-)
-- 
2.43.0
Previous: Tian YuchenNext: Tian Yuchen
Message 2 of 13 in “environment: migrate encoding settings to repo-settings”
  1. environment: migrate encoding settings to repo-settingsTian Yuchen, Feb 28, 2026
  2. 0/3 migrate encoding settings and bubble up repositoryTian Yuchen, Feb 28, 2026
  3. 1/3 environment: migrate encoding settings to repo-settingsTian Yuchen, Feb 28, 2026
  4. 2/3 commit: pass 'struct repository' to commit creation APIsTian Yuchen, Feb 28, 2026
  5. 3/3 pretty: pass 'struct repository' to pretty_print_commit()Tian Yuchen, Feb 28, 2026
  6. 0/3 environment: move encoding configs to struct repositoryTian Yuchen, Mar 1, 2026
  7. 1/3 commit: plumb 'struct repository' into commit creation APIsTian Yuchen, Mar 1, 2026
  8. 2/3 pretty: plumb 'struct repository' into pretty-print APIsTian Yuchen, Mar 1, 2026
  9. 3/3 environment: migrate encoding configs to struct repositoryTian Yuchen, Mar 1, 2026
  10. 0/3 move encoding configs to repo_config_values()Tian Yuchen, Mar 2, 2026
  11. 1/3 commit: plumb 'struct repository' into commit creation APIsTian Yuchen, Mar 2, 2026
  12. 2/3 pretty: plumb 'struct repository' into pretty-print APIsTian Yuchen, Mar 2, 2026
  13. 3/3 environment: migrate encoding configs to repo_config_values()Tian Yuchen, Mar 2, 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.