{"thread":{"id":"66814","subject":"[Outreachy] Internship Proposal: Reduce Git’s Global State to Enable Its Libification","startedAt":"2026-11-09T16:52:36Z","lastAt":"2026-11-09T16:52:36Z","messageCount":1,"participants":["Joie Joie"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"557964","messageId":"CAH=d44ffiqADJH-kAsfrehutNny1ex+de_yJ=nJXbqrGwZ=kQw@mail.gmail.com","threadId":"66814","inReplyTo":null,"subject":"[Outreachy] Internship Proposal: Reduce Git’s Global State to Enable Its Libification","fromName":"Joie Joie","fromEmail":"soniqjjj@gmail.com","sentAt":"2026-11-09T16:52:36Z","receivedAt":"2026-11-09T16:52:36Z","isPatch":false,"sender":{"key":"soniqjjj@gmail.com","avatar":null},"body":"Applicant:: Joy Gundu\nCommunity: Git\nProject: Reduce Git’s global state to enable its libification\nMentors: Usman Akinyemi and Christian Couder\nInternship period: December 2026\nEmail:   soniqjjj@gmail.com\nGitHub: https://github.com/Joiejoie1\nBlog:https://joyg454090.substack.com/publish/post/224165227\n\n\n1.  About Me\n   ============\n\nHello everyone,\n\nI'm Joy Gundu, a software Engineer and an ALX Software Engineering\nalumnus. My academic background is in Mass Communications, but I\ndeveloped an interest in software development and gradually worked\ntowards building a career in technology.\n\nThrough my training and practical experience, I've worked with\ndifferent programming languages, development tools, and collaborative\nworkflows. I've also learned that writing code is only one part of\nsoftware development. Understanding how existing systems work, testing\nchanges, and making code easier to maintain are just as important.\n\nI joined Git's Outreachy contribution period because I wanted to\nchallenge myself by working on a large C codebase and learn more about\nhow software works behind the scenes.\n\nSince then, I've spent time reading Git's source code, tracing how\ndifferent parts of the project work together, investigating existing\nimplementations, and preparing patches. I'm still learning, especially\nwhen it comes to systems programming, but I enjoy working through\nunfamiliar problems and understanding them before making changes.\n\nI hope to use this internship to become more confident working with C,\nunderstand software architecture better, and contribute more\nmeaningfully to Git.\n\n2.  Past Experience with Git\n========================\n\nI've used Git throughout my software development journey, mostly for\ntracking changes, managing branches, and collaborating with other\ndevelopers. Contributing to the project has given me a much better\nappreciation of what happens behind those everyday commands.\n\nThe project to reduce Git's global state caught my attention because\nit addresses an important part of software design: making a large\ncodebase easier to understand, maintain, and eventually reuse as a\nlibrary.\n\nI'm interested in understanding how shared global data affects\ndifferent parts of a project and how moving suitable state into\nstructures with clearer ownership can make the code more modular.\n\nI've also come to appreciate Git's community and its approach to\nreviewing contributions. The mailing-list workflow was unfamiliar to\nme at first, but I've learned a lot from seeing how contributors\ndiscuss ideas, question implementations, and explain why one approach\nmight be better than another.\n\nSome of the feedback I've received has changed how I approach\nproblems. I've learned that a patch needs more than working code. It\nshould have a clear reason for existing, preserve expected behavior,\nand fit the project's broader direction.\n\nThat's what makes this experience valuable to me. I'm not just\nlearning how to make changes to Git; I'm learning how to think through\nthose changes and contribute responsibly to a mature open-source\nproject.\n\n3. My Git Contributions and What I Have Learned\n==================================\n\nDuring the contribution period, I worked on several areas of Git's\ncodebase. My work included preparing patches, investigating existing\nimplementations, running tests, examining CI failures, and discussing\npossible improvements with other contributors.\n\n3.1 Working on pack-size configuration\n\nOne of my contributions involved the pack-size configuration area.\n\nI looked into how the existing configuration was represented and how\nit could be handled as part of the wider effort to reduce global\nstate. I prepared a patch series and spent time understanding the\nrelevant initialization and configuration tests.\n\nAs part of the work, I:\n\nExamined how pack-size configuration values were defined and used.\n\nTraced how the values were initialized.\n\nWorked on the changes as a patch series.\n\nBuilt Git and ran the relevant tests.\n\nI tested the changes using:\n\nt1300-config.sh — 518 tests passed.\n\nt5300-pack-object.sh — 63 tests passed, with 2 skipped.\n\nThis work helped me understand why it's important to follow a\nconfiguration value through the codebase instead of looking only at\nwhere it is declared.\n\nI also gained more experience preparing patch series, testing changes,\nand working with Git's development workflow.\n\n3.2 Zero-initializing repository configuration values\n\nAnother contribution I worked on was repo_config_values_init() in environment.c.\n\nWhile reading the function, I noticed that several configuration\nfields were being assigned zero or NULL individually. I thought the\ninitialization could be simplified by using memset() to initialize the\nstructure at once, while keeping the non-zero defaults separate.\n\nMy proposed change was:\n\nmemset(cfg, 0, sizeof(*cfg));\n\nI submitted it as PR #2298 — repo: zero-initialize configuration values.\n\nI built Git using:\n\nmake -j2 NO_RUST=YesPlease NO_ICONV=YesPlease\n\nI also ran the configuration test suite:\n\nmake NO_RUST=YesPlease NO_ICONV=YesPlease test T=t1300-config.sh\n\nAll 531 tests passed, and the patch passed git diff --check and git\nshow --check.\n\nThe review process was particularly useful. Patrick Steinhardt\nconsidered the patch correct and a good improvement. Junio C Hamano\nthen suggested that a C99 compound literal might be a better way to\ninitialize the structure.\n\nThat feedback made me think more carefully about the implementation. I\nhad focused on simplifying the existing assignments, but the\ndiscussion helped me consider how the entire structure is overwritten\nand whether the proposed approach follows the project's preferred\nstyle.\n\nIt reminded me that passing tests is important, but so is choosing an\nimplementation that fits the codebase.\n\nAt the time of writing, the patch was still under review.\n\n3.3 Learning from existing repository configuration migrations\n\nI also spent time studying earlier changes that moved configuration\nvalues into repo_config_values.\n\nOne example that helped me was the migration of askpass_program into\nrepository-specific configuration.\n\nBy following that change, I began to understand that moving a global\nvariable involves more than adding a new structure member. It's also\nnecessary to update every place that reads or modifies the value and\nunderstand how it is initialized and cleaned up.\n\nI looked at:\n\nWhere the original global variable was declared.\n\nHow the corresponding structure member was introduced.\n\nWhich parts of Git needed to be updated.\n\nHow the value was initialized.\n\nHow its lifetime and cleanup were handled.\n\nThis gave me a better understanding of why ownership matters when\nreducing global state. Before moving a value, it's important to know\nwhich repository or component should own it and how long that value\nneeds to exist.\n\n3.4 Exploring Git's test infrastructure\n\nI also spent time learning more about Git's test framework.\n\nI experimented with a small example command and its tests in\nt9999-psuh.sh. The test passed locally.\n\nAlthough this was exploratory work rather than a merged contribution,\nit helped me become more comfortable writing and running Git tests and\nunderstanding how command behavior is verified.\n\nIt also reinforced the importance of testing changes rather than\nrelying only on whether the code builds.\n\n3.5 Investigating CI and build-related issues\n\nAnother area I explored was Git's CI setup.\n\nI investigated an issue involving the replacement of the dirname\nsymlink in Git's dependency installation script. The proposed change\nwas to use sudo when replacing the symlink:\n\nsudo ln -sfT /usr/bin/gnudirname /usr/bin/dirname\n\nThis gave me some experience looking into how permissions and\ndifferences between CI environments can affect builds and tests.\n\nI also became more comfortable reading CI logs and checking whether a\nfailure was related to my changes or to something happening in the\ntesting environment.\n\n3.6 Studying the object database refactoring\n\nAs I became more familiar with Git's internal structure, I started\nlooking into the object database refactoring, particularly the changes\naround odb/source-files and fast-import.\n\nWhile reading builtin/fast-import.c, I noticed that store_object() and\nstream_blob() still traverse the files backend directly when checking\nwhether an object already exists in a pack.\n\nI wondered whether the existing repo_for_each_pack() helper could be\nused instead. Before making any changes, I discussed the idea with\nPatrick Steinhardt.\n\nHis response helped me understand why that would not be the right\nsolution. Although the helper hides the directory traversal, it still\nassumes that the object database backend uses packfiles. The\nlonger-term direction for fast-import is to use transactions, which\nwould avoid that dependency. Patrick also mentioned that Karthik had\nalready started looking into this work.\n\nI decided not to pursue the iterator replacement.\n\nThis was a useful learning experience because it showed me that a\nchange can make code look cleaner without actually solving the\nunderlying architectural problem. It also taught me to check the\nproject's direction and coordinate with other contributors before\ntaking on related work.\n\n4. My Understanding of the Internship Project\n==================================\n\nFrom my experience so far, I understand that the goal of this project\nis to reduce Git's reliance on global state and make its internal\ncomponents more modular so that Git can eventually be used as a\nlibrary.\n\nGit has grown over many years, and some parts of its implementation\nrely on global variables and shared state. This can make it difficult\nto isolate repository-specific behavior and reuse individual\ncomponents independently.\n\nThe ongoing work involves moving suitable state into structures with\nclearer ownership, particularly repository-specific structures.\n\nI've learned that this isn't simply a matter of replacing global\nvariables with structure members. Before making such a change, it's\nimportant to understand:\n\nWho owns the value.\n\nWhether it belongs to a particular repository.\n\nWhere it is initialized and accessed.\n\nWhich other parts of Git depend on it.\n\nHow its lifetime and cleanup are managed.\n\nWhether existing behavior will remain unchanged.\n\nMy work on repository configuration initialization and my\ninvestigation of existing migrations have helped me appreciate these\nchallenges.\n\nI'd like to build on that experience by taking on more of this work\nand learning how to identify changes that genuinely improve Git's\narchitecture.\n\n5. Proposed Technical Work\n==================================\n\nDuring the internship, I would like to continue investigating suitable\nareas where global state can be reduced safely.\n\nI don't want to move variables simply because they are global. I'd\nfirst like to understand what each value does, which parts of Git\ndepend on it, and whether moving it would make the code easier to\nmaintain.\n\n5.1 Follow through on repository configuration initialization\n\nMy first priority would be to address the feedback on PR #2298.\n\nIn particular, I would investigate Junio's suggestion to use a C99\ncompound literal:\n\n*cfg = (struct repo_config_values) {\n    /* non-zero defaults */\n};\n\nI would compare this with the existing implementation, make sure all\nfields receive the intended values, and check that the existing\ndefaults and behavior are preserved.\n\nI would then work through the review comments and submit any necessary\nrevisions.\n\n5.2 Investigate other opportunities to reduce global state\n\nAfter that, I'd like to identify other suitable candidates for migration.\n\nFor each one, I would:\n\nFind where the variable is declared and used.\n\nTrace where its value is initialized and modified.\n\nIdentify which parts of Git depend on it.\n\nDetermine whether it belongs in a repository-specific structure or\nanother appropriate owner.\n\nStudy similar migrations that have already been completed.\n\nDiscuss the proposed approach with my mentors before implementing it.\n\nI would focus on changes that offer a real improvement without making\nthe code unnecessarily complicated.\n\n5.3 Pay attention to testing\n\nTesting would be part of each change, not something I leave until the end.\n\nI'd start by understanding the existing test coverage, run the\nrelevant tests, and add focused regression tests where necessary.\n\nI'd particularly want to check that moving state does not introduce\nunexpected behavior between repositories or create problems with\ninitialization and cleanup.\n\n5.4 Coordinate with related refactoring work\n\nI also want to keep learning about the other changes happening around\nGit's architecture, especially the object database work.\n\nMy investigation of fast-import showed me that different parts of the\nrefactoring can be closely connected. Before working on an area that\noverlaps with another contributor's work, I'd check the relevant\ndiscussions and coordinate with them.\n\nIf an idea doesn't fit the direction of the project, I'd rather\nunderstand why and look for a more useful task.\n\n6. How I Plan to Approach the Work\n==================================\nI want to work in small steps and make sure I understand each change\nbefore submitting it.\n\nFirst, understand the existing code.\n\nI'll read the relevant source files, trace references, look at\nexisting tests, and review previous changes. I want to know why\nsomething works the way it does before deciding how it should change.\n\nDiscuss the approach.\n\nIf I'm unsure about ownership, initialization, or the wider impact of\na change, I'll explain what I've found and ask for feedback before\ngoing too far with the implementation.\n\nKeep changes focused.\n\nI'll avoid unrelated modifications and try to make each patch address\none clear problem.\n\nBuild and test.\n\nI'll build Git, run the relevant test suites, check the diff, and add\nregression tests where needed.\n\nLearn from review.\n\nI'll submit patches through the mailing list, respond to comments, and\nmake revisions based on feedback.\n\nMy experience with PR #2298 has shown me that review can improve not\nonly the code but also how I explain the reason behind a change. I\nwant to keep developing that skill throughout the internship.\n\n7. Risks and Alternative Approaches\n==================================\n\nOne challenge I expect is determining where a particular piece of\nstate should belong.\n\nA variable might look repository-specific at first, but other parts of\nGit may use it before a repository is initialized or in situations\ninvolving multiple repositories.\n\nMoving it without understanding those dependencies could cause regressions.\n\nInitialization and cleanup are also important. A migration needs to\npreserve the correct defaults and make sure resources are managed\nproperly.\n\nAnother thing I've learned is that removing a global variable doesn't\nautomatically make the code better. Sometimes the existing approach\nmay be appropriate, or a broader architectural change may be needed.\n\nI'd handle these situations by tracing dependencies, studying existing\nimplementations, discussing my ideas with my mentors, and making\nchanges gradually.\n\nIf a proposed change doesn't provide a clear benefit, I'd be willing\nto reconsider it and investigate another area.\n\n8. Proposed 13-Week Internship Timeline\n==================================\n\nThis is an initial plan. I'd be happy to adjust it with my mentors\nbased on the project's priorities and how the work progresses.\n\nPeriod\n\nProposed work\n\nWeeks 1–2\n\nReview the current refactoring work, revisit repository configuration\nchanges, and agree on the first task with my mentors.\n\nWeeks 3–4\n\nAddress the review feedback on PR #2298 and investigate another\nsuitable candidate for migration.\n\nWeeks 5–6\n\nTrace the selected candidate's dependencies, ownership,\ninitialization, and cleanup requirements. Discuss the design and begin\nimplementation.\n\nWeeks 7–8\n\nComplete the first agreed change, run the relevant tests, add\nregression coverage where necessary, and submit the patch for review.\n\nWeeks 9–10\n\nWork through review feedback and investigate another suitable area\nwhile the first patch is being reviewed.\n\nWeeks 11–12\n\nContinue with another agreed improvement where appropriate, run tests,\nand address outstanding review comments.\n\nWeek 13\n\nComplete final revisions, document the work and any remaining issues,\nand prepare the internship report.\n\nI understand that upstream review can take time and that some changes\nmay need several revisions. I'll remain flexible and use time between\nreviews to investigate other areas or improve my understanding of the\ncodebase.\n\nMy main goal is to complete at least one meaningful improvement that\nis well tested and submitted for upstream review. If there is time for\nadditional work, I'll be happy to take that on as well.\n\n9. Communication Plan\n==================================\n\nOne thing I've come to appreciate about Git is how much the community\nvalues technical discussion and review.\n\nDuring the internship, I'll continue using the Git mailing list to\ndiscuss ideas, submit patches, and respond to reviews. I'll also\nmaintain regular communication with my mentors.\n\nI'd like to provide weekly progress updates covering:\n\nWhat I've worked on.\n\nWhat I've completed.\n\nWhich patches are waiting for review.\n\nAny problems or questions I've encountered.\n\nWhat I plan to work on next.\n\nWhen I need help, I'll explain what I've already investigated and ask\nspecific questions so that discussions can be more productive.\n\nI'll also continue reading other contributors' patches and testing\nchanges where I can be useful.\n\nI've learned that contributing to open source involves more than\nwriting code. Listening, asking questions, explaining decisions, and\nlearning from other people's work are all part of being a good\ncontributor.\n\n10. Availability\n======================\n\nI expect to be available throughout the official internship period.\n\nWeekly availability: [Insert your confirmed number of hours per week.]\n\nIf anything changes, I'll communicate it early and work with my\nmentors to adjust my plans.\n\n11. What I Hope to Achieve\n===========================\n\nBy the end of the internship, I hope to have made useful contributions\nto Git's effort to reduce global state.\n\nI'd like to:\n\nFollow through on the review and revisions of my repository configuration patch.\n\nContribute at least one additional improvement agreed upon with my mentors.\n\nAdd or improve tests where necessary to protect existing behavior.\n\nUnderstand repository-specific state, ownership, initialization, and\ncleanup more deeply.\n\nBecome more confident navigating Git's C codebase and investigating\ndependencies between components.\n\nImprove how I prepare patches, explain technical decisions, and\nrespond to review feedback.\n\nI know that the number of variables moved or patches submitted isn't\nthe most important measure of success. What matters is whether the\nchanges are useful, well understood, and consistent with the project's\ndirection.\n\nI'd rather make a small change that solves a real problem than a\nlarger change that introduces unnecessary complexity.\n\n12. Beyond Outreachy\n==========================\n\nI don't want my involvement with Git to end when Outreachy does.\n\nWorking on the project has shown me how much there is to learn from\ncontributing to a mature open-source codebase. I've also come to\nappreciate how much contributors can learn from thoughtful reviews and\ntechnical discussions.\n\nI'd like to keep following Git's development, contribute to suitable\nissues, submit patches, and gradually take on more challenging work as\nI gain experience.\n\nAs I become more confident, I'd also like to help other newcomers who\nmay find the contribution process unfamiliar, just as members of the\nGit community have helped me.\n\nFor me, this experience is more than an opportunity to complete an\ninternship. It's a chance to become a better developer and build a\nlasting place in the open-source community.\n\n13. References\n======================\n\nMy Git work\n\nPR #2298 — repo: zero-initialize configuration values\nhttps://github.com/gitgitgadget/git/pull/2298\n\nPR #2298 mailing-list discussion\nhttps://lore.kernel.org/git/pull.2298.git.1793966368860.gitgitgadget@gmail.com/\n\nPack-size configuration patch series — PR #2271\nhttps://github.com/gitgitgadget/git/pull/2271\n\nCI change — ci: use sudo when replacing dirname symlink\nCommit: 2ea93d3163\n\nExploratory test work — psuh example command\nCommit: 1ce5f1055f\n\nRelevant Git resources\n\nGit source code:\nhttps://github.com/git/git\n\nGit General Application Information:\nhttps://git.github.io/General-Application-Information/\n\nGit mailing-list discussions:\nhttps://lore.kernel.org/git/\n\nRelevant source files:\n\nenvironment.c\n\nenvironment.h\n\nRepository configuration structures\n\nbuiltin/fast-import.c\n\nObject database implementation files\n\nI would appreciate feedback from the Git community on the proposed\ndirection, possible areas to investigate, and where I could make the\nmost useful contribution during the internship.\n\nThank you for the guidance and feedback I've received throughout the\ncontribution period.\n\nBest regards,\nJoy Gundu\n\n"}]}