Archive for September, 2011

SVN to (existing) git repository in 3 steps

Wednesday, September 14th, 2011

Today I migrated Morrigan (my media player and manger project) from a private SVN server to an existing repository. Usually I would not bother writing up such mundane things, but this was so easy I wanted to make the point.

Assuming an existing target git repository called `projectfoo-git’, it goes like this:

$ cd <projectfoo-git directory>/..
$ git svn --authors-file=svn-authors.txt clone -s projectfoo-svn-git
$ cd projectfoo-git
$ git pull ../projectfoo-svn-git
$ git push

The remote repository will now contain the full SVN commit history merged into the existing history. Are there any other source control systems that can come anywhere near making it this easy? I doubt it.


Developing on Android

Saturday, September 10th, 2011

A few days ago I got an Asus Transformer – an Android table with a full physical keyboard. Since then I have been trying to figure out the best way to write code on this device. While porting Eclipse to Android would be cool, it would also be near impossibly complex. It would also be excessive. What I am aiming for here is a fairly simple toolchain and workflow.

To start with, I would like to be able to:
– Check code out of Git
– Make some changes (preferably with syntax highlighting)
– Commit and push changes back to remote Git repository

And there are a number of ways this could be done…

1) Write pure-Java Android app. There are good Java libraries for most tasks, including a pure-Java Git client. This would still be quite a tough job though as there would be a lot of UI work to do.

2) Native binaries. It is in theory possible to cross-compile all the needed tools, including a shell, git client, vi, etc. The main downside here is how they interact with non-rooted devices. Native binaries must be packaged up inside a .apk like any other app and can only be run by their owning application. For example ConnectBot could not use a local-term to run a git binary from another .apk. A custom ConnectBot build containing the extra binaries would need to be built. Also I have yet to find an example of compiling git for Android. :(

3) Use a VM. Android devices like this have more than enough power to run small VMs. And recently a VM was written in JavaScript that could run shell, vi and emacs well. A small Linux VM that hosts an SSH server on a local port and using ConnectBot as its UI would provide a fairly familiar development environment. I have been pondering if I could use the JavaScript VM as a base and wrap it in a Android-Java application and fill in the extra features needed, but I fear this is somewhat beyond my skills at the moment.

4) Native binaries with bridging app. Take the native binaries from 2) and write a small SSH server app like in 4) that proves ConnectBot access to them on a local connection. Fairly minimal work once the native binaries are ready. I hope.

I keep wondering of anyone else has thought about this yet or better yet got a working solution, but I guess hardware like this are still fairly rare no not many have the inspiration to do the work. I am sure it will come at some point, I am just impatient. :)