git-fu: long term fork

Jeff Mancuso August 4th

Here is a great post by Mathieu Martin about how to use Git to maintain and extend a long term fork of a project.

Recently at GiraffeSoft we started a new project, based on another existing project we already had going. We could call this a long term fork.

I’m sure you’ve done this before. You were probably using Subversion, and your project is probably 2 years behind HEAD of the original project.

Your invariants probably looked something like this:

  • * These projects will both keep being actively developed in the future;
  • * They will have some fundamental differences that will not be reconciled;
  • * They will however keep many similarities and we expect that they will benefit from the exchange of some specific patches, as development on both moves forward.

This happens all the time, especially in web development. You find a fantastic open source project to base your project on, but you need to customize and extend it. You also want to easily incorporate future features and bug fixes from the original project as they’re developed.

In days past, this problem could have been solved reasonably well by cloning the central repository and then exchanging patches and applying them manually.

I’ve tried this before. Remember that scene in the Dark Knight where the Joker makes the pencil disappear? It’s kinda like that.

As you’ve guessed already, we’ve decided to try using Git to help manage this long term relationship.

It’s still not going to be easy unless you control both projects, but using a setup like Martin describes will be much easier than checking the man page for patch as you try to merge in new features by hand.

git-fu: Git for the lazy

Jeff Mancuso July 29th

Getting started with Git? Git for the lazy is one of the better starting points we’ve seen [via SvN].

There are a million Git cheat-sheets out there, but this one does a pretty good job at picking the more intuitive way of performing a particular task, and showing some sample commands to get it done. The How To Fix Mistakes section is particularly useful, and succint:

Haven't committed yet, but don't want to save the changes? 
You can throw them away:   
git reset --hard   

You can also do it for individual files, but it's a bit different:   
git checkout myfile.txt   

Forgot something in your last commit? That's easy to fix.   
git reset --soft HEAD^   

Then write over the last commit:   
git commit --amend   

Don't make a habit of overwriting/changing history if 
it's a public repo you're working with, though.

If I read another post with a laundry list of why git is useful, each bullet linking me to the man page, I’m going to scream. How much time do you think I have?

There is no shortage programmers coming over from Subversion who feel confused and perplexed by all that Git has to offer. My biggest complaint about Git is that there are quite a number of ways to accomplish a specific task, and it’s not always clear that the best practices are.

Tube Sales Plummet on News of Stevens Indictment

Cosmo Catalano July 29th

Long-standing Alaskan Senator Ted Stevens was indicted today on federal corruption charges. Among the Senator’s more quotable statements was this doosy:

They want to deliver vast amounts of information over the Internet. And again, the Internet is not something that you just dump something on. It’s not a big truck. It’s a series of tubes. And if you don’t understand, those tubes can be filled and if they are filled, when you put your message in, it gets in line and it’s going to be delayed by anyone that puts into that tube enormous amounts of material, enormous amounts of material.

Elsewhere on the market, big truck futures were up in heavy trading.

San Francisco Recycles 69% of all landfill-bound waste

Jeff Mancuso July 29th

The New York Times quotes an amazing statistic today: San Francisco recycles 69% of all landfill bound waste. Even more surprising is our national average is 32%. Nearly 1/3rd of the waste we throw away gets sorted out and somehow recycled or reused.

Houston, bucking the trend, seems to rebel “against mandates or anything that seems trendy or hyped up” with their meager 2.6% rate. Recycling is trendy. Who knew?

Houston recycles just 2.6 percent of its total waste, according to a study this year by Waste News, a trade magazine.

City officials cite the difficulties surrounding the effort: expensive collection, little public support, high cost of fuel for collection in a sprawled urban environment. Also, a ludicrous argument from Houston’s Mayor, Bill White, about their “independent streak” keeping them from recycling.

The most interesting part of the article is this graphic showing recycling rates for other major urban centers across the country. San Francisco manages to achieve a 69% recycling rate across all landfill bound waste.
Click for full graphic

Click for full graphic

Seems too good to be true? I thought so. After a bit of research, I found this press release from the SF Mayors office confirming the numbers.

Recycling is simply part of life in San Francisco, with new statistics showing that the city kept 69 percent of all waste-stream materials from going to the landfill, up from 67 percent the year before. The most significant gains were in the areas of commercial recycling, and the collection of compostable food scraps and yard trimmings.
The figures, compiled by the City’s Environment Department (SF Environment) and approved by the California Integrated Waste Management Board, show that San Francisco generated 1,978,748 tons of waste material in 2005. Of this, 664,033 tons went to landfill, while 1,367,013 tons were diverted through recycling, composting, reuse, source reduction and other efforts.

Wow.

Keirin Controversy Concerning “Cycling Cash Claims”

Jon Shea July 28th

Ever wonder how you get a new sport into the Olympics? The BBC seems to think that one way to do it is with cash. Big, million dollar stacks of cash. They claim that a Japanese cycling association paid $3,000,000 to cycling’s international governing body (the UCI) to get the “keirin” included in the slate of Olympic velodrome events.

I don’t really care about the scandal. I assume that everything about the Olympics preparation, from the venue to the events, is decided by bribery. It’s just a good segue for me to explain how awesome the keirin is. It works like this: the racers have to stay behind a pace setter (who rides either a bike or motorcycle) for most of the race. The pace setter starts out going medium-slow (about 20 mph), and over the course of about 8 minutes slowly ratchets the speed up to 30+ mph. The cyclists jockey for the prime position, right behind the pace setter. Then, at a prederminded spot about a half mile from the finish, the pace setter pulls off the course and it’s a free for all.

Check out this video (1:33) and you’ll get the idea. The action starts with the pace setter (in purple) pulling off the track.

The Japanese had to pay $3,000,000 to get that in the Olympics? Who wouldn’t want that in the Olympics? How much did Russia have to pay to get Rhythmic Gymnastics in the Olympics?

SftpDrive: Automatic License Install

Jeff Mancuso July 25th

We need to do a better job about posting helpful hints for our SftpDrive users. Thus begins a series of posts aimed at that.

Automatic License Distribution & Installation

To help ease the task of installing SftpDrive for large groups of users we’ve introduced a method to easily package your license key such that it is automatically installed.

As of version 1.7.9 of SftpDrive you can easily package and install your license by creating a file named SftpDriveLicense.txt that resides in the same directory as the installer. Paste your license key into that file and it will be picked up by the installer and automatically installed. This saves you the trouble of having yourself or users enter the serial number during the first run.

Setting up Hamachi on OS X

Jeff Mancuso July 24th

It’s really too bad LogMeIn had to buy [suck the life out of] Hamachi. Hamachi lets you easily [really easily] setup your own virtual private network. It lets you link together remote computers as if they were on the same local network, no matter where they are, or what router they might be behind. Its one of those rare pieces of technology that magically “just works”

  1. Install Hamachi on any of your machines - it runs on Mac/Windows/Linux.
  2. You are automatically assigned a static virtual IP address in the 5.x.x.x address space
  3. Create or connect to a network - which has a name of your choosing, and is password protected.
  4. Enjoy

On a Mac, that means wonderful things like iTunes music sharing work directly across the internet. No matter where where your computers are - you can see whoever is on the network as long as they have an internet connection. You can also immediately access a screen sharing or file sharing session through finder with a click of a button, whether the machine is next to you - or on the other side of the world.

It’s really great. And it really IS that easy.

Some helpful hints on installation:

The easiest way to get up in running is by using the installer in the [ugly] HamachiX graphical front end. Their documentation walk you through everything. For an even better experience, configure Hamachi to startup at boot with these instructions hosted over at GitHub

Turn Your iPhone 3g into a Wireless Hard Drive

Cosmo Catalano July 22nd

For me, one the biggest disappointments about the original iPhone was the lack of a mountable file system. Not that the iPhone needed any more hype, but how sweet would it have been to tack on “portable drive” to its laundry list of features? Well, thanks to ExpanDrive, now you can.

I name my drives after deadly sins

All of a week after the release of the iPhone 3g, the iphone dev team released its pwnage tool, allowing you to jailbreak your phone. There’s a pretty exhaustive step-by-step of how to use the 3g pwnage tool here; the only thing I’d add to it is this bit about how to fix a DFU mode bug:

The error that everyone has been googling since the tool was released: “Failed to enter DFU mode”

The fix for this was difficult to find. There are hundreds of posts out there from people trying to find answers, but very few useful solutions. However, the solution is a simple one:

Fire up Terminal on your Mac and fire of these two commands:

cd ~/Library/iTunes
mkdir “Device Support”

If the Terminal is scary, you can do the same thing by going to your Home folder, opening “Library”, opening the iTunes folder inside Library, and then creating a new folder called “Device Support” in that iTunes folder.

Jailbreaking the phone does lots of fun things for you. But the ones that matter for this article are enabling root access and SSH support. After the jaibreak is complete and the phone has rebooted, open the Cydia app that has just been installed on your phone.  Scroll down to “OpenSSH Access How-To” and follow the the directions there.

After the last step, and while still in the terminal window, type “passwd root” and enter a different password, one hopefully hard to crack than the default, which is “alpine”.  This will prevent people from messing with your phone while you poach their wireless networks.

Once all that’s done, go over to Expandrive and enter whatever IP address you just typed into the Terminal, along with the username “root” and the new, secure root password I just told you to make. The drive should pop right up on your desktop. Open it, and it should look something like this:

tada! filesystem mounted (kinda)

You can drag and drop stuff onto and off of that as you would any other ExpanDrive-mounted disk. Unfortunately, it only works over the Wi-Fi connection, so it’s still not as fast as a disk-use iPod, and I still haven’t figured out how to add and delete media and apps this way.  I’d also be careful filling the drive to capacity, since it seems to have no idea how large it really is.

ExpanDrive 1.2.9 Released

Jeff Mancuso July 17th

ExpanDrive 1.2.9 is out now and available for download [release notes]. There are three major features of this release, apart from a host of small bug fixes and tweaks that we’ve put in the program in response to user input. New icons, MacFUSE 1.7, and new packaging/installation.

ExpanDrive

Long overdue, ExpanDrive has a new application icon and menu bar icon. They’re pretty hot. Many thanks to Jordan Langille over at OneToad Design who tirelessly worked with us through quite a number of revisions.

ExpanDrive

The second major change to ExpanDrive 1.2.9 comes with the addition of MacFUSE 1.7 [see CHANGELOG]. This removes a variety of small incompatabilities and addresses some major issues with certain applications saving after upgrading to OS X 10.5.3.

Again, long overdue - we’ve performed a complete overhaul of our installation technique. We’ve ditched of a PackageMaker in favor of a simple ZIP based distribution. MacFUSE will be magically installed or upgraded [with your permission] upon launch.

Dr. Horrible

Jon Shea July 16th

If you watch tv, then you’ve no doubt noticed the complete absence of new content which infests the summer months. For a little reprieve, check out Dr. Horrible’s Sing-Along Blog, a 15 minute, low-budget side project by Joss Whedon (the creator of “Firefly” and the “Buffy the Vampire Slayer”, and writer of the under-rated movie with the same name).

New episodes on Thursday and Saturday. Free until Sunday.