August 11th 2008
I use git submodules to track plugins that I have under active development. This way, I can make changes to the main repository as well as the plugins with minimum fuss. There’s a great tutorial on working with submodules, which includes a couple of gotchas that may explain why submodules have got such a bad rep from some quarters.
Gotcha No. 1 - Always commit changes in your submodules before commiting your main repository
If you make any changes to a submodule, be sure to commit and publish these changes before you commit anything in the main repository, otherwise you and others will have issues trying to clone the repository.
Gotcha No 2 - Check you’re on a branch before making changes
If you are cloning a repo with a submodule and run git submodule init/update, be aware that the submodule has been checked out at a specific commit as apposed to the head of a branch meaning you have to checkout a branch before you make any changes.
Tags: git, Plugins, Rails
Posted in Plugins, Rails | 1 Comment »
May 31st 2008
This week, I made my first contribution to core which made installing plugins from git repositories over ssh work. It was a pretty small, mangy little patch - nothing more than fixing a typo in the end - but it felt good giving something back to a framework that has given me so much.
Now that I’m newly freelance, I’m hoping to be able to spend more time giving back to the Rails ecosystem, and the first port of call might have to be the plugin management system. I know plugins are becoming decidedly unfashionable with a lot of smart people saying they you should be using gems instead. And with the recent additions to rails this makes even more sense and you really should be removing those plugins from your apps in favour of loading them as gem dependencies. But in some scenarios, a plugin is all that will do.
In my case, I make use of the engines plugin (another unfashionable and often misunderstood bit of rails goodness) to share common application structure between a few apps, and here the whole plugin-as-gem thing just doesn’t fit.
Having been underwhelmed with the Piston equivalents for git, I’ve found myself using ./script/plugin install again, and although this now works with git repositories, ./script/plugin update doesn’t. Can it be that hard? Time to find out…
Posted in Plugins, Rails | No Comments »