Re: [PATCH] Avoid using dc in git-count-objects
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 26, 2005, 14:44 UTC
- Message-ID
- <Pine.LNX.4.63.0510261637070.26622@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <435F4B05.4010702@op5.se>
Hi,
On Wed, 26 Oct 2005, Andreas Ericsson wrote:
> I'd be more worried about the fact that the kilobytes count is way off > as it is. du (at least from coreutils-5.2.1) rounds up to nearest > kilobyte *for each file* when printing kb-count.
The rationale behind this: You want to know how much space it takes on your hard disk. Remember, git-count-objects should give you a clue whether to repack or not.
Actually, "du -k" in my tests rounds up to nearest block size or kilobytes (whichever is greater): For example, "du -k" on a very small file (53 bytes) says "1" on an ext2fs yields "1", "4" on hfs, and 32 on a big FAT32. Of course, you may get different values, since the block sizes sometimes depend on the total size of the media.
Hth, Dscho