git-svn on Windows (cygwin)

Update 2008-10-10: Often perl will not work due to memory-remapping problems. A solution can be found in my article about the issue.

What I really love about Git is the fact that it nicely integrates with existing Subversion repositories. At our company, we are using Subversion as our SCM, but I personally like Git more and I want to use it as a side tool for more flexible branching, merging, and for checking in versions I wouldn’t check in the shared repository.

Git is supplied with git-svn, which can import an existing SVN repository and also commit back to it. Under cygwin, you need to perform two additional steps for getting git-svn to work, otherwise it is likely to fail with “failed to include Error.pm”.

You need to download Error.pm from CPAN. You have to save it to <cygwin-dir>\lib\perl5\Error.pm

Voila! git-svn should work now.

Waiting for WLAN and UMTS for OpenMoko

I am currently thinking a lot about the OpenMoko project. Unfortunately OpenMoko at the moment provides hardware which is limited to GPRS, Bluetooth, and/or USB 1.0 for connectivity. In autumn there should be the next generation which should include a WLAN (and maybe even UMTS?) support. It will be called Neo 1973 – GTA02.

Together with Austrian-based one “H.U.I. Starter” rate (250MB @ UMTS, reduction to 56kBit/s above, 10€/month) this would be a nice package. However, if I could have UMTS, well, that would be better. Personally, WLAN is even more important for me, I could use it in the office or in my home, where I have WLAN access available and fall back to GPRS while being “on the road”.

For me this means: standby for autumn, because I can’t afford to invest US-$300 now and another US-$450 in a couple of month. Still, I am really, really interested in OpenMoko (and normally I wouldn’t invest that amount of money into a hobby of mine). Which means, I am standing by and waiting for news from the OpenMoko community…

In the meantime, if you understand German, you could listen to this very interesting Chaosradio Express Podcast.

On YouTube there are some very interesting videos about the Neo 1973.

Git on Windows: “You have some suspicious patch lines”

Update 2008-04-24: as commenter Jakub Narebski correctly points out, it should be better to use core.autocrlf and crlf attribute for resolving this issue, but I have had no chance to test this up to now. The solution below is still valid, but more of the sort of an ugly hack.
Update 2008-06-11: I have stopped using this solution and only use “git-config core.autocrlf true” and “git-config core.safecrlf true” any more. It works reliably and is exactly what I need and not such an ugly hack.
Update 2008-06-22: Well, of course you can still get “You have some suspicious patch lines” if you follow the core.autocrlf approach… but this time it really means you have trailing whitespace, not just line-breaks. If you really don’t care about trailing white-space at all, my initial solution is still valid, as it simply disables this check.

If you are using Git under Windows using cygwin, and you got through the initial problems, you will soon realize that Git likes to fail with “You have some suspicious patch lines” when committing.

The cause for this problem is the carriage-return/line-feed problem of Git under Windows/cygwin: The patches contain a trailing line-feed if you edited them with a Windows editor and not strictly inside cygwin. This will trigger the pre-commit hook to fail on patches where the last line of a file has been changed.

To solve the problem, you need to edit .git/hooks/pre-commit and comment out the following lines:

if (/\s$/) {
bad_line("trailing whitespace", $_);
}

Now committing should work.

OpenMoko – the Open Mobile Phone

This is cool! If you want to have a mobile phone based on Linux and pure OpenSource software, OpenMoko might be the right thing for you! I’m not so much in mobile development, but I find this almost more appealing than the iPhone, which at the moment is a very closed platform. If I find some time for a hobby like this, this US-$ 300 would be a nice investment. I hope this becomes a success to reward the company and the idea to explictly invite hackers/developers (both software & hardware) to improve a phone. A nice contrast to the usual anti-reverse-engineering and “hacking” philosophy most companies go along with.

Edit 2007-07-18: I accidentially misspelled OpenMoko as OpenMonko in the inital release, both in the title and in the text. I corrected this and the URL of the article to reflect the real name of the project: OpenMoko.

Git and Windows Vista

I recently started using Git, the version control system now used for developing the Linux Kernel. While there is no native support for Windows at the moment, you can install it using cygwin. While this works reasonably well in Windows XP, I got into severe troubles when trying the same in Windows Vista.

First, I ran into troubles installing cygwin. I figured out, that it seems to work well if you run both the installer and bash in “Windows XP SP2 compatibility mode”. I needed to adjust the file system permissions of the cygwin folder to give me write permissions, though. (Note: you have to manually install the TK-libs if you want the GUI elements of git to work.)

But Git kept failing with “access denied” messages when trying to commit from command line. The failure message said it was denied access to git-update-index. I soon found out this is due to the “User Account Control” (UAC) default behavior of auto-detecting installers and prompting if you want to execute them with raised privileges. You can see if this is the case by running git-update-index manually from bash; if you get the UAC confirmation dialog you have this problem. It seems the substring “update” triggers this behavior. As the git-update-index is launched by git commit, it won’t display the confirmation dialog of Vista, so the execution will be denied.

There are two possible workarounds:

  • Run bash with administrative privileges (not recommended!)
  • Disable the auto-detection of installers by UAC.

I used the latter way. You can disable the auto-detection by following these instructions. Brief summary:

  • Open the Local Security Policies
  • Disable “User Account Control: Detect application installations and prompt for elevation”
  • Reboot (the security policy will not be updated before!)

It should work now. You can confirm this by running git-update-index manually again. If you do not get the UAC confirmation dialog now, it worked. Try git commit now, and verify it is working. Of course, you will from now on have to right-click and “Run as Administrator” every installer you want to install, as most installers will require administrative privileges.

Update 2007-08-22: Reader EGarcia posted an interesting comment below: using the Microsoft Manifest Tool you can add an according manifest to the git-update-index.exe and git-update-ref.exe

Update 2009-02-12: Reader Kevin Broadey points out the best solution so far: create a seperate .manifest file for the affected files. He has provided an example for git-update.exe.manifest.

Organize Your Ideas and Thoughts with wikidPad

wikidPad is one of the very few applications I recently got really enthusiastic about. It is a single-user desktop wiki, written in Python. It is really fast to use and you can write down your ideas, organize your information and much, much more. This is the way I want a Wiki to work!

I got so enthusiastic about it that I am currently writing anything down inside it, organizing my contact data, appointments, schedules, etc. Together with this great Getting-Things-Done extension, I am really, really happy that I finally found a way to organize my thoughts, ideas, and TODOs. It all is becoming to make more and more sense now 😉

I am so addicted to the system that I installed the whole application inside my shared data environment. I am using the old style file format, where every page is stored as a .wiki file, which makes synchronization using Unison very fast and easy, and additionally allowing (limited) conflict handling.

While still being a Python application, wikidPad was written for Windows and got Linux support added later during development, after wikidPad itself became OpenSource. At the moment, I find the Linux version being too buggy for my everyday use, so I use wine to run wikidPad there.

Sharing and Synchronizing Data Across Multiple Computers

I have several computers, one at the office (Windows Vista), one at home (Gentoo Linux), and one notebook (Windows XP). On most of them I want to share a common set of files, including letters and other documents, but also Miranda. This time I am going to tell you how I keep my shared data in sync using Unison, PuTTY, and OpenSSH, using a dedicated server as central hub.

(Note: this is a rather advisory level HOWTO, not a step-by-step, command-by-command tutorial. It might give you some ideas nevertheless.)

Continue reading “Sharing and Synchronizing Data Across Multiple Computers”

Life at Google

Interesting mail supposed to be from an internal mailing list of Microsoft about life at Google compared to Microsoft. Despite the discouraging blog title (“Just say ‘No’ to Google”) the published e-mail is rather balanced in my opinion. It just gives interesting insight in the work life at Google and Microsoft.

(Disclaimer: the whole thing could be a fake, I don’t know. But I suppose this to be true, it is no Google-bashing. Given the fact that it publishes an internal e-mail from Microsoft, I don’t know how long it will stay online.)

In the comments there are other major-companies work-life experience blog entries linked:

Ubuntu 7.04 cryptsetup problem

I am using cryptsetup LUKS for storing encrypted office data on my USB memory stick (just in case I lose it). I recently installed Ubuntu 7.04 on one of my machines and wanted to open the encrypted partition using cryptsetup luksOpen, which failed with a rather strange

Unable to make device node for ‘temporary-cryptsetup-32733’

While searching around the net I found a lot of people asking the same question but hardly any answer, until I finally read this article
on the Ubuntu forum.

The solution to the whole problem is rather simple:

sudo mkdir /dev/.static/dev/mapper

With a little bit more verbose error message of cryptsetup I might have figured this out myself…

Google Shared Items

Inspired by erik (once more), I started to share some interesting items from Google Reader. I also included the shared items in the sidebar of this blog (this feature requires JavaScript to be turned on on your browser). As I am reading mixed English and German feeds, there sometimes can be German items too. (In fact, when posting this, there is only one shared item and it is German…)

You can browse the Shared Items Page or even subscribe the RSS feed.