| **License** | [THE MIT LICENSE](https://github.com/jesseduffield/lazygit/blob/master/LICENSE)|
## Context
I chose to write this report about my first contribution to open source, which began on June 30, 2024.
I'm a geek who uses Linux as my daily driver, and I spend most of my time in the terminal. I write code in my terminal with Helix, and most of my programming tools are TUI or CLI-based. A crucial factor in my project choice was my love for "ricing" and customizing my development environment to simplify my workflow. This starts with creating aliases and ends with configuring a tiling window manager.
## Choice of Project
When I discovered [lazygit](https://github.com/jesseduffield/lazygit), I immediately adopted it into my workflow. **Lazygit** is a *simple terminal UI for Git commands*, boasting 50.8k stars on GitHub, 279 contributors, and written entirely in Go.
At the time, I had also recently started learning Go, which I found to be an excellent language. This influenced my decision, as contributing to a large Go codebase would provide a great learning opportunity.
I soon identified a feature that was missing in Lazygit. After some research, I found an abandoned PR that implemented the feature, but it was messy, incomplete, and unmerged. I decided to merge it into my personal fork for my own use. Eventually, I wanted this feature to be part of the official repository, so I rewrote and completed the PR.
The feature in question allows users to perform a squash merge via the TUI. A `git merge --squash` consolidates all changes from a branch into the working tree without preserving the commits or creating a new commit.
## Contact with the Community
My first interaction with the community was commenting on the [abandoned PR](https://github.com/jesseduffield/lazygit/pull/3130) to ask if I could rewrite and complete it. I received a response from [Stefan Haller](https://github.com/stefanhaller), one of the top contributors of the project, though not the main maintainer but his right arm.
As it turns out, I was right to do that as it reignited a discussion about an unresolved design decision from the original PR: should the feature create a new commit after a squash merge? The original PR didn’t address this, and my intent was to keep it that way. However, the discussion led to the introduction of an option to choose between auto-committing after a squash or not. Afterward, I started my own [PR](https://github.com/jesseduffield/lazygit/pull/3566).
Fortunately, the project had a contribution guide, which made it easy to set up the project locally.
## Contribution Process
After reading and understand CONTRIBUTION.md, I coded for a few days in my free time. Then, I thought I had completed the first version of my contribution (except for unit tests). The project is large, with many components, and while Go’s structure and the project’s organization made it relatively easy to understand, it took time. My biggest surprise came after the first review comments: much like learning a new language or framework, it's only after you've written some code that you realize there are better, simpler, and more efficient ways to do things.
Over the next few PR comments, I would declare my work "done", only for a maintainer to kindly explain what I had done wrong or suggest small improvements for better results, sometimes, they even apologized for pointing out improvements so late in the process.
The frustrating part (although, in open source, it's always a joy) came when I thought my work was complete. After waiting for three weeks, I restarted the discussion in hopes the maintainers would notice my PR and merge it. The main issue that arose was regarding wording and how I handled translations. After four rounds of "*one more thing*" regarding the wording, my work was finally ready—but the PR was still not merged.
The [maintainer and creator of the project](https://github.com/jesseduffield), and [Stefan Haller](https://github.com/stefanhaller) had a discussion and decided to make a design change, which made a lot of sense. The core of my PR remained intact, but the feature’s placement changed significantly. The *squash* option was merged into the existing *merge* option.
Finally, the PR was merged, and I was mentioned in the changelog for the [next release](https://github.com/jesseduffield/lazygit/releases/tag/v0.43.0) which happens about once a month.
## Conclusion
It was enlightening to learn how an open-source community operates and what it’s like to contribute to a large, existing codebase. It felt rewarding to make a meaningful change that not only benefits me but also others. People seemed pleased with my contribution in the end.
Beyond code complexity, contributing to a large project isn't easy because you must learn how other people work. Since it's often not their full-time job, responses can be slow, and feedback may be incomplete, leading to additional work, reversions, and adjustments.
Overall, it was a positive experience.
---
**Assistance:**
-**ChatGPT** : I used it to help rewrite this report by correcting grammar mistakes and improving sentence structure.
-**Report** : The report ["Report-Arthur-Meirlaen.md"](https://forge.uclouvain.be/ldricot/lingi2401/-/blob/master/projects/projects_2023-24/Report-Arthur-Meirlaen.md) has been used for the array at the beginning of this report.