src/win32


Log

Author Commit Date CI Message
Russell Belfer a8122b5d 2012-11-21T15:39:03 Fix warnings on Win64 build
Ben Straub 54b2a37a 2012-11-20T16:02:25 Clean up config.h
Eduardo Bart cf0dadcf 2012-11-20T01:19:31 Minor optimization in win32 do_lstat
Eduardo Bart 2d96fce2 2012-11-19T23:12:20 update win32 lstat comment
Eduardo Bart 52ead787 2012-11-19T22:30:20 Fix win32 lstat
Russell Belfer cccacac5 2012-11-14T22:41:51 Add POSIX compat lstat() variant for win32 The existing p_lstat implementation on win32 is not quite POSIX compliant when setting errno to ENOTDIR. This adds an option to make is be compliant so that code (such as checkout) that cares to have separate behavior for ENOTDIR can use it portably. This also contains a couple of other minor cleanups in the posix_w32.c implementations to avoid unnecessary work.
Eduardo Bart 345eef23 2012-11-07T16:10:57 Move inet_pton to posix platform-compatibility layer
Philip Kelley b4491b99 2012-10-16T16:18:21 Incremental improvements to pack-objects logic Incorporate feedback for incr. improvements to pack-objects
Philip Kelley 5e4f2b5f 2012-10-16T13:18:45 Support pthread_cond_* on Win32
Vicent Martí 52748f7b 2012-10-16T08:36:55 Merge pull request #952 from csware/config-locations Config location fixes
Russell Belfer 824d5e4d 2012-10-11T11:58:00 Always use internal fnmatch, not system
Sven Strickroth 997579be 2012-10-02T17:55:29 Move win32 specific stuff to win32/findfile.c Signed-off-by: Sven Strickroth <email@cs-ware.de>
nulltoken 9ac8b113 2012-09-20T14:06:49 Fix MSVC amd64 compilation warnings
Vicent Marti 0f4c6175 2012-08-28T22:19:08 Add bounds checking to UTF-8 conversion
Vicent Marti 6813169a 2012-08-06T12:45:59 windows: Keep UTF-8 on the stack yo
Vicent Martí 3b73a034 2012-04-25T16:26:12 UTF-8 changes yo
Russell Belfer e9ca852e 2012-08-23T09:20:17 Fix warnings and merge issues on Win64
Russell Belfer ca1b6e54 2012-07-31T17:02:54 Add template dir and set gid to repo init This extends git_repository_init_ext further with support for initializing the repository from an external template directory and with support for the "create shared" type flags that make a set GID repository directory. This also adds tests for much of the new functionality to the existing `repo/init.c` test suite. Also, this adds a bunch of new utility functions including a very general purpose `git_futils_mkdir` (with the ability to make paths and to chmod the paths post-creation) and a file tree copying function `git_futils_cp_r`. Also, this includes some new path functions that were useful to keep the code simple.
Vicent Martí f98c32f3 2012-08-19T01:26:06 Merge pull request #778 from ben/clone Clone
Carlos Martín Nieto d96c3863 2012-08-02T01:56:02 win32: set errno to ENOENT or ENOTDIR when appropriate in do_lstat
Ben Straub 8651c10f 2012-07-17T19:57:37 Checkout: obey core.symlinks.
Ben Straub bfc65634 2012-07-17T08:08:34 Merge branch 'development' into clone
Ben Straub 1d68fcd0 2012-07-16T16:16:11 Checkout: handle symlinks. Includes unfinished win32 implementation.
liyuray dfa0b65c 2012-06-21T20:17:54 fix below issues on mingw: 1. compile warning: D:\libgit2.git\src\win32\posix_w32.c: In function 'p_open': D:\libgit2.git\src\win32\posix_w32.c:235:10: warning: 'mode_t' is promoted to 'int' when passed through '...' [enabled by default] D:\libgit2.git\src\win32\posix_w32.c:235:10: note: (so you should pass 'int' not 'mode_t' to 'va_arg') D:\libgit2.git\src\win32\posix_w32.c:235:10: note: if this code is reached, the program will abort 2. test crash. 3. the above two issues are same root cause. please see http://www.eskimo.com/~scs/cclass/int/sx11c.html
Ben Straub 73aaf674 2012-06-13T14:22:33 Precompile headers for MSVC.
Vicent Martí 3f035860 2012-06-07T22:43:03 misc: Fix warnings from PVS Studio trial
Vicent Martí b9ebcc59 2012-06-07T12:29:31 Merge pull request #684 from benstraub/rev-parse Rev parse
Ben Straub 9ecf860d 2012-06-06T13:24:25 Rename posix wrappers with 'p_' prefix.
Ben Straub 56a5000d 2012-06-05T12:52:44 Merge branch 'development' into rev-parse Conflicts: src/util.h tests-clar/refs/branches/listall.c
nulltoken fac66990 2012-06-05T13:56:44 repository: make git_repository_init() value the core.filemode config entry
Russell Belfer 9e35d7fd 2012-05-24T13:44:24 Fix bugs in UTF-8 <-> UTF-16 conversion The function to convert UTF-16 to UTF-8 was only allocating a buffer of wcslen(utf16str) bytes for the UTF-8 string, but that is not sufficient if you have multibyte characters, and so when those occured, the conversion was failing. This updates the conversion functions to use the Win APIs to calculate the correct buffer lengths. Also fixes a comparison in the unit tests that would fail if you did not have a particular environment variable set.
Ben Straub 1ce4cc01 2012-05-15T15:41:05 Fix date.c build in msvc. Ported the win32 implementations of gmtime_r, localtime_r, and gettimeofday to be part of the posix compatibility layer, and fixed git_signature_now to use them.
Scott J. Goldman ec42eafd 2012-05-09T22:30:57 Hook up Windows compat fnmatch() for Solaris Since Solaris does not support some of the same flags as glibc fnmatch(), we just use the implementation we have for Windows. Now that it's no longer a windows-specific thing, I moved it into compat/ instead of win32/
nulltoken 9abb5bca 2012-05-07T13:58:01 compat: make p_realpath Windows implementation be a bit more POSIX compliant and fail if the provided path does not lead to an existing entry
nulltoken 3191ae89 2012-05-06T13:04:12 compat: make p_open able to accept optional mode when passing the O_CREAT flag This has the nice side effect of making test_attr_repo__staging_properly_normalizes_line_endings_according_to_gitattributes_directives() test pass again on Windows. This test started to fail after commit 674a198 was applied.
Vicent Martí cd58c15c 2012-05-05T16:47:20 Merge remote-tracking branch 'scottjg/fix-mingw32' into development Conflicts: src/netops.c src/netops.h src/transports/http.c tests-clar/clar
Scott J. Goldman b47e0a71 2012-05-05T13:52:48 Fix missing prototype warning in utf-conv.c
Russell Belfer 44ef8b1b 2012-04-13T13:00:10 Fix warnings on 64-bit windows builds This fixes all the warnings on win64 except those in deps, which come from the regex code.
Russell Belfer deafee7b 2012-03-14T17:36:15 Continue error conversion This converts blob.c, fileops.c, and all of the win32 files. Also, various minor cleanups throughout the code. Plus, in testing the win32 build, I cleaned up a bunch (although not all) of the warnings with the 64-bit build.
Russell Belfer e3c47510 2012-03-13T14:23:24 Resolve comments from pull request This converts the map validation function into a macro, tweaks the GITERR_OS system error automatic appending, and adds a tentative new error access API and some quick unit tests for both the old and new error APIs.
Russell Belfer e1de726c 2012-03-12T22:55:40 Migrate ODB files to new error handling This migrates odb.c, odb_loose.c, odb_pack.c and pack.c to the new style of error handling. Also got the unix and win32 versions of map.c. There are some minor changes to other files but no others were completely converted. This also contains an update to filebuf so that a zeroed out filebuf will not think that the fd (== 0) is actually open (and inadvertently call close() on fd 0 if cleaned up). Lastly, this was built and tested on win32 and contains a bunch of fixes for the win32 build which was pretty broken.
Vicent Martí cb8a7961 2012-03-07T00:02:55 error-handling: Repository This also includes droping `git_buf_lasterror` because it makes no sense in the new system. Note that in most of the places were it has been dropped, the code needs cleanup. I.e. GIT_ENOMEM is going away, so instead it should return a generic `-1` and obviously not throw anything.
Vicent Martí 60bc2d20 2012-02-14T21:23:11 error-handling: Add new routines Obviously all the old throw routines are still in place, so we can gradually port over.
Russell Belfer 854eccbb 2012-02-29T12:04:59 Clean up GIT_UNUSED macros on all platforms It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5 did not fix the GIT_USUSED behavior on all platforms. This commit walks through and really cleans things up more thoroughly, getting rid of the unnecessary stuff. To remove the use of some GIT_UNUSED, I ended up adding a couple of new iterators for hashtables that allow you to iterator just over keys or just over values. In making this change, I found a bug in the clar tests (where we were doing *count++ but meant to do (*count)++ to increment the value). I fixed that but then found the test failing because it was not really using an empty repo. So, I took some of the code that I wrote for iterator testing and moved it to clar_helpers.c, then made use of that to make it easier to open fixtures on a per test basis even within a single test file.
Russell Belfer 74fa4bfa 2012-02-28T16:14:47 Update diff to use iterators This is a major reorganization of the diff code. This changes the diff functions to use the iterators for traversing the content. This allowed a lot of code to be simplified. Also, this moved the functions relating to outputting a diff into a new file (diff_output.c). This includes a number of other changes - adding utility functions, extending iterators, etc. plus more tests for the diff code. This also takes the example diff.c program much further in terms of emulating git-diff command line options.
Russell Belfer 2705576b 2012-01-24T14:06:42 Simplify GIT_UNUSED macros Since casting to void works to eliminate errors with unused parameters on all platforms, avoid the various special cases. Over time, it will make sense to eliminate the GIT_UNUSED macro completely and just have GIT_UNUSED_ARG.
Russell Belfer 290f240e 2012-02-23T11:16:47 Fix readdir usage across platforms This fixes the missing readdir_r from win32 and fixes other platforms to always use the reentrant readdir_r form for reading directory contents.
schu 5e0de328 2012-02-13T17:10:24 Update Copyright header Signed-off-by: schu <schu-github@schulog.org>
Vicent Martí a53420e4 2012-01-26T17:53:46 msvc: Move `ssize_t` typedef to MSVC-only This is a MSVC-only issue. All other compilers we support work properly.
Russell Belfer 1744fafe 2012-01-17T15:49:47 Move path related functions from fileops to path This takes all of the functions that look up simple data about paths (such as `git_futils_isdir`) and moves them over to path.h (becoming `git_path_isdir`). This leaves fileops.h just with functions that actually manipulate the filesystem or look at the file contents in some way. As part of this, the dir.h header which is really just for win32 support was moved into win32 (with some minor changes).
nulltoken fdc8a7db 2012-01-17T14:06:35 Fix MSVC compilation warning
Carlos Martín Nieto d9e5430e 2012-01-16T11:45:34 Windows: store all 64 bits of the size in the stat structure We force stat to be a stat64 structure, so we can and should put all 64 bits of the size in st_size.
Vincent Lee c6a437ea 2012-01-03T19:44:13 Add missing semicolon
Russell Belfer 73b51450 2011-12-28T23:28:50 Add support for macros and cache flush API. Add support for git attribute macro definitions. Also, add support for cache flush API to clear the attribute file content cache when needed. Additionally, improved the handling of global and system files, making common utility functions in fileops and converting config and attr to both use the common functions. Adds a bunch more tests and fixed some memory leaks. Note that adding macros required me to use refcounted attribute assignment definitions, which complicated, but probably improved memory usage.
nulltoken 489c3666 2011-12-14T20:00:34 posix_w32: prevent segfaulting on Windows when building a temporary filename
Russell Belfer 97769280 2011-11-30T11:27:15 Use git_buf for path storage instead of stack-based buffers This converts virtually all of the places that allocate GIT_PATH_MAX buffers on the stack for manipulating paths to use git_buf objects instead. The patch is pretty careful not to touch the public API for libgit2, so there are a few places that still use GIT_PATH_MAX. This extends and changes some details of the git_buf implementation to add a couple of extra functions and to make error handling easier. This includes serious alterations to all the path.c functions, and several of the fileops.c ones, too. Also, there are a number of new functions that parallel existing ones except that use a git_buf instead of a stack-based buffer (such as git_config_find_global_r that exists alongsize git_config_find_global). This also modifies the win32 version of p_realpath to allocate whatever buffer size is needed to accommodate the realpath instead of hardcoding a GIT_PATH_MAX limit, but that change needs to be tested still.
Carlos Martín Nieto 0c49ec2d 2011-11-07T19:34:24 Implement p_rename Move the callers of git_futils_mv_atomic to use p_rename. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Vicent Martí 89fb8f02 2011-10-28T19:04:23 Merge pull request #456 from brodie/perm-fixes Create objects, indexes, and directories with the right file permissions
Vicent Marti 3286c408 2011-10-28T14:51:13 global: Properly use `git__` memory wrappers Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers.
Vicent Marti 11d51ca6 2011-10-26T16:43:55 windows: Add support for non-UTF codepages Our previous assumption that all paths in Windows are encoded in UTF-8 is rather weak, specially when considering that Git is encoding-agnostic. These set of functions allow the user to change the library's active codepage globally, so it is possible to access paths and files on all international versions of Windows. Note that the default encoding here is UTF-8 because we assume that 99% of all Git repositories will be in UTF-8. Also, if you use non-ascii characters in paths, anywhere, please burn on a fire.
Brodie Rao 33127043 2011-10-14T14:18:02 fileops/posix: replace usage of "int mode" with "mode_t mode" Note: Functions exported from fileops take const mode_t, while the underlying POSIX wrappers take mode_t.
Sven Strickroth cf9bf6b7 2011-10-09T18:45:23 include version information in git2.dll on Windows Signed-off-by: Sven Strickroth <email@cs-ware.de>
Vicent Marti c060854e 2011-10-04T21:11:51 msvc: Properly handle inttypes.h/stdint.h
Vicent Marti 6c8b458d 2011-09-29T17:04:45 mingw: Fix compilation warnings
Vicent Marti 72bdfdbc 2011-09-29T15:24:41 http-parser: Disable MSVC warnings locally
Vicent Marti 5888860d 2011-09-28T23:42:38 msvc: Disable warnings in header file Remove clutter from the CMakeLists file by disabling the warnings programatically.
Vicent Marti 01d7fded 2011-09-22T20:44:30 Revert "Rewrite getenv to use Win32 version on Windows" This reverts commit e1b86444676b70154bf8ab450d429bdef57a8276.
Carlos Martín Nieto dd44887a 2011-09-23T00:00:05 Implment p_access and use it in git_fileutils_exists Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Paul Betts e1b86444 2011-09-21T11:17:30 Rewrite getenv to use Win32 version on Windows
Vicent Marti e3ecf7e9 2011-09-21T14:09:56 Do not have duplicate filenames Two `posix.c` files may or may not break MSVC builds under 2008. Do not have repeated objects. You will need to clean & regenerate CMake.
Paul Betts 6d0ef974 2011-09-19T12:41:27 Fix opendir/readdir and friends on Win32 to use Unicode
Paul Betts 7998ae5a 2011-09-19T12:36:12 Rewrite p_* functions to use Unicode and marshal to UTF8 internally
Paul Betts 222d057c 2011-09-19T10:34:52 Create cross-platform setenv
Vicent Marti 87d9869f 2011-09-19T03:34:49 Tabify everything There were quite a few places were spaces were being used instead of tabs. Try to catch them all. This should hopefully not break anything. Except for `git blame`. Oh well.
Vicent Marti bb742ede 2011-09-19T01:54:32 Cleanup legal data 1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
Vicent Marti c035ede2 2011-08-31T03:45:34 Fix compilation in MinGW
Vicent Marti 2fcf9c82 2011-08-30T11:32:33 posix: Fix undeclared prototype
Vicent Marti f978b748 2011-08-30T13:34:14 compat: Move `mkstemp` to the POSIX compat layer
Vicent Marti 84dd3820 2011-08-18T02:13:51 posix: Properly handle `snprintf` in all platforms
nulltoken ae2e4c6a 2011-07-09T08:41:02 win32: replace usage of _MSV_VER with _MSC_VER
Vicent Marti 2fc78e70 2011-07-08T23:01:37 posix: Portable `vsnprintf` Our good, lovely folks at Microsoft decided that there was no good reason to make `vsnprintf` compilant with the C standard, so that function in Windows returns -1 on overflow, instead of returning the actual byte count needed to write the full string. We now handle this situation more gracefully with the POSIX compatibility layer, by returning the needed byte size using an auxiliary method instead of blindly resizing the target buffer until it fits. This means we can now support `printf`s of any size by allocating a temporary buffer. That's good.
Vicent Marti 1e3300d8 2011-07-06T01:44:15 fnmatch: Fix compilation under Windows
Vicent Marti e9c6571d 2011-07-06T01:04:04 fnmatch: Use native on Unix, emulate on Win32
Vicent Marti 19ac1ed7 2011-07-04T21:33:26 fileops: Fix stat() on directories for W32 The `stat` methods were having issues when called with a trailing slash in Windows platforms. We now use GetFileAttributes() where possible, which doesn't have this restriction.
Vicent Marti 5ad739e8 2011-07-04T20:05:11 fileops: Drop `git_fileops_prettify_path` The old `git_fileops_prettify_path` has been replaced with `git_path_prettify`. This is a much simpler method that uses the OS's `realpath` call to obtain the full path for directories and resolve symlinks. The `realpath` syscall is the original POSIX call in Unix system and an emulated version under Windows using the Windows API.
Vicent Marti f79026b4 2011-07-04T11:43:34 fileops: Cleanup Cleaned up the structure of the whole OS-abstraction layer. fileops.c now contains a set of utility methods for file management used by the library. These are abstractions on top of the original POSIX calls. There's a new file called `posix.c` that contains emulations/reimplementations of all the POSIX calls the library uses. These are prefixed with `p_`. There's a specific posix file for each platform (win32 and unix). All the path-related methods have been moved from `utils.c` to `path.c` and have their own prefix.
Vicent Marti 678e9e04 2011-07-03T13:33:43 build: Move OS-specific compat to their own folders
Jakob Pfender a6d647d2 2011-05-19T15:37:10 win32/pthread.c: Move to new error handling mechanism
Jakob Pfender 7c8b597e 2011-05-19T15:36:09 win32/map.c: Move to new error handling mechanism
kelly.leahy 16a5c304 2011-05-08T12:32:35 Fix bug in the way pthead_mutex_t was being destroyed in win32. Win32 critical section objects (CRITICAL_SECTION) are not kernel objects. Only kernel objects are destroyed by using CloseHandle. Critical sections are supposed to be deleted with the DeleteCriticalSection API (http://msdn.microsoft.com/en-us/library/ms682552(VS.85).aspx).
Vicent Marti bb3de0c4 2011-03-16T21:35:51 Thread safe cache
Vicent Marti bbcc7ffc 2011-03-15T21:04:41 Add proper threading support to libgit2 We now depend on libpthread on all Unix platforms (should be installed by default) and use a simple wrapper for Windows threads under Win32. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Alex Budovski f0bde7fa 2011-01-11T16:07:45 Revised platform types to use 'best supported' size. This will allow graceful migration to 64 bit file sizes and timestamps should git's binary interface be extended to allow this.
Ramsay Jones e97179b6 2010-01-13T20:01:11 win32: Add a 'git__' prefix to the directory reading routines This reduces the global namespace pollution and allows for a win32 compiler (eg. Open Watcom) to provide these routines in a header other than <dirent.h> (eg in <io.h>). Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Ramsay Jones 90d4d2f0 2010-01-11T19:27:50 win32: Use an 64-bit file offset type Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Ramsay Jones c79dded3 2009-06-14T22:13:35 win32: Add an fsync() implementation for windows For information on FlushFileBuffers(), see the msdn document at msdn.microsoft.com/en-us/library/aa364439(VS.85).aspx Note that Windows 2000 is shown as the minimum windows version to support FlushFileBuffers(), so if we wish to support Win9X and NT4, we will need to add code to dynamically check if kernel32.dll contains the function. The only error return mentioned in the msdn document is ERROR_INVALID_HANDLE, which is returned if the file/device (eg console) is not buffered. The fsync(2) manpage says that EINVAL is returned in errno, if "fd is bound to a special file which does not support synchronization". Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Ramsay Jones 10aa3fa7 2009-06-04T17:14:35 Fix some "signed/unsigned mismatch" (msvc) compiler warnings Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Andreas Ericsson <ae@op5.se>
Ramsay Jones 4319860c 2009-06-04T16:45:59 win32: Add some file operation stubs and wrapper functions Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Andreas Ericsson <ae@op5.se>
Ramsay Jones 0234c186 2009-03-20T19:52:50 win32: Add <dirent.h> directory reading routines Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Ramsay Jones 79ca2edc 2009-03-20T19:51:48 win32: Add routines to abstract memory-mapped file functions In particular, the git__mmap() and git__munmap() routines provide the interface to platform specific memory-mapped file facilities. We provide implementations for unix and win32, which can be found in their own sub-directories. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>