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

Re: problem with git clone on cygwin

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jan 7, 2007, 06:00 UTC
Message-ID
<20070107060007.GA10351@spearce.org>
In-Reply-To
<20070106170330.GA8041@scotty.home>
"Stefan-W. Hahn" <stefan.hahn@s-hahn.de> wrote:
Show 5 quoted lines
> running git on Cygwin I have a problem with git clone on local disk,
> while packing data. 
> 
> The problem comes with v1.5.0-rc0. I bisected the problem down to
> commit 6d2fa7 as the first bad commit.
That was a performance improvement for Mac OS X to reduce the
index-pack time on linux.git from almost an hour to about 1 minute.
 
> It seems to be a problem with cygwin.dll prior v1.5.22 and pread(), if
> using an offset!=0. (I'm running cygwin.dll v1.5.21 build date
> 2006-07-27 and I can't update because of other compatibility problems).
Why can't you upgrade Cygwin?
 
> So I tried:
> - not to set NO_MMAP to use real mmap
FYI: you can "unset" NO_MMAP at compile time:
  make NO_MMAP=
or by putting it into your personal config.mak:
  echo NO_MMAP= >config.mak
  make

this way you always build with the real mmap, but don't need to locally patch Makefile.

> - changing get_data_from_pack() from index-pack.c to used mmap() as
>   in 042aea8. (I did this because it directly uses pread().)
> This solved the problem for my testcase.

This isn't ideal because of the performance problems that some OSes have with small but frequent mmap() calls.

Perhaps we should add our own fake pread (aka git_pread) to git-compat-util.h and provide a NO_PREAD option in the Makefile? Though I don't think its really worth it, as pretty much every OS we run on should have a functioning pread call. Except some Cygwins apparently.

-- 
Shawn.
Previous: Juergen RuehleNext: Stefan-W. Hahn
Message 3 of 12 in “problem with git clone on cygwin”
  1. Stefan-W. HahnJan 6, 2007
  2. Juergen RuehleJan 6, 2007
  3. Shawn O. PearceJan 7, 2007
  4. Replacing the system call pread() with real mmap().Stefan-W. Hahn, Jan 7, 2007
  5. Shawn O. PearceJan 7, 2007
  6. Stefan-W. HahnJan 7, 2007
  7. Johannes SchindelinJan 7, 2007
  8. Stefan-W. HahnJan 7, 2007
  9. Test for failing pread() on cygwin.Stefan-W. Hahn, Jan 7, 2007
  10. Stefan-W. HahnJan 7, 2007
  11. Juergen RuehleJan 7, 2007
  12. Stefan-W. HahnJan 7, 2007

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.