Search code examples
msysgit

msysgit large installation size


I installed (extracted) msysgit portable (PortableGit-1.9.5-preview20150319.7z)

The compressed archive is 23 MB, but once extracted the contents take up 262 MB. This is mostly due to the git command binaries (under 'libexec\git-core'). Almost all of the binaries are identical, they just have different names.

Why did the developers build the project like this? I suppose they need an executable for each command to support the CLI on windows cmd.exe.

But isn't there a way to avoid having ~100 identical binaries, each 1.5 MB in size (ex: using batch files)?


Solution

  • Why did the developers build the project like this? I suppose they need an executable for each command to support the CLI on windows cmd.exe.

    Under unixoid OSes, you can have symbolic links to another file that behave exactly like the original file; if you do that for your executable, your executable can look into argv[0] to find out how it was called. That's a very common trick for many programs.

    Under Windows, and especially without installers, it's (to my knowledge) impossible to get the same behaviour out of your file system -- there's just no symbolic link equivalent. Especially when you consider that programs that are meant to run from USB drives have to cope with ancient filesystems such as FAT32!

    Thus, the executables simply were copied over. Same functionality, more storage. However, on a modern machine that you'd run windows on, you really don't care about 200MB give or take for such a versatile tool such as git.

    In conclusion: the developers had no choice here; since windows (though having some posix abstraction layer) has no proper filesystem support for symbolic links, that was the only good way to port this unix-originating program. You either shouldn't care or use an OS that behaves better in that respect. I'd recommend the latter, but OS choices often aren't made freely...