Thursday, December 31, 2009

Why everyone should be using Git...


I'm sure this has all been said before, but people don't seem to get the message: Subversion sucks for external contributors. Occasionally I send some patches for projects using Subversion...

Subversion has no way to commit local patches so that you can test out your changes, split up commits functionally, generate patches easily so you can send them to a review list, or any of these great features. Git does not have this problem; in fact it has a very nice set of tools for working this way. I won't go into the details of that, as most readers probably know it already, other than saying that it's amazingly simple and easy.

The pain comes when you're an outside contributor for a Subversion project: you might be testing some experimental changes that you don't want to commit to the public repository. Okay, you can edit the files and svn diff locally but this pathetic compared to the power of git commit and git format-patch
  1. You're stuck doing one functional change, and only one functional change. Because you have no way to create a patch series. It's either everything in one commit, or nothing at all.
  2. Even when you have commit access, often this results in multiple functional changes being squashed into a single commit. This is very bad.
  3. Subversion provides no way to add commit messages or authorship to the diff generated by svn diff, so contributors are left out in the cold.
    • Yes, if you have commit access you can provide this meta-data, but you're still pushing directly to the repository with no review what-so-ever.
I could continue, but I think my point is made: Subversion sucks for distributed development (in the across the globe sense) and it also sucks for development in the "few developers distributed across the room" sense. It all adds up to pain and inefficiency: especially for external contributors, but even for people working with the project with commit access.

Thankfully Sourceforge does at least provide rsync access to the Subversion and CVS repositories so git svn clone can be both fast and bandwidth efficient. Unfortunately, however, it seems that Subversion chokes on anything but patches generated by Subversion itself (including standard GNU diff format.)

Everyone should be using Git (or at least some distributed version control system with similar features.)

Tuesday, December 29, 2009

Alarm clock vs snow plow...

Okay, technically it would be a backhoe scoping up snow/ice from the road and footpath, but seriously, at 09:45 and right outside my bedroom window!

I've had the alarm on my N900 fail to wake me several times, however this is much more effective; now if only they could do it at some reasonable time, like, oh, 12:00 or 13:00... and in keeping with the day of fail, my box at Nokia seems to have lost it's IP address, so no working remotely today.

Thursday, December 24, 2009

Holiday boredom...

I don't have any plans for the Christmas holidays, and Helsinki is at just the right temperature to make doing anything outside really difficult. Some of the snow has melted and frozen into ice, making it feel a lot like walking on broken glass: physically and emotionally; I stopped counting the number of unintentional acrobatics after about the 5th or 6th time sliding in some way.

I might implement zlib compression for network traffic in my engine, which should only be a few dozen lines... or something a bit more interesting; stencil shadow volumes could still use more optimization, or some SIMD stuff...

There are at least a few dozen minor X server issues discovered by Coverity, but that's getting dangerously close to Nokia work over the holidays. The majority of the issues are error paths anyway, nothing really critical.

In the more being lazy and doing nothing area, Avatar looks like it could be an interesting movie...

Monday, December 21, 2009

Static analysis For The Win!


I caught on about clang, which is both a compiler and static analyzer, after it was mentioned on the xorg-devel list. Since then I've been running it on my own code and gradually fixing up errors.

Now, usually such tools are less than impressive (excluding extremely expensive proprietary tools such as Coverity.) However, clang has been really useful in eliminating a lot of dead code, unused variables (and the overhead of calling expensive functions to calculate those variables.)

I even discovered one major bug in the expression evaluator in my game engine which had gone overlooked for some time, which would result in two opcodes giving incorrect results and ultimately effecting the rendering of the shaders.

Clang is currently lacking Inter-Procedural Analysis but it seems like it's on the to-do shortlist, which will be a very nice feature. Hopefully it won't be long before Coverity's eating it's heart out.

Sunday, December 20, 2009

Building a better flashlight...


I started looking into the projective light issues in XreaL and my forked engine again. It turned out the problem was setting up the light rotation via both the quaternion and light projection vectors.

The flashlight was working, but would point in the opposite direction you were looking. Right was left and left was right. Of course, it seems simple in hindsight, but these kind of bugs always annoy me until I find out what was going wrong.

Boring screenshot included for the fun of it...

Window drafts...

I'll be stopping by K-Rauta today and picking up some masking tape to put over the gaps between the window panes and the outer frame... I already replaced the older E sealing tape with thicker P tape before winter, but it seems there are still some nasty drafts coming through...

Now, I usually don't mind the winter; in fact I much prefer the shorter days instead of ~18 hours of sunlight, but it seems I don't share the Finns immunity for subzero temperatures.

Saturday, December 19, 2009

New city, new job, new blog...

I decided to start blogging again, now that I've somewhat settled down in Helsinki, and hopefully I'll be able to keep some regularity in the postings this time. Picture is from Snellmaninkatu, near my apartment at about 14:00 yesterday.

It's been an interesting year; moving to Finland, working for Nokia, speaking at this years X Developers Conference and Maemo Summit.

Maemo Summit was arguably the most interesting since I was giving a demo of an early version of Quake 3 running on the N900 (also another video.) The whole thing started from a weekend project after chatting to Phil Carmody, who wrote the touchscreen and accelerometer kernel drivers. Actually it ended up turning into a several weekend project, but I digress; funny what happens when engineers get bored after work...

Currently I'm working on fixing two XreaL bugs with projected lights; I did a quick patch for the first issue but the second one is being more troublesome; Robert will probably get that before I do, and when it's 05:30 in the morning, maybe it's time to call it quits for the day.

Although, tomorrow might see the N900 getting more of a workout than Quake 3...