Debugging with git bisect

Via Sebastian Bergmann’s blog I’ve learned about git bisect and how it can used for debugging.  Sebastian demonstrates the functionality together with PHPUnit.  I am a git newbie, so that was quite interesting for me.

git bisect can be used to find the change that introduced a bug. It does so by performing a binary search on the list of commits between a known good and a known bad state of the repository. A tool such as PHPUnit can be invoked at each step of the binary search to check whether or not the current state is broken.

Here is a shortcut on how to actually use it:

$ git bisect start
$ git bisect good someVersion
$ git bisect bad someOtherVersion
$ git bisect run someCommand -with SomeArgument

There are, of course, more resources online covering the feature.  I found this section of the Git Community Book helpful.  Hopefully, I’ll remember about it when I actually need it.

Fixing Firefox with safe mode

Here is something useful I learned today.  Until recently I’ve been using Firefox 3 beta 5.  It was working fine for me after I found all replacements and upgrades for all the extensions that I need.  One of those extensions was CompactMenu (not giving a link for now).  This extension replaces the whole main menu (File, Edit, View, etc) with a single icon.  You can place this icon anywhere on your toolbars and when you click it, you’ll get a drop down with your main menu items.  Huge space saver.

Yesterday, I upgraded my Firefox to the latest and greatest stable version 3.  The update came as an official package from Fedora updates.  However, once I fired up the new Firefox, it notified me that CompactMenu was not compatible with this version and so it was disabled.  Can you guess where I ended up?

Exactly.  No menu and no way to get to the menu.  I tried uninstalling the extension, intalling another version of it, unintalling it again, cleaning up options in about:config, customizing the toolbars, and so on and so forth.  Nothing worked.  And so I Googled.

It turns out that Firefox has something called a “safe mode“.  All you need to do to get to it is start firefox with “–safe-mode” parameter.  Once it comes up, you’ll see the window as on the screenshot above.  One of the optios is “Reset toolbars and controls“.  It works wonders.  I got all the toolbars to their default state, and with View -> Toolbars -> Customize I could easily get them to the state I want.

Out of fuel

Today was the second (third?) time in my life when I ran out of fuel. I am trying not to push my luck and so I usually drive around with enough petrol to take me at least across the country.

Doesn’t always work it turned out. Since my car is in the repairs, I am driving someone else’s Mazda. This car’s fuel meter is not working at all. It always points to empty. The trick is to put 10 CYP and drive less than 220 km.

Last time I was at petrol station I had 180 km done only. And today, when the car stopped, I had only 140 km since last dinner. Either all the meters are working bad, or the car changed its appetite for unleaded.

The worst thing was that I couldn’t troubleshoot the problem down to the fuel myself. The owner of the car had to come and try to start and check it. He then suggested that it might be out of petrol, despite the indicators and meters. So, we put some fuel in, and it worked.

From now on, I’ll be having full tank as often, as possible…