Smashing Squashing Git Commits for Open Source Contributions
Recently, I made my first contribution to an open source project, homebrew-cask, “a CLI workflow for the administration of Mac applications distributed as binaries”. Basically, it’s a way to install applications through the command line, rather than visiting a website, clicking to save a disk image, opening said disk image, and clicking and dragging the application icon to the application folder. TIme-consuming and full of opportunities for distraction.
…the three great virtues of a programmer: laziness, impatience, and hubris. – Larry Wall
As I was comparing the available applications [or ‘casks’], I noticed that WireOver was missing. Now, it’s not that I use it frequently, but it’s a handy utility that’s just getting started. I checked out the contribution page – bonus: it’s Ruby – and saw how simple it was to add a cask. So, I put one together for WireOver and submitted my pull request. Because I failed to RTFM in full detail, I had a few changes to make for a few lines of code. Which, of course, meant a few commits. The cask audit passed and I thought all was good.
And it sort of was. A request came in this morning to squash my commits. I had previously gone through the link provided in the docs for squashing commits, but ran into roadblocks; specifically, I wasn’t getting my commit messages to show up, only the word “noop” in the text file that pops up.
I found another article, this time geared toward open source contributors, which helped more, but didn’t quite get me there. Here’s what I ended up doing after I had already pushing my feature branch to my fork of the project.