Archive for the ‘Mac’ Category

Getting git to work on OS X Tiger

Friday, August 22nd, 2008

If you haven’t heard of git yet, it’s quickly becoming the preferred version-control system for tons of open-source projects, including the twin suns of ruby on rails and prototype.

In fact, if you keep your eye on the github blog you’ll see a steady stream of well-known projects moving over to git, as diverse as the Blueprint CSS framework and the Haskell compiler.

Basically, if git was a stock-market commodity, analysts would be issuing strong buy recommendations left, right and centre. Git’s tipping-point has arrived.

How to play

If you’ve arrived here via search-engine, it’s probably because you’re trying to work around errors like Can’t locate Error.pm or Can’t locate SVN/Core.pm. Read on…

I already had macports installed, but if you haven’t, follow the macports install instructions - we’ll be using macports to download and install git as it’s supposed to be simpler than building from source.

If you’ve had macports installed a while, make sure it’s up to date:


$ sudo port selfupdate

We want to use git to connect to subversion repositories as well, so we’ll just check that’s possible:


$ port list variant:svn
git-core        @1.6.0  devel/git-core
subversion      @1.5.1  devel/subversion

I already had subversion installed but through trial-and-error found I needed to reinstall it with perl-bindings (git must be using perl scripts to talk to subversion…) Note: I’m using the -f flag to force it to reinstall, you might want to try without first, just to see what conflicts it brings up:


$ sudo port uninstall -f subversion-perlbindings
$ sudo port install -f subversion-perlbindings

Next, we install git:


# This may take a while to install with all its dependencies:
$ sudo port install git-core +svn

And finally, we check it works:


$ mkdir myproject; cd myproject;

# Check your PATH's set properly, this should output:
# fatal: Not a git repository
$ git svn

# If that's OK... clone a repository:
$ git svn clone http://example.com/svn/project/trunk

Can’t locate Error.pm

If you’re getting Can’t locate Error.pm or Can’t locate SVN/Core.pm you should immediately try:


$ PATH=/opt/local/bin:$PATH git svn

If that works, you know it’s just a PATH problem. It’s something to do with Apple’s perl install having slightly kooky ideas about where to store perl libraries.

If you’re still getting complaints about Error.pm, you need to install the CPAN module - and we’re going to use the /opt/local/bin instance of cpan, to make sure things go in the right place for us:


$ sudo /opt/local/bin/cpan -i lib::Error

Cross your fingers, and try again:


$ PATH=/opt/local/bin:$PATH
$ git svn clone http://example.com/svn/project/trunk

If things are working, git will spend a while cloning the subversion repository by pulling out every single revision so you can have a complete set of revisions (including deltas), ready for you to refer to with lightning-speed regardless of internet connectivity. Which is nice.

In search of an Adobe Reader alternative on Mac

Wednesday, July 2nd, 2008

I’m looking for an alternative to Adobe Reader on OS X after discovering its “Find” function can’t find jack.

As I’m still running Tiger (OS X 10.4) I find Preview to be a tad lacking in usability - if only the ‘Maximize’ button maximized height and width, I’d be happy. But no, it’s a typical Mac-spastic application - maximize makes the application full-height, but doesn’t change the width. If you’re viewing a PDF using “Fit to Width”, this means the text-size stays exactly the same… which is never what I want.

If only Foxit Reader worked on Mac, I’d be using that (it’s a damn nippy and reliable piece of software on Windows.) But sadly it doesn’t - I even downloaded the Linux version, you know, just in case it worked on OS X (being a *nix ‘n all.)

So, I’m currently taking a look at PDF-XChange Viewer which comes in a couple of different versions. They provide a wee comparison chart to help you choose which version of their PDF viewer to download - but guess what format the chart’s provided in. You guessed it: PDF.

That doesn’t give me much confidence…

Updated 7th July 2008

It didn’t take long to realise PDF-XChange doesn’t even work on OS X. I’d been working my way down the “multi-platform” list of PDF viewers at wikipedia assuming “multi-platform” meant Windows and OS X - but it seems someone thinks PDF-XChange is multi-platform simply because it runs on more than one version of Windows.

Finally, I installed Skim from sourceforge. This open-source PDF reader works pretty well. Searching within documents is user-friendly - (by default) a pane on the left shows extracts matching the search term; click-to-navigate brings the document to the right page and highlights the search-term with both background-colour changes and by ringing the terms in red, making them easy to spot.

Upgrade your new Macbook Pro’s memory yourself, and earn a free iPod (or two)

Friday, June 29th, 2007

Apple are marking the launch of the iPhone by keeping all their US stores open from 6pm till midnight. I suspect the sales-process will be slow (since contracts need to be signed) and the stores will be full of people picking up random goods just to pass the time.

Not that this has anything to do with the iPhone, but if you’re going to buy a MacBook Pro with the full 4GB memory you have to make a decision:
1) MacBook Pro with 4GB memory installed by Apple
2) MacBook Pro with 4GB memory you installed, PLUS an 80GB iPod Video, PLUS an iPod Shuffle

It’s your choice. Installing memory is a piece of cake: pop the battery out and take off the memory cover (4 screws), replace old memory with new memory, then put the cover and battery back on. All in, it’s a couple of minutes.

So, the Maths: (with an ‘S’, because I’m English.)

UK Price US Price
Apple Upgrade Charge (2GB to 4GB) £480 $750
4GB memory (from Crucial) £180 $279
Saving £300 $471

That’s some juicy saving… Let’s buy some iPods:

UK Price US Price
Apple iPod Video 80GB £239 $350
Apple iPod Shuffle £49 $79
Total £288 $429
Remaining Savings £12 $42

Even after buying two iPods, you still have money left from your savings to buy drinks to celebrate.

Now I’m not going to moan about the rubbish exchange rate being used - I think we’re accustomed to being stiffed in Britain; but I will say something in Apple’s defence: they’re not alone. Dell also charge similarly extortionate prices for memory upgrades on their laptops. I’m not been writing about Dell for two reasons: (1) I’ve no idea if their laptop memory’s as easy to replace, and (2) they don’t make iPods.

And finally. Back to the iPhone. Instead of blowing your $470 savings on iPods, you could always use it for the majority payment of your iPhone (whether it be the $499 or $599 version.)

Good luck to those of you trying to get your grubby mitts on an iPhone tonight.