Note to Self: Using SVN Diff

At WordCamp London last week I made my first contribution to WordPress – a bug fix for the Twenty Fourteen theme that’s being released with WordPress 3.8. Part of doing this involved created a patch.

Now I know this is pretty basic stuff – but having not contributed to other projects before it’s not something I had experience with. So I set about finding out how to do it. Since I use Netbeans my first attempt was to export the patch there – however Netbeans broke my code formatting (swapping tabs for spaces and, bizarrely, adding a space at the end of each line), and so this meant my code didn’t match the WordPress coding standards.

As such I had to break out the terminal and use that. The command to create the patch was quite straight forward, however there were a couple of things I wanted to do differently. Specifically I wanted to create a patch for just two files and not the whole directory. I also had to set the project root as the WordPress root.

In the end the command I ran was the following:

svn diff wp-content/themes/twentyfourteen/style.css wp-content/themes/twentyfourteen/rtl.css > ~/Desktop/TwentyFourteenMenu.patch

One thing to note – I had recently upgraded to Mavericks, which included updating Xcode. The first time I executed the svn diff command I got the following error.

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

The fix was easy – all I had to do was run Xcode and accept the latest Terms and Conditions.

Let me know what you think on Mastodon, or BlueSky (or Twitter X if you must).

WordPress News

The latest WordPress updates from the WPBriefs Podcast.

Related Posts

31 May 2007

WordPress tips and tricks – functions.php

Functions.php is a little known wordpress template file. Not many themes take advantage of it but , used properly, it can be incredibly powerful. The file can be used as a way to add your own functions to wordpress themes...
27 May 2013

WordPress: 10 Years Young, What Does The Future Hold?

WordPress is now 10 years old. I started using wordpress 9 years ago – which means I joined the WordPress community early on. The reason I chose WordPress is simply because of the fabled 5 minute install process – I...
26 Jun 2014

New TimThumb Exploit Found

It’s been reported today that there is a new TimThumb exploit found. Unfortunately nobody told me about this before the exploit was announced – in fact I found out about the bug through wptavern.com so I haven’t been able to...