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.

Plugin repo bookmarklet

Sometimes when I’m checking out plugins in the WordPress.org repository, I like to view the source before I download. So partly out of boredom and partly out of laziness, I decided to create a bookmarklet that jumps you from a WordPress.org-hosted plugin page to its subversion repository.

The bookmarklet: Plugin Repo

To use the bookmarklet:

  1. Drag the above ‘Plugin Repo’ link to your bookmarks bar
  2. Visit any plugin page (or plugin’s sub-page) in the WordPress.org plugin repository
  3. Click the bookmarklet and you will be sent to that plugin’s SVN repo trunk url
  4. Boom.

Fun?! with Subversion and WordPress

OK, so I’m a bit of a Cowboy Coder and after a session with Mark Jaquith the other week at WordCamp San Francisco, I’ve been mildly shamed into learning what I need to start using version control.

At home I have a pretty high-powered gaming PC and when I’m on the go I’m using a MacBook Pro. So the first thing I did using a (somewhat old but relevant) guide by Westi to setup TortoiseSVN on my PC and started hooking up my WordPress Trunk build repo using SVN. Prior to now, I’ve always sort of done it the hard way, e.g. a whole lot of downloading and ftp-ing a couple of times a week.

First impression: SVN is kind of complicated at first, but once you sort of get the hang of it, it’s a heckuva lot less work overall. After I got the hang of doing checkouts, updates and commits with my local repo, I got a little more ambitious and set out to get SVN setup on my VPS.

After an install, uninstall and re-install, I finally got all of the ra_* (See: Repository Access) modules in place that would allow me to checkout code from http & https URLs. Thanks to a very helpful guide by Otto, I managed to setup svn:externals and perform a couple of checkouts and updates directly from the WordPress trunk and my VPS. Pretty neat.

NoteToSelf: Next time: Read about it, read about it, try, fail, try, fail, fail, WIN.