{"thread":{"id":"63254","subject":"[GSoC] [RFC] Project Proposal: Refactoring in order to reduce Git's global state","startedAt":"2025-04-04T16:13:53Z","lastAt":"2025-04-04T16:13:53Z","messageCount":1,"participants":["wang-anthony03"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"515680","messageId":"20250404161343.12635-1-anthonywang03@icloud.com","threadId":"63254","inReplyTo":null,"subject":"[GSoC] [RFC] Project Proposal: Refactoring in order to reduce Git's global state","fromName":"wang-anthony03","fromEmail":"anthonywang513@gmail.com","sentAt":"2025-04-04T16:13:43Z","receivedAt":"2025-04-04T16:13:53Z","isPatch":false,"sender":{"key":"anthonywang513@gmail.com","avatar":"https://avatars.githubusercontent.com/u/71832477?v=4"},"body":"From: Anthony Wang <anthonywang513@gmail.com>\n\nHi all,\n\nI'm interested in working with Git over the summer to \"Refactor in Order \nto Reduce Git's Global State.\" My main motivation for choosing this idea \nis that improving Git's environment handling will enhance long-term \nmaintainability and scalability, and allow for multiple-repository \ninteractions. \n\nThis is the first version of my proposal. I would love to \nreceive feedback on the content or structure, especially on the points \npertaining to the actual implementation of the project and planned work. \nI will also discuss my past experience, and speak on why I believe I \nwill be able to effectively contribute in a sustainable way to this \nlarge undertaking.\nThanks!\n\nNote - I am still waiting for feedback on my Microproject, and would \nlove to discuss how my patch contents or formatting could be improved!\nPatch: https://public-inbox.org/git/20250402081545.94784-1-anthonywang03@icloud.com/\n\n-------------------------------------\n\n# Refactoring in Order to Reduce Git’s Global State\n\n### Personal Info\nName: Anthony Wang\nTimezone: Eastern Time (ET)/UTC -5\nGitHub: https://github.com/wang-anthony03\nLinkedIn: https://www.linkedin.com/in/anthonywang03/\n\n## About Me\n\nMy name is Anthony Wang, and I am a 3rd year Computer Science student \nat the University of Virginia. I have experience in software engineering \nand development, particularly in C, Python, and shell scripting. This is \nmy first time working with open source software, and I am incredibly \nexcited to contribute to Git, as I have always wanted to work on \ndeveloping the tools that I use everyday.\n\nMy background includes building scalable automation tools and \ncontributing to infrastructure projects at Verizon. I was able to work \nwith large codebases, and I learned the importance of clean, \nwell-documented code, as well as the challenges of tech-debt leading to \ndifficulties in maintaining code.\n\n## Previous Experience\n\n- Experience using Git extensively in academic and personal projects.\n- Experience working with C as the main language for multiple Computer \nSystems courses.\n- Developed a text editor in C: https://github.com/wang-anthony03/Quill\n\n## Project Proposal\n\n### Objective\nThis project aims to modernize Git's environment handling by refactoring \nthe environment.c code to reduce the reliance on global state. The goal \nis to move environment variables and configuration settings from the \nglobal scope into appropriate local contexts, primarily within struct \nrepository and struct repository_settings. This architectural \nimprovement will:\n\n- Enhance code maintainability by making dependencies explicit.\n- Reduce the risk of unintended side effects from global state \nmodifications.\n- Improve Git's ability to handle multiple repositories within the same \nprocess.\n\n### Expected Project Size: 90 Hours\n\n## Key Tasks\n\n1. Identifying Global State Variables\n- Analyze environment.c and related files to locate global variables.\n- Categorize these variables based on their use cases and potential \nmigration targets.\n- Write Documentation listing all desired variable migration, allowing \nfor community contribution.\n- Discuss prioritization with the community and designate priority of \ntasks.\n\n2. Refactoring Process\n- Move identified global variables into struct repository or struct \nrepository_settings.\n- Ensure proper initialization and access mechanisms to maintain \ncurrent behavior.\n- Updating Affected Code Paths\n- Modify functions and modules that rely on the old global state.\n- Ensure all relevant operations correctly pass repository-specific \ncontext.\n\n3. Testing and Validation\n- Run Git's extensive test suite to verify functionality remains intact.\n- Update or create new tests as needed to cover refactored components.\n\n4. Documentation\n— Document changes in Git's developer notes.\n— Provide clear explanations for new structures and access patterns.\n\n5. Challenges and Considerations\n- Ensuring backward compatibility and avoiding regressions.\n- Handling dependencies between different parts of the codebase that \nrely on global state.\n- Keeping performance overhead minimal while introducing structured \nstate management.\n\n## Schedule\n1. **Now -- May 5th**: Exploration of codebase\n- Research and familiarize with environment.c and related code. \n- Identify global variables to refactor. \n- Engage with the Git community for feedback.\n\n2. **May 6th -- June 1st**: Community bonding\n- Get in touch with the mentors;\n- Present to the community a first list of variable migrations;\n- Receive feedback from the community and modify project plans;\n- Present potential changes to ensure they align with community goals;\n\n3. **June 2nd -- July 7th**: First coding period\n- Eliminate dependencies on “the_repository” following priority;\n- Identify possible patterns in refactoring and document for future \ncontributors;\n\n4. **July 8th -- August 10th**: Second coding period\n- Move other global variables into local repository contexts;\n- Identify possible patterns in refactoring and document for future \ncontributors;\n\n5. **August 11 -- August 25th**: Documentation period\n- Finalize and refine changes;\n- Document changes, the process, and outline future work regarding \nreducing the global namespace;\n\n## Availability\nI will be working over the summer, but regularly code and study outside \nof work/school hours. I will be dedicating all of this extra time \ntowards this project, but I acknowledge that I will not be able to spend \nan incredibly large amount of time, thus I have chosen my expected \nproject size to be 90 hours. I will be fully available outside of \nworking hours to this task, and will set up a compatible schedule \nwith my mentor(s) in order to ensure that an effective line of \ncommunication is established.\n\nI appreciate your time in reviewing this proposal and look forward to your feedback!\nThank you, \n\nAnthony Wang\n(He/him/his)\n\n\n\n"}]}