git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] git-count-objects: Fix a disk-space under-estimate on Cygwin

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Nov 20, 2009, 23:27 UTC
Message-ID
<4B0725CF.8030805@ramsay1.demon.co.uk>

On Cygwin, the st_blocks field in 'struct stat' counts in blocks of st_blksize bytes. At least on NTFS, the st_blksize field is not 512 bytes, as required by the code, which leads to an under estimate of the disk-space used.

Setting the build variable NO_ST_BLOCKS_IN_STRUCT_STAT, switches to an algorithm that only uses the st_size field to compute the disk-space estimate.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Changed since v1:
    - a commit message!
    - removed comment.

ATB, Ramsay Jones

 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index 5d5976f..8902dba 100644
--- a/Makefile
+++ b/Makefile
@@ -783,6 +783,7 @@ ifeq ($(uname_O),Cygwin)
 	NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
 	NO_TRUSTABLE_FILEMODE = UnfortunatelyYes
 	OLD_ICONV = UnfortunatelyYes
+	NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
 	# There are conflicting reports about this.
 	# On some boxes NO_MMAP is needed, and not so elsewhere.
 	# Try commenting this out if you suspect MMAP is more efficient
-- 
1.6.5
Message 1 of 1 in “git-count-objects: Fix a disk-space under-estimate on Cygwin”
  1. git-count-objects: Fix a disk-space under-estimate on CygwinRamsay Jones, Nov 20, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.