I applied my first patch! And nothing blew up!

Posted on Thu, 10/15/2015 - 21:52

This might not be very exciting to most, but I just applied my very first patch!

I was getting an error message in a Drupal installation that was being triggered by the site's theme. After a quick Google search, I came upon an issue posted to the theme's issue queue on Drupal.org. I saw that the issue had been posted (and resolved!) rather recently, with a very simple patch file created to solve the issue.

I never applied a patch to anything before, so this was a great candidate to get my feet wet with. Thankfully, Drupal.org also has some great documentation available on how to apply a patch as well.

Long story short, I downloaded the .patch file, opened up my Terminal, navigated to the root folder of the Drupal theme in question, and ran these magic words (using the correct file path and name, of course…)

patch -p1 < path/file.patch

And nothing happened, save for a simple "patching file…" message on the command line. And it was a truly sweet nothing. Nothing blew up. It just worked. Quite the underwhelming story. But a triumphant one for me, nonetheless.

This post may make me sound like a total noob. I know that, in reality, applying a patch to some code is really simple. But, like many things in IT and the digital world at large, the fear of the unknown can often by your biggest obstacle. I may have only patched one file this time. But now I can go forward with a little bit more confidence, knowing that I don't have to run for the hills the next time I hear somebody mention the words 'You know, there's a patch for that…'