Subversion to Git

The whole world has not quite converted to Git yet, but it is well on the way. To actually work with a Subversion backend, a standard Git installation includes git-svn which implements an excellent two-way support. If you just want to track a Subversion repository without pushing to it, svn2git gives a better conversion in that it properly converts Subversion tags to real Git tags as well as some other house keeping.

I have used (and contributed to) svn2git before, but not for a while. Now I needed to use it again and realised that it is pretty sensitive to what Git version you have installed. I first tried with the latest Homebrew version (1.8.4) and it failed. I then uninstalled the Homebrew version and tried the Apple supplied one (1.7.10.2) and that failed too. Some Googling told me that version 1.8.3.1 seemed to work all right. So how to get that one? Turns out that is pretty simple nowadays.

  1. cd into the Homebrew folder (normally /usr/local)
  2. Run brew versions git to see all available versions
  3. Copy the checkout command from the list and run it.
  4. Run brew unlink git && brew install git.
  5. Run git checkout with the file path from 2 above.

Voilà! You now have the correct version installed. But wait, there’s more! You can now install several versions of the same program by following the steps above and then switch between them with brew switch <formula> <version>. Very convenient.

Creating user documentation with Doxygen

Doxygen is as everybody knows, the de-facto standard for generating API documentation from source code comments. But it is also pretty great for generating user documentation, as is apparent from the Doxygen documentation itself. And with the really good Markdown support in recent versions, it is no longer necessary to write the documentation in “fake” code. Just plain Markdown works great.

There are a few gotchas, though, as I discovered when trying to generate a QT Assistant help file for the application I’m currently working on.

Continue reading

Useful git commands – part 2

Sometimes you have a project with lots of submodules that you never change yourself, but want to update occasionally. One example would be if you use Pathogen for your VIM plugins. You’d think you could use git submodule update here, and sometimes you can. But note that one of the main features of submodules is that they are locked to a particular commit. In case you want to pull in the latest changes from the remote, you need something else.

I put this alias in my .gitconfig file to solve the problem (note that this needs to be all on one line):

subup = submodule foreach 'git pull -s recursive 
-X theirs origin master'

The command will cd into each submodule, and do a forced pull overwriting any local changes you may have. Nice, right?

Useful git commands – part 1

If you are like me, you have a whole bunch of projects on your hard disk that you want to update occasionally, but don’t really work actively with. Previously I usually put an update-all.sh file in the root folder of those projects. But in most cases it is possible to use a general approach. I now do it like this:

If you pass a path to the script, it updates all subdirectories under that path, else it uses the current directory. And to make it even more convenient, you can add an alias to your .gitconfig file, like so:

pullall = !~/bin/git-pullall.sh

Now you can just use git pullall to update everything in one go. Convenient!

Disk problems and recovery

I have for the first time in maybe 10 years had a disk crash so severe that the computer didn’t start. And here I was under the impression that the risk for this happening should be less with an SSD disk.

Anyways, my computer had been displaying several weird symptoms over the past days, mostly as internet connectivity problems. And when I got to work today it would not wake from sleep (it had been fine at home half an hour earlier). I did not think this could be a disk problem right away, so I first tried to boot into safe mode. However, the boot just stalled. I left it for 20 minutes, but no progress. So next step was to start from the recovery partition and running Disk Utility. Doing that indicated a number of file system errors. I let Disk Utility fix them, and now everything seems OK again.

Not too bad, nothing was lost – at least I haven’t noticed anything yet.

Pebble, a month later

So, I’ve had my Pebble for a while now, and I still like it. The vibration works great for waking me up. I never had a wrist watch that could do that with sound. More exciting though, is that things are finally happening at the apps front. The watch face SDK was released a few weeks ago, and boy was there a pent up need to produce watch faces!

Most are crap of course, but some are really good. I am currently using Revolution, which is a excellent. Huge display of hours and minutes, so even I can see it. But it also shows seconds and date. Also, some user written apps are showing up – still far fewer that watch faces though. I am using Timer occasionally. It is a simple but useful countdown timer that really should have been built-in. And to show what is possible, we have a Hex Editor no less! Yes, it allows you to totally screw up the watch OS and other apps. Weird, but why not.

And of course, the RunKeeper app has finally appeared! Woot! This was announced already when the Kickstarter project was set up, and was probably the main reason why many decided to get a Pebble. The current version only displays distance/speed in miles. Hoping for a fix to that asap …

No more Windows for me

Well, that’s not quite true. But I have stopped using a separate Windows computer, and instead run Windows 7 in a virtual machine on my Mac. I am currently using Parallels 8.0 which works brilliantly. I have switched back and forth a bit between Parallels and VMWare Fusion. I’d say that they are quite similar functionality wise, at least for the things I use them for, which is almost exclusively to compile and debug with Visual Studio. Anyhow, the less Windows the better so I’m happy with this setup for now.

Pebble impressions

I have had my pebble for a few weeks now, and I actually like it a lot, even with it’s current limitations. There is a small uproar going on in the Pebble community because all the promised watch apps and the developer SDK has failed to appear yet. And I agree – I too would like to try writing cool apps for the watch. However, I do believe that will be available at a later point, and the watch is actually quite usable even as it is.

My favorite function is a very simple one. The motion sensor in the watch turns the backlight on at a flick of the wrist. This is so useful that all electronic watches should have it.

The main functions the watch has right now (apart from telling time) is SMS and mail notifications. SMS is flawless, mail works most of the time but not always. This is apparently a problem with the iOS API and the Pebble guys are working on it – or so they say. The watch also works fine as an iTunes controller.

A big drawback is unfortunately a severely diminished battery life on the iPhone due to the increased Bluetooth traffic. I used to get at least two days out of my iPhone before Pebble, and now I get barely one day. Irritating, but not really Pebble’s fault.