1. 08 2月, 2011 1 次提交
  2. 24 11月, 2010 1 次提交
    • E
      win32: use our own dirent.h · d1b6e6e0
      Erik Faye-Lund 提交于
      The mingw-runtime implemenation of opendir, readdir and closedir
      sets errno to 0 on success, something that POSIX explicitly
      forbids. 3ba7a065 ("A loose object is not corrupt if it cannot be
      read due to EMFILE") introduce a dependency on this behaviour,
      leading to a broken "git clone" on Windows.
      
      compat/mingw.c contains an implementation of readdir, and
      compat/msvc.c contains implementations of opendir and closedir.
      
      Move these to compat/win32/dirent.[ch], and change to our own DIR
      structure at the same time.
      
      This provides a generic Win32-implementation of opendir, readdir
      and closedir which works on both MinGW and MSVC and does not reset
      errno, and as a result git clone is working again on Windows.
      Signed-off-by: NErik Faye-Lund <kusmabite@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d1b6e6e0
  3. 05 11月, 2010 5 次提交
  4. 14 10月, 2010 1 次提交
  5. 04 10月, 2010 2 次提交
  6. 02 10月, 2010 3 次提交
  7. 21 5月, 2010 2 次提交
  8. 12 4月, 2010 1 次提交
  9. 07 3月, 2010 1 次提交
  10. 26 2月, 2010 1 次提交
  11. 17 1月, 2010 3 次提交
    • A
      MSVC: Windows-native implementation for subset of Pthreads API · 44626dc7
      Andrzej K. Haczewski 提交于
      This patch implements native to Windows subset of pthreads API used by Git.
      It allows to remove Pthreads for Win32 dependency for MSVC, msysgit and
      Cygwin.
      
      [J6t: If the MinGW build was built as part of the msysgit build
      environment, then threading was already enabled because the
      pthreads-win32 package is available in msysgit. With this patch, we can now
      enable threaded code unconditionally.]
      Signed-off-by: NAndrzej K. Haczewski <ahaczewski@gmail.com>
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      44626dc7
    • R
      MSVC: Fix an "incompatible pointer types" compiler warning · b6f714f8
      Ramsay Jones 提交于
      In particular, the following warning is issued while compiling
      compat/msvc.c:
      
          ...mingw.c(223) : warning C4133: 'function' : incompatible \
      types - from '_stati64 *' to '_stat64 *'
      
      which relates to a call of _fstati64() in the mingw_fstat()
      function definition.
      
      This is caused by various layers of macro magic and attempts to
      avoid macro redefinition compiler warnings. For example, the call
      to _fstati64() mentioned above is actually a call to _fstat64(),
      and expects a pointer to a struct _stat64 rather than the struct
      _stati64 which is passed to mingw_fstat().
      
      The definition of struct _stati64 given in compat/msvc.h had the
      same "shape" as the definition of struct _stat64, so the call to
      _fstat64() does not actually cause any runtime errors, but the
      structure types are indeed incompatible.
      
      In order to avoid the compiler warning, we add declarations for the
      mingw_lstat() and mingw_fstat() functions and supporting macros to
      msvc.h, suppressing the corresponding declarations in mingw.h, so
      that we can use the appropriate structure type (and function) names
      from the msvc headers.
      Signed-off-by: NRamsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b6f714f8
    • J
      Windows: avoid the "dup dance" when spawning a child process · 75301f90
      Johannes Sixt 提交于
      When stdin, stdout, or stderr must be redirected for a child process that
      on Windows is spawned using one of the spawn() functions of Microsoft's
      C runtime, then there is no choice other than to
      
      1. make a backup copy of fd 0,1,2 with dup
      2. dup2 the redirection source fd into 0,1,2
      3. spawn
      4. dup2 the backup back into 0,1,2
      5. close the backup copy and the redirection source
      
      We used this idiom as well -- but we are not using the spawn() functions
      anymore!
      
      Instead, we have our own implementation. We had hardcoded that stdin,
      stdout, and stderr of the child process were inherited from the parent's
      fds 0, 1, and 2. But we can actually specify any fd.
      
      With this patch, the fds to inherit are passed from start_command()'s
      WIN32 section to our spawn implementation. This way, we can avoid the
      backup copies of the fds.
      
      The backup copies were a bug waiting to surface: The OS handles underlying
      the dup()ed fds were inherited by the child process (but were not
      associated with a file descriptor in the child). Consequently, the file or
      pipe represented by the OS handle remained open even after the backup copy
      was closed in the parent process until the child exited.
      
      Since our implementation of pipe() creates non-inheritable OS handles, we
      still dup() file descriptors in start_command() because dup() happens to
      create inheritable duplicates. (A nice side effect is that the fd cleanup
      in start_command is the same for Windows and Unix and remains unchanged.)
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      75301f90
  12. 24 11月, 2009 1 次提交
  13. 09 11月, 2009 1 次提交
  14. 20 10月, 2009 1 次提交
  15. 19 9月, 2009 2 次提交
  16. 12 9月, 2009 1 次提交
  17. 06 7月, 2009 2 次提交
  18. 01 6月, 2009 1 次提交
    • M
      MinGW readdir reimplementation to support d_type · e16c60d9
      Marius Storm-Olsen 提交于
      The original readdir implementation was fast, but didn't
      support the d_type. This means that git would do additional
      lstats for each entry, to figure out if the entry was a
      directory or not. This unneedingly slowed down many
      operations, since Windows API provides this information
      directly when walking the directories.
      
      By running this implementation on Moe's repo structure:
        mkdir bummer && cd bummer; for ((i=0;i<100;i++)); do
          mkdir $i && pushd $i;
            for ((j=0;j<1000;j++)); do echo "$j" >$j; done;
          popd;
        done
      
      We see the following speedups:
        git add .
        -------------------
        old: 00:00:23(.087)
        new: 00:00:21(.512) 1.07x
      
        git status
        -------------------
        old: 00:00:03(.306)
        new: 00:00:01(.684) 1.96x
      
        git clean -dxf
        -------------------
        old: 00:00:01(.918)
        new: 00:00:00(.295) 6.50x
      Signed-off-by: NMarius Storm-Olsen <marius@trolltech.com>
      Signed-off-by: NSteffen Prohaska <prohaska@zib.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e16c60d9
  19. 23 5月, 2009 2 次提交
  20. 19 3月, 2009 1 次提交
    • J
      MinGW: implement mmap · b130a72b
      Janos Laube 提交于
      Add USE_WIN32_MMAP which triggers the use of windows' native
      file memory mapping functionality in git_mmap()/git_munmap() functions.
      
      As git functions currently use mmap with MAP_PRIVATE set only, this
      implementation supports only that mode for now.
      
      On Windows, offsets for memory mapped files need to match the allocation
      granularity. Take this into account when calculating the packed git-
      windowsize and file offsets. At the moment, the only function which makes
      use of offsets in conjunction with mmap is use_pack() in sha1-file.c.
      
      Git fast-import's code path tries to map a portion of the temporary
      packfile that exceeds the current filesize, i.e. offset+length is
      greater than the filesize. The NO_MMAP code worked with that since pread()
      just reads the file content until EOF and returns gracefully, while
      MapViewOfFile() aborts the mapping and returns 'Access Denied'.
      Working around that by determining the filesize and adjusting the length
      parameter.
      Signed-off-by: NJanos Laube <janos.dev@gmail.com>
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b130a72b
  21. 18 3月, 2009 1 次提交
  22. 08 3月, 2009 1 次提交
  23. 06 3月, 2009 1 次提交
    • J
      MinGW: 64-bit file offsets · 1d4e4cd4
      Johannes Schindelin 提交于
      The type 'off_t' should be used everywhere so that the bit-depth of that
      type can be adjusted in the standard C library, and you just need to
      recompile your program to benefit from the extended precision.
      
      Only that it was not done that way in the MS runtime library.
      
      This patch reroutes off_t to off64_t and provides the other necessary
      changes so that finally, clones larger than 2 gigabyte work on Windows
      (provided you are on a file system that allows files larger than 2gb).
      
      Initial patch by Sickboy <sb@dev-heaven.net>.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Acked-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1d4e4cd4
  24. 22 1月, 2009 1 次提交
  25. 19 8月, 2008 2 次提交
  26. 04 8月, 2008 1 次提交