Version Control Software

Chris “Kwpolska” Warrick kwpolska at gmail.com
Sun Jun 16 09:30:05 EDT 2013


On Sun, Jun 16, 2013 at 1:14 AM, Chris Angelico <rosuav at gmail.com> wrote:
> Hmm. ~/cpython/.hg is 200MB+, but ~/pike/.git is only 86MB. Does
> Mercurial compress its content? A tar.gz of each comes down, but only
> to ~170MB and ~75MB respectively, so I'm guessing the bulk of it is
> already compressed. But 200MB for cpython seems like a lot.

Next time, do a more fair comparison.

I created an empty git and hg repository, and created a file promptly
named “file” with DIGIT ONE (0x31; UTF-8/ASCII–encoded) and commited
it with “c1” as the message, then I turned it into “12” and commited
as “c2” and did this one more time, making the file “123” at commit
named “c3”.

[kwpolska at kwpolska-lin .hg at default]% cat * */* */*/* 2>/dev/null | wc -c
1481
[kwpolska at kwpolska-lin .git at master]% cat * */* */*/* */*/*/* 2>/dev/null | wc -c
16860 ← WRONG!

There is just one problem with this: an empty git repository starts at
15216 bytes, due to some sample hooks.  Let’s remove them and try
again:

[kwpolska at kwpolska-lin .git at master]% rm hooks/*
[kwpolska at kwpolska-lin .git at master]% cat * */* */*/* */*/*/* */*/*/*
2>/dev/null | wc -c
2499

which is a much more sane number.  This includes a config file (in the
ini/configparser format) and such.  According to my maths skils (or
rather zsh’s skills), new commits are responsible for 1644 bytes in
the git repo and 1391 bytes in the hg repo.

(I’m using wc -c to count the bytes in all files there are.  du is
unaccurate with files smaller than 4096 bytes.)

--
Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
stop html mail                | always bottom-post
http://asciiribbon.org        | http://caliburn.nl/topposting.html



More information about the Python-list mailing list