]> git.99rst.org Git - git.git/commit
environment: move editor_program into repo_config_values
authorTian Yuchen <redacted>
Tue, 14 Jul 2026 03:25:18 +0000 (11:25 +0800)
committerJunio C Hamano <redacted>
Tue, 14 Jul 2026 14:30:23 +0000 (07:30 -0700)
commit469e95c2573e938c0963ba52e8d06dd6aa7ba262
treee0e70f919de67091de2335425de4f72b13174d6f
parent7488b9d1fd505ce1194b98893508fa5b194cf0cd
environment: move editor_program into repo_config_values

The global variable 'editor_program' holds the path to the user's
preferred editor. Move 'editor_program' into
'struct repo_config_values' to continue the libification effort.

There have been discussions on whether external programs like
editors truly need to be configured on a per-repository basis within
the same process. While a single process might rarely invoke
different editors, this migration is necessary for two reasons:

1. Developers frequently use different toolchains for different
   projects. Per-repo configuration respects this.

2. Moving this string into 'repo_config_values' eliminates mutable
   global state. As the codebase moves toward becoming a long-running
   processes, managing multiple repositories concurrently must
   not overwrite each other's program configurations.

No standalone getter function is introduced. Callers directly access
the field via 'repo_config_values()'. Heap memory is safely reclaimed
in 'repo_config_values_clear()'.

Mentored-by: Christian Couder <redacted>
Mentored-by: Ayush Chandekar <redacted>
Mentored-by: Olamide Caleb Bello <redacted>
Signed-off-by: Tian Yuchen <redacted>
Signed-off-by: Junio C Hamano <redacted>
editor.c
environment.c
environment.h
git clone https://git.99rst.org/PROJECT