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

[Outreachy] - Proposal Submission for Refactor in order to reduce Git’s global state

From
Solomon Akpuru <solobarine@gmail.com>
Date
Nov 3, 2025, 14:22 UTC
Message-ID
<CA+tvzBUr8ExMPLrNcppX9tiBvhrAG9RNwBU55evQgVvTrGzi4Q@mail.gmail.com>

Personal Bio Name Solomon (Solly) Akpuru GitHub github.com/solobarine Portfolio solobarine.netlify.app _______________________________

Overview

The Git codebase currently contains several global variables, particularly in environment.c, that govern configuration and runtime state. This architecture makes it harder to reason about concurrent repository operations and limits scalability toward multi-repository support.

This project aims to refactor environment.c to reduce its global state by migrating relevant environment and configuration variables into struct repository or struct repository_settings. This will improve code maintainability, make the behavior more predictable, and pave the way for better isolation across repositories. ________________________________

Motivation

Reducing global state is a long-standing architectural goal within Git. It improves testability, reduces hidden side effects, and allows multiple repositories to coexist in a single process safely — an increasingly important concern for complex integrations and GUI clients.

The project continues the ongoing modernization efforts within Git’s environment and configuration management, aligning with recent patches that relocated configuration options from global to repository-local contexts. ________________________________

Technical Goals
Audit global variables in environment.c and related modules.

Identify variables suitable for migration into struct repository or struct repository_settings.

Implement refactors ensuring all code paths properly initialize and reference the repository-local state.

Maintain full compatibility with existing functionality.
Update and extend the test suite to cover modified logic.

Document the architectural rationale and the migration steps for future contributors.

________________________________
Methodology

Study prior commits where similar refactoring was done (e.g., environment and config-related globals).

Use static analysis and grep-based search to identify read/write access patterns.

Refactor incrementally, submitting each migration as an independent patch series.

Collaborate actively on the Git mailing list, incorporating reviewer feedback promptly.

Rely on Git’s existing CI/test infrastructure to validate changes. ________________________________

Project Timeline: Dec 8 – Dec 21, 2025 Studying environment.c, mapping globals Dec 22 – Jan 4, 2026 Implementing and submitting first patch series Jan 5 – Feb 1, 2026 Extending refactors, handling interdependencies Feb 2 – Feb 15, 2026 Testing, documentation, and refinement Feb 16 – Mar 6, 2026 Final submission and wrap-up ________________________________

Expected Outcome
Significant reduction of global variables in Git’s environment handling.
Cleaner, more modular architecture for configuration and runtime data.
Improved multi-repository handling capability.
Comprehensive documentation and test coverage to support future contributors.
Message 1 of 1 in “[Outreachy] - Proposal Submission for Refactor in order to reduce Git’s global state”
  1. Solomon AkpuruNov 3, 2025

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.