git’s Object Store Efficiency
Hubert Feyrer posted, Musing about git’s object store efficiency yesterday. In it he compared the apparent efficiency of git’s object store to CVS’s stacked patches. His methodology was to checkout all 963 versions of the NetBSD i386 GENERIC kernel configuration file and then sum up the space used. He comes to the following conclusion:
the git model requires about 37 times the space that CVS does
and:
that’s not counting the overhead of 962 inodes and the related directory bookkeeping
He finishes off with an acknowledgement that git has data packing features:
I know that git offers some more efficient storage methods via “pack” files, but investigating those is left as an exercise to the reader.
I generally enjoy Hubert’s posts but as a daily user of git this one didn’t sit right with me. I thought I’d take up the aforementioned exercise.
Clone git Repo on Non-Standard Port
I use an SSH tunnel to access my computer at work from home. On occasion I want to clone a git repo that is on the remote server. To do so its necessary to specify the port, which doesn’t work with the conventional clone syntax.
E.g. git clone hostname:path/to/repo. The solution is to be a little more specific:
git clone ssh://localhost:2222/~username/path/to/repo
Bash Git Completion with Mac Ports
Git comes with bash completion support which comes in handy for completing branch names and things like that. To get this support when installing git via Mac Ports you must add the bash_completion variant. You’ll also want to install the bash_completion port. After that you need to add the following to your ~/.bashrc file:
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
For reference I have the folloowing Git related config in my .bashrc: