Joe Moore's blog



bookmark_fu: drop-in Iconistan

edit Posted by Joe Moore on Saturday December 22, 2007 at 12:50AM

We just implemented bookmark_fu on Pivots and the experience was very smooth, taking only a few minutes. We how have an "Iconistan" of social bookmarking chiclets for either remembering or promoting content on Digg, reddit, del.icio.us -- almost 20 sites in all.



Install via the normal plugin install process (the -x installs it as an SVN:EXTERNAL):

#> ruby script/plugin install -x svn://rubyforge.org/var/svn/pivotalrb/bookmark_fu/trunk/bookmark_fu

I did have one issue -- the script/plugin install script pulled all the code down but ultimately failed because we have multiple versions of Rails on our development machine (about 5); this seemed to confuse the install script. No problem, though: I ran the install.rb script manually:

#> script/runner vendor/plugins/bookmark_fu/install.rb

Thoughts on Linus Torvalds's Git Talk

edit Posted by Joe Moore on Wednesday December 12, 2007 at 08:00PM

At Pivotal Labs last week we watched Linus Torvald's Google talk about Git, the Source Code Management (SCM) system he wrote and uses to manage the Linux kernel code.

I've watched it twice now and here are some thoughts, based on quotes and themes from the video.

"I Never Care About Just One File"

Linus stated that one of the reasons Git was wonderful for him is that, as a high level code maintainer, he needs to merge thousands of files at once. In fact, he stated that he never cares about just one file.

Not so for me. As an in-the-trenches developer, my whole life is caring about just one file, over and over again. When I merge, I care about each file because, since I work on small teams and with small codebases, there is a fairly high likelihood that my changes will collide with those from another developer.

"The Repository Must Be Decentralized.... You Must Have a Network of Trust"

Linus made the point that central repositories suck for large projects where the morons must not have commit access -- only the super privileged are allowed to commit code back to the repo. He argues that Git is better because it is a decentralized network of repositories -- there is no central master, only Some Dudes who have repositories. Usually there is Some Dude In Charge, like Linus, and everyone tends to pull code from them. To update the "master" code version, Some Dude In Charge pulls code from the repositories owned by Some Other Wicked Smart Dudes, who have most likely pulled code from Some Other Trusted Dudes (And One Gal), and so on. Thus, rather than limit access to just the hand-selected few, everyone has their own local copy of the repository, and the smart merge from the smart who merge from the smart, resulting in some kind of official or de facto version.

While I like the local copy of the repo idea, Pivotal does not work the way Linus describes... but Pivotal is weird, in a good way. We all have full commit rights. Our network of trust is everyone. The Dude In Charge is named Continuous Integration. CI makes the official versions. CI runs the tests. CI makes sure that the deploy process works. I'm sure that we could coerce Git into working in a centralized-like way, where it merges automatically from the individual developers and runs the builds, but I'm not sure if that would be forcing a square peg into a penguin-shaped hole.

"Some Companies Use Git And Don't Even Know It"

Linus described how developers at some companies use Git on their development machines, committing their changes and merging fellow developer's changes with Git, then pushing those changes to central SVN repos. He rather mocked this, but it actually sounds like a good solution: developers merge, so use the tool that's good at that. CI machines and deploy machines love centralized master repositories, so use that for those jobs.

"It Does Not Matter How Easy It Is To Branch, Only How Easy It Is to Merge"

Well said. I never thought about that before but he is completely right. I could never put my finger on why I never branch in SVN, even though it's practically 'free' and easy to do. Now it's obvious: who cares how easy it is to branch when merging sucks? Git is supposed to make merging incredibly easy because Git is content-aware rather than just file-aware... or something like that. I'll believe it when I see it, but if Git really does make merging highly divergent branches easy then I'll give it a try.

Joe's Take

I'd like to try Git, especially if it makes branching and merging those branches as easy as Linus suggests, but I don't think that Pivotal would get as much benefit out of it as large, distributed open source projects. A 'really big' project might have 10 developers, not thousands, and all must have commit rights. Our network of trust goes like this: if you are here, we trust you; if we don't trust you, you have to leave. And the idea of having to merge directly from my fellow developers sounds like a pain in the ass... why would I want to merge from 3 separate pairs when I can pull code from the central repo and be reasonably sure (thanks to CI) that it is clean and green? Hopefully I'll be able to answer those questions soon by using Git on a project.

(Note: originally posted on my personal blog at http://40withegg.com/2007/12/11/thoughts-on-linus-torvalds-s-git-talk)

Standup 02/16/2007

edit Posted by Joe Moore on Saturday February 17, 2007 at 06:57AM

A shorty today.

Interesting Things

  • A massive group of developers is revisiting and debating the current state of our shared-code architecture. appable_plugins might not be a perfect match, and we might develop our own or plugin-sharing system.

Total Stand-up Meeting Time: 12:00 minutes

Standup 02/15/2007

edit Posted by Joe Moore on Thursday February 15, 2007 at 06:52AM

Interesting Things

  • Subversion Tip: We were reminded of a handy tip: when saving shell scripts in subversion, you can save them as both executable and also in a 'native' end-of-line style, which will run on any platform.
<code>
   $> svn propset svn:executable ON somescript.sh
   $> svn propset svn:eol-style native somescript.sh
</code>
  • If you want some easy but very effective charts, check out WebFX's Chart Javascript library. Clients love them! Chart the number of users signed-up per day, etc.
  • Another handy plugin we've used many times: QueryTrace. It helps you find slow database queries, but it really floods your logs with data, so make sure to turn it off in production!
  • We're using appable_plugins for several projects but having problems with dependencies between the plugins, especially in fixtures. This might be caused by our fancy-dancy fixture loading extensions.

Ask for Help

  • One project is doing another round of profiling and is looking at the the latest profiling tools for Ruby and Javascript. They are checking out Firebug's JS profiler, ruby -r profile, and our own custom ruby test benchmarker, amongst others.
  • One project is seeing a very strange memory leak that causes 100MB of memory loss per second (guh! guh!). It started when they begin using ActiveRecord.connection.execute("some sql") to build some reporting statistics, but it seems too early to blame that. Coincidental, though.

Brown Bag Lunch Topic: Rails 1.2 features, ideas, and gotchas.

Total Stand-up Meeting Time: 25:00 minutes

Interesting/Ask for Help for 02/14/2007

edit Posted by Joe Moore on Thursday February 15, 2007 at 12:12AM

Interesting Things

  • We'll be sending 6 people to RailsConf, so say 'hi' if you see the Pivots!
  • We have a fix to our Amazon S3-causing-mongrel-to-hang problem: you can tell the connection not to be persistent by passing in :persistent => false:
<code>
    AWS::S3::Base.establish_connection!(
        :access_key_id => access_key,
        :secret_access_key => access_key,
        :persistent => false
    )
</code>

Ask for Help

Total Stand-up Meeting Time: 14:00 minutes