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.

How was it for you? Let me know on BlueSky or Mastodon

(Please) Link to this page

Thanks for reading. I'd really appreciate it if you'd link to this page if you mention it in your newsletter or on your blog.

Related Posts

04 Nov 2016

Automating WordPress Development with Gulp, Bash, and PHP

When I wrote about the things I had learned from releasing 20 WordPress themes, I mentioned that I had automated as much as I could. One of the things I automated was the build and deployment process for my themes...
01 Apr 2015

The State of WordPress Themes #wcldn

I recently spoke on a panel at WordCamp London 2015e. Lance – who used to be the Theme Team lead at WordPress.com – asked me if I wanted to speak on a panel with him at WordCamp London 2015. I’ve...
08 Aug 2013

The Death of WordPress Theme Frameworks

WordPress theme frameworks are on their way out. They’re dying a slow death. At least that’s what I think.Nathan Rice recently wrote an article with his thoughts about theme frameworks – in defense of them – however he clearly has...
14 Oct 2015

My Experience Submitting a Free theme to WordPress.org

I recently submitted my first free theme to WordPress.org.Kent is a theme I made for wordpress.com. It’s been code reviewed by the team there and is in use on a few hundred sites. I was considering selling it on Creative...
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...