Date: 2009-11-12 07:59:00
git on windows
Git is mostly written in C, with some important parts in shell and Perl. This works well on Unix-like platforms, but unfortunately suffers on Windows because there is no native Windows (Bourne) shell. Git can be built under the Cygwin environment, but that is a heavyweight solution and Cygwin is not appropriate for general use. msysgit builds a native Windows executable plus uses the msys shell implementation, which provides a workable solution, but still requires Git operations to be done within the msys shell and not the native Windows command shell.

I had a thought the other day, that one could implement a Bourne shell interpreter in a more widely available language such as Python. This would provide a more widely portable option for using Git, and on Windows in particular. Such a shell implementation would provide the minimum implementation necessary to run Git's shell scripts (and which would include minimal implementations of various utitilies such as grep, sed, and awk). That wouldn't solve the Perl script problem, so it seems obvious that a portable shell interpreter designed for use with Git should be written in Perl.

A long time ago there was the Perl Power Tools project, which aimed to provide implementations of various Unix utilities in native Perl. Unfortunately, nobody ever submitted an implementation for sh. Is there any existing implementation of a Bourne-like shell in Perl? More generally, is this a viable plan to make Git work better on Windows?

Update: See the next post to find out just how far I got with this.
Not an answer to you, but I just started using git and github for a cross platform project, and damn that CRLF to LF problem coming in from Windows sucks when you're not expecting it.
Indeed it does. Although Git seems to try hard, it doesn't seem to quite agree with Windows on how to make the line endings work properly.

I would be inclined to try setting the Git options to never try to change line endings at all, and see if that works better.
I think we're on top of it now. Unfortunately, windows editors aren't happy leaving well enough alone, so we end up getting way more changes from and after a commit from windows than we want. I think the autocrlf behavior is fine, but we need to have one round of OMIGODEVERYTHINGINTHEPLANETCHANGED!
Greg Hewgill <>