How I commit to WordPress

This past week at WordCamp US in Portland, a group of core committers gathered one day after lunch to discuss our individual workflows for committing to core.

As you might expect, everybody works and organizes things a bit differently and so we were encouraged to share our individual workflows.

A few have already shared:

And now here’s mine.

Development environment

As a recently-emerged-from-emeritus-status core committer, my local development environment is, on the whole, vastly different today than it was “back in the day” when I was a lot more active.

So for its latest iteration, I’ve opted for a subversion checkout of the core development package and I’ve leveraged the built-in docker environment that ships with it. Easy peasy.

git and svn and git-svn, oh my!

I know some committers like to use git for development alongside subversion or even git-svn for the actual commits, but I’m comfortable with doing everything in subversion so that’s all I’ve been using lately.

I did a subversion check out and started up the docker development environment inside it.

Applying patches

I was delighted to discover that grunt patch is still available from the old days in the core development package, so that’s what I am still using to apply patches from Trac or GitHub:

grunt patch:123456
grunt patch:https://github.com/WordPress/wordpress-develop/pull/6880

If for some reason I have a local patch file, I’ll simply apply it with:

patch -p0 < whatever.diff

Reviewing changes

To see changed files I prefer to quickly check in the terminal with svn stat -q

To review changes, I’ve had an alias called changes set up for ages that I use quite a lot to generate a local diff and open it. Nothing terribly complicated:

alias changes="svn diff > changes.diff; open changes.diff;

Committing

As I mentioned, I’ve opted to stick with vanilla subversion for this go-round.

While I do sometimes find myself missing git’s “patch mode” as an easy way to review what’s being changed in the moment right before commit, using my changes alias just before commit has about the same utility.

I’ve got TextMate set up as my terminal editor, and thus calling svn commit will launch a TextMate window for me to write the commit message:

Component: Commit message.

Props ...
See/Fixes #123456

That’s about all there is to it.

Download Shortcode v1.1: Now with subdirectory install support

Just released v1.1 of Download Shortcode, with added support for subdirectory WordPress installs.

Thanks to a report from Stuart Sequeira, I realized I’d forgotten to re-add subdirectory support when I rewrote it in v1.0. I also regenerated the pot file to make sure the strings are included.

In short: Download Shortcode provides a shortcode for wrapping media links that forces them to download. It’s great for providing easily-downloadable MP3, jpg, mp4 or other media file types.

Want to contribute?

Download Shortcode is in active development on GitHub too, so if you’d like to contribute, pull requests are welcome.

Related:

New local-to-live deployment plugin falls a bit short

A new local-to-live deployment plugin called WP Live Server Deploy was brought to my attention last week by a post over at WP Force.

The plugin boasts an automated set of features to handle the menial tasks of MySQL dumps + find & replace, plus handling your file transfers. Out of the box it seemed pretty promising. I’d say the biggest disappointment out of the box is a complete lack of SFTP/SSH support for the transfer. You can only do so much over FTP alone and the plugin failed miserably to handle the MySQL part of the equation.

Along that vein, there’s a so-called “Manual” option for handling the MySQL dumps. This would be fine, except that it doesn’t work — it nets an empty SQL file. I’d say @sagetarian has some work to do yet, but I’m looking forward to seeing another iteration. You can download the plugin via the WP.org repo and/or follow development on Github.