Subject: Re: problem with git clone on cygwin

From: "Shawn O. Pearce" <[email-masked]>
Date: Sun, 7 Jan 2007 01:00:08 -0500

"Stefan-W. Hahn" <[email-masked]> wrote:
> 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.