Josh SusserJosh Susser
svn to git protips
edit Posted by Josh Susser on Wednesday September 30, 2009 at 11:20AM

When you're moving a codebase from subversion to git, here are a few things that make the move go a bit more smoothly.

In the svn project, you can discover some things you'll need to adjust in git after the import.

Show all files being ignored

svn propget -R svn:ignore .

Add these files to the .gitignore file at your project root, or in appropriate subdirectories. I prefer keeping it all in one place at the top level.

Show all externals

svn propget -R svn:externals .

You'll either have to switch to using a submodule in git, or just pull the files into your project if that's not possible for some reason.

Find all empty directories

find . -type d -empty
touch /path/to/empty/dir/.gitkeep

Since git doesn't keep empty directories, you can add a .gitkeep file to empty directories that you don't want to go away. Some people add a .gitignore file to keep the directory around, but that sounds totally backwards to me. You want to keep it, not ignore it.

By the way, if you are already ignoring dir/*, that will ignore the .gitkeep file as well. Make sure it isn't missed by adding !.gitkeep to the end of your .gitignore file.

Find all authors

If you want to properly attribute commits, you'll need to set up an authors file. But if you miss any authors, the clone will stop and complain. You can discover all the svn users that you need to put in the authors file with this command:

svn log | grep -E 'r[0-9]+ ' | cut -d\  -f3 | sort | uniq

init + fetch > clone

If git svn clone doesn't complete, try doing the init/fetch as separate operations. The clone subcommand is pretty much just doing an init followed by a fetch, but I've found that if the clone fails, doing the commands separately can have better success.

Davis W. FrankDavis W. Frank
Standup 9/29/2009: "Half The Battle" edition
edit Posted by Davis W. Frank on Tuesday September 29, 2009 at 10:19AM

Ask for Help

"Has anyone run into issues moving their SVN project to git, where externals move to submodules, and multiple team members' check-ins keep screwing up merges & pulls?"

Why, yes. Many folks have. And Pivot Sam has written up a nice how-to over here.

Interesting Things

  • Ruby eql? vs. == vs. equal in Ruby

Plenty of discussion of this in other places, so I won't recap.

However, note that Numeric classes cast when calling ==, but not when calling #eql. Which means (he says, pretending to fire up irb):

>> 1.0 == 1
=> true
>> 1.0.eql?(1)
=> false

It looks like the gems are still not building yet, which meant that you'll need a gem server in the meantime. Say, one at Rubyforge, which is where you should be releasing your gems anyway.

  • Public Service Announcement: your named_scope's get evaluated when the class is loaded, not when an instance is created.

So, for example, if you're building a named_scope for "articles posted in the future" and want to use Time.now, do it in a lambda. Now you know.

Lara OwenLara Owen
Need a Job? Come Work with Pivotal Clients!
edit Posted by Lara Owen on Monday September 28, 2009 at 02:24PM

At Pivotal Labs, one of the services we provide is bootstrapping startups, including helping them interview and hire. We currently have clients looking for skilled engineers to build their development teams. This is an excellent opportunity to learn Extreme Programming by working side-by-side with Pivotal's talented and experienced developers while at the same time getting in on the ground floor of a small and dynamic product team.

Pivotal Labs and our clients place a strong emphasis on Agile development and its many aspects: Pair Programming, Test-Driven Development, rapid iterations, and frequent refactoring. General technical requirements include serious web development experience, and a significant subset of Ruby, Rails, CSS, JavaScript, or MySQL.

Here are short descriptions of The Bold Italic and Honk, San Francisco-based clients of Pivotal Labs currently looking for developers. The full job postings follow.

The Bold Italic is an online collection of stories uncovered by the city's most passionate citizens. We've spent the last 6 months in San Francisco discovering what people want to know about their city. We found that people are looking for an insider's backstory - the story behind the story. We see a great opportunity to connect citizens to merchants in a way that celebrates and supports the city's culture. A 100% Ruby on Rails web project developed exclusively by Pivotal Labs over the last 3 months, The Bold Italic also stems from a collaborative effort between Gannett's Design and Innovation group and IDEO. We are looking for a smart, creative, analytical, visionary web developer to join our San Francisco based team on contract for the next 3 months.

Honk.com is a new online automotive website that will make car shopping fun and social. We will enable consumers to experience a new way to explore new cars. We have partnered with a top social website to deliver this new way of car shopping and are funded by one of the largest media companies in the world. Our small team is made up of an experienced group of humble, efficient, and hyper-passionate individuals who are veterans of the automotive industry and social media space. We are proud of our ego-less culture, one that promotes team thinking, not individual accolades. If you're interested in helping prove that social media and car buying go hand in hand, social networks serve a bigger purpose than keeping up with one's day, and a small team can outdo the work of an army - then we may have a seat waiting for you.

If you are interested or for more information please contact the company directly. This is an exclusive service provided to our clients, no external companies or recruiters please.

Full job postings follow.

Davis W. FrankDavis W. Frank
Standup 9/28/2009: Another Slow-ish Monday
edit Posted by Davis W. Frank on Monday September 28, 2009 at 12:30PM

Interesting Things

Jeff DeanJeff Dean
Introducing ActiveModelListener: Easy to use global ActiveRecord event listeners
edit Posted by Jeff Dean on Sunday September 27, 2009 at 12:39PM

I'm currently working on a large app where certain things have to happen when records are created, updated and deleted, such as:

  • Publishing to an activity feed
  • Generating emails
  • Adding entries to a changelog
  • Generating tasks and reminders

Further, the requirements state that admin users should be able to configure which of these actions happen for which objects in the system, who they go to, what the text is etc...

At first this looks like a great place for ActiveRecord Observers. However, after working with Observers there are a few things I dislike - namely that you can't easily apply observers to all of your models, and you can't selectively turn them on and off in tests. To remedy that problem, I created ActiveModelListener.

ActiveModelListener is a simple, global ActiveRecord event listener framework, using a middleware-esque architecture that can easily be turned on and off.

Sam PiersonSam Pierson
Standup 9/24/2009: Hiring a Sysadmin, Rails Security Patches
edit Posted by Sam Pierson on Thursday September 24, 2009 at 01:40PM

Help

Interesting

  • Mouseophobics - Ctrl-Enter on the RubyMine Commit Changes dialog will commit without you having to grab your mouse.

  • Rails Security Patches - The Rails team recently came out with 2.3.4 featuring security patches to fix the recently discovered vulnerabilities. Apparently the plan was to also upgrade 2.2.2 to 2.2.3 with these patches, but they forgot to push the gems. They should be coming to a gem server near you soon.

Sam PiersonSam Pierson
Standup 9/23/2009: Multiple Rubygems Versions, Abstract AR Classes
edit Posted by Sam Pierson on Wednesday September 23, 2009 at 09:14AM

Help

How do you deal with an old, soon to be retired codebase that requires old versions of rubygems and rake, and a new codebase that requires new version of rubygems and rake, on the same machine?

Suggestions:

  1. Have two separate Ruby installations (each with its own gems).
  2. Don't. Use two machines. Optimize for developer resources rather than hardware, the former being much more expensive than the latter.

ActiveRecord Abstract Class doesn't work with validations?

AR allows you to set abstract_class = true. The makes the class uninstantiable, i.e. you can't create instance of the class, you have to create a subclass of it and create an instance of that.

However, if you create an abstract class that contains validations, then subclass it, the subclass produces errors when attempting to validate. This features does not seem well thought out.

Has anyone used Capistrano to deploy to a load balanced EC2 cluster?

Suggestions:

  • Follow the "deploy to localhost" path.
  • Use Cap for bootstrapping and Chef for configuration.

Steve ConoverSteve Conover
Remixr: Ruby wrapper for the Best Buy Remix API
edit Posted by Steve Conover on Wednesday September 23, 2009 at 08:30AM
sudo gem install remixr

We at Pivotal like that incantation. Thanks to the Squeegee crew for putting Remixr together.

# find stores within 50 miles of ZIP 76227 and products over three G's

stores = client.stores({:area => ['76227', 50]}).products({:salePrice => {'$gt' => 3000}}).fetch.stores

Beautiful.

Christian SepulvedaChristian Sepulveda
Tweed and Paid Palm Pre Apps
edit Posted by Christian Sepulveda on Tuesday September 22, 2009 at 03:36PM

In the past, we've been asked if we planned to charge for Tweed. Until recently, we hadn't made a decision. Tweed began as an application we developed to learn Palm webOS, and it grew into something we started to depend on, so we decided to release it to the App Catalog.

At this point, Tweed has a thriving user base and continues to grow in its maturity and capabilities. However, this does come with considerable costs to Pivotal Labs and we can't indefinitely subsidize the entire cost of development. So, we've decided to make Tweed a paid application in the App Catalog.

We are committed to continuing to develop and support Tweed. Charging for it will let us keep bringing you new features, like the ones in the 1.0 release.

Existing Tweed users can continue to use the current version, (0.9.16) and you can still grab a copy until the paid apps are available; it will not timebomb and we're happy for you to keep using it. However, it will be removed from the App Catalog when the paid version replaces it. Hopefully you'll find the new features compelling enough to upgrade. (Unfortunately it will install as a new application, so you will have to re-enter your accounts and you will lose existing timeline markers and bookmarks. Sorry, this is a consequence of the new App Catalog and we have no influence over this.)

For Canadian users, Tweed will continue to be free until Palm launches a commerce enabled App Catalog in Canada. (This will be true for new Palm Pre markets as well.)

Features

There will be a variety of new features available in the initial 1.0.0 release of the paid application.

  • true, direct photo upload (no more email)
    • TwitPic, TwitGoo, TweetPhoto, yFrog, Posterous
  • new notifications dashboards
  • full-screen view of user profile image (tap user picture on user profile scene)
  • preference for number of tweets on fetch
  • ability to change password
  • show number of tweets in user profile
  • direct messages can include photos

Tweed

Tweed

Roadmap

While we have lots planned for Tweed, some items of note include:

  • themes
  • landscape support
  • bit.ly / j.mp url shorteners
  • Flickr upload support
  • more...

Pricing

Tweed will normally cost $3.99. However, for the next few weeks, to help ease the transition, we will offer Tweed for the discounted price of $1.99.

We thank you all of using Tweed. While we know some of you will be disappointed that Tweed will be a paid-only application, we hope you will enjoy the new Tweed.

Sam PiersonSam Pierson
Standup 9/21/2009: Cabulous
edit Posted by Sam Pierson on Monday September 21, 2009 at 01:36PM

Interesting

  • Cabulous is going into beta: UpStart Mobile, makers of Find my Friend are releasing the beta of Cabulous: "A mobile application that gives cab drivers and their passengers the peace of mind of seeing exactly where each other are from hail to pick-up.". Now that's what I call handy. The Cabulous beta is being held in San Francisco, California in November/December 2009.

Other articles: