Commit Graph

67766 Commits

Author SHA1 Message Date
Johannes Schindelin
3ff5ff18ad Merge 'release-gc-repack' into HEAD 2017-02-01 16:34:38 +01:00
Johannes Schindelin
7f13bf8c65 Merge branch 'spawn-with-spaces'
This change lets us spawn .bat scripts whose paths contain spaces.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:34:37 +01:00
Johannes Schindelin
d7751c9633 Merge pull request #677 from yaras/fix-git-675
Fixed masking username with asterisks when reading credentials
2017-02-01 16:34:08 +01:00
Johannes Schindelin
3c8efcaeef mingw: support spawning programs containing spaces in their names
The CreateProcessW() function does not really support spaces in its
first argument, lpApplicationName. But it supports passing NULL as
lpApplicationName, which makes it figure out the application from the
(possibly quoted) first argument of lpCommandLine.

Let's use that trick (if we are certain that the first argument matches
the executable's path) to support launching programs whose path contains
spaces.

This fixes https://github.com/git-for-windows/git/issue/692

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:34:08 +01:00
Johannes Schindelin
866b0f75b6 Merge 'git-gui-add-2nd-line' into HEAD 2017-02-01 16:34:07 +01:00
Johannes Schindelin
4716dc621b Merge branch 'clean-long-paths'
This addresses https://github.com/git-for-windows/git/issues/521

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:34:06 +01:00
Johannes Schindelin
72e95f72c0 Merge 'aslr' into HEAD
Address Space Layout Randomization (ASLR) allows executables' memory
layout to change at random between runs, and therefore offers a quite
decent protection against many attacks.

We enable ASLR because MSYS2's C compiler offers support for ASLR, and
whatever performance impact it has is neglible, according to
https://insights.sei.cmu.edu/cert/2014/02/differences-between-aslr-on-windows-and-linux.html

This merges the part of https://github.com/git-for-windows/git/pull/612
that does not break Git ;-)

This fixes https://github.com/git-for-windows/git/issues/608

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:34:05 +01:00
Johannes Schindelin
6bf53d7c5c Merge pull request #552 from duncansmart/fix-vcproj-gen
Fix Visual Studio .sln/.vcproj generation.
2017-02-01 16:34:05 +01:00
Johannes Schindelin
77c7acd600 Merge pull request #773 from jeffhostetler/vs2015
Build with VS2015
2017-02-01 16:34:04 +01:00
Johannes Schindelin
c75f7f9a02 compat/vcbuild: possibly reuse Git for Windows' SDK's NuGet
In Git for Windows' SDK, there is already a script to package Git for
Windows as a NuGet package, downloading nuget.exe if needed.

Let's just fall back to using that executable (if it is there) if
nuget.exe was not found in the PATH.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:33:44 +01:00
Jeff Hostetler
7ea4705212 vs2015: remove todo list item from README_vs2015.txt
Remove todo list item for vs2015 build notes regarding
the third party DLLs.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:33:43 +01:00
Jeff Hostetler
d71db554c1 vs2015: teach 'make clean' to delete PDBs
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:33:43 +01:00
Jeff Hostetler
40a831360e vs2015: turn on optimize-for-speed in release build
Set -O2 (maximize speed) rather than -Os (favor small code)
for non-debug builds.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:33:43 +01:00
Johannes Schindelin
b690a9fb49 t7800: fix quoting
When passing a command-line to call an external diff command to the
difftool, we must be prepared for paths containing special characters,
e.g. backslashes in the temporary directory's path on Windows.

This has been caught by running the test suite with an MSVC-built Git:
in contrast to the MINGW one, it does not rewrite `$TMP` to use forward
slashes instead of backslashes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:33:43 +01:00
Johannes Schindelin
67fe02e82c msvc: work around iconv() not setting errno
When compiling with MSVC, we rely on NuPkgs to provide the binaries of
dependencies such as libiconv. The libiconv 1.14.0.11 package available
from https://www.nuget.org/packages/libiconv seems to have a bug where
it does not set errno (when we would expect it to be E2BIG).

Let's simulate the error condition by taking less than 16 bytes
remaining in the out buffer as an indicator that we ran out of space.
While 16 might seem a bit excessive (when converting from, say, any
encoding to UTF-8, 8 bytes should be fine), it is designed to be a safe
margin.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:33:43 +01:00
Johannes Schindelin
1cb14d4923 msvc: use libiconv
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:33:43 +01:00
Jeff Hostetler
22c93e7dc4 msvc: use OpenSSL's SHA-1 routines
Just like 1e2ce1d (sha1: Use OpenSSL SHA1 routines on MINGW, 2016-10-12),
we now use OpenSSL's SHA-1 routines instead of Git's own because OpenSSL
is substantially faster as of version 1.0.2: it now uses hardware
acceleration on Intel processors much more effectively.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:33:43 +01:00
Johannes Schindelin
bd5e8d4793 msvc: respect the quiet-by-default output
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:33:43 +01:00
Jeff Hostetler
6097db940c msvc: release mode PDBs and library DLLs
Install required third-party DLLs next to EXEs.

Build and install release mode PDBs for git
executables allowing detailed stack traces
in the event of crash.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:33:43 +01:00
Jeff Hostetler
52f4c317f0 msvc: fix setvbuf() call
The VS2015 version of the CRT asserts when you
pass a zero buffer length and request line buffering.
This fix sets it to the default BUFSIZ.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:33:42 +01:00
Jeff Hostetler
438d194323 cache-tree.c: avoid reusing the DEBUG constant
In MSVC, the DEBUG constant is set automatically whenever compiling with
debug information.

This is clearly not what was intended in cache-tree.c, so let's use a less
ambiguous constant there.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:33:42 +01:00
Johannes Schindelin
c19aa3bb4f msvc: fix detect_msys_tty()
The ntstatus.h header is only available in MINGW.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:33:42 +01:00
Jeff Hostetler
667006afc4 msvc: define ftello()
It is just called different in MSVC's headers.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:33:42 +01:00
Jeff Hostetler
0209cfabe5 msvc: do not re-declare the timespec struct
VS2015's headers already declare that struct.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:33:42 +01:00
Johannes Schindelin
816315adf5 msvc: provide a main() wrapper similar to mingw_main()
The MINGW version of the main() wrapper gets away with declaring symbols
that were intentionally not exported. However, some of these symbols do
not actually exist in MSVC's UCRT.

So let's add an MSVC version of the main() wrapper that uses wmain() and
imports the UNICODE argv and environment. While at it, we pass our UTF-8
version of ARGV to the real main -- rather than overwriting __argv as is
done in the MINGW Version.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:33:42 +01:00
Jeff Hostetler
7907348d03 msvc: do not pretend to support all signals
This special-cases various signals that are not supported on Windows,
such as SIGPIPE. These cause the UCRT to throw asserts (at least in
debug mode).

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:33:42 +01:00
Jeff Hostetler
1fa0acbf07 msvc: mark a variable as non-const
VS2015 complains when using a const pointer in memcpy()/free().

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:33:42 +01:00
Jeff Hostetler
d34ea93776 msvc: convert environment from/to UTF-16 on the fly
This adds MSVC versions of getenv() and friends. These take UTF-8
arguments and return UTF-8 values, but use the UNICODE versions
of the CRT routines.  This avoids the need to write to __environ
(which is only visible if you statically link to the CRT).  This
also avoids the CP_ACP conversions performed inside the CRT.
It also avoids various memory leaks and problems.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-02-01 16:33:41 +01:00
Philip Oakley
7f57ad55b4 msvc: fix the declaration of the _REPARSE_DATA_BUFFER structure
GCC and MSVC disagree about using the GCC extension _ANONYMOUS_UNION.
Simply skip that offending keyword when compiling with MSVC.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:33:41 +01:00
Philip Oakley
a2864226b3 msvc: define O_ACCMODE
This constant is not defined in MSVC's headers.

In UCRT's fcntl.h, _O_RDONLY, _O_WRONLY and _O_RDWR are defined as 0, 1
and 2, respectively. Yes, that means that UCRT breaks with the tradition
that O_RDWR == O_RDONLY | O_WRONLY.

It is a perfectly legal way to define those constants, though, therefore
we need to take care of defining O_ACCMODE accordingly.

This is particularly important in order to keep our "open() can set
errno to EISDIR" emulation working: it tests that (flags & O_ACCMODE) is
not identical to O_RDONLY before going on to test specifically whether
the file for which open() reported EACCES is, in fact, a directory.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 16:33:38 +01:00
Johannes Schindelin
949488f4c7 gc/repack: release packs when needed
On Windows, files cannot be removed nor renamed if there are still
handles held by a process. To remedy that, we introduced the
close_all_packs() function.

Earlier, we made sure that the packs are released just before `git gc`
is spawned, in case that gc wants to remove no-longer needed packs.

But this developer forgot that gc itself also needs to let go of packs,
e.g. when consolidating all packs via the --aggressive option.

Likewise, `git repack -d` wants to delete obsolete packs and therefore
needs to close all pack handles, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 14:28:29 +01:00
Johannes Schindelin
1b8d08cd47 Merge pull request #305 from dscho/msysgit_issues_182
Allow `add -p` and `add -i` with a large number of files
2017-02-01 14:23:32 +01:00
Johannes Schindelin
d91b900540 Merge branch 'program-data-config'
This branch introduces support for reading the "Windows-wide" Git
configuration from `%PROGRAMDATA%\Git\config`. As these settings are
intended to be shared between *all* Git-related software, that config
file takes an even lower precedence than `$(prefix)/etc/gitconfig`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 14:22:50 +01:00
Johannes Schindelin
0411b0baa3 Merge 'mingw-getcwd' into HEAD 2017-02-01 14:22:09 +01:00
Johannes Schindelin
884a016982 Merge pull request #443 from kblees/kb/nanosecond-file-times-v2.5.3
nanosecond file times for v2.5.3
2017-02-01 14:21:28 +01:00
Johannes Schindelin
4e8d32c2b1 Merge pull request #156 from kblees/kb/symlinks
Symlink support
2017-02-01 14:20:47 +01:00
Johannes Schindelin
994acdb287 Merge 'sideband-bug' into HEAD
This works around the push-over-git-protocol issues pointed out in
https://github.com/msysgit/git/issues/101.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 14:20:06 +01:00
Johannes Schindelin
56e104eaea Merge 'fix-is-exe' into HEAD 2017-02-01 14:19:25 +01:00
Johannes Schindelin
dfb64181f4 Merge 'fix-externals' into HEAD 2017-02-01 14:18:44 +01:00
Johannes Schindelin
d0cbbaae59 Merge 'remote-hg-prerequisites' into HEAD
These fixes were necessary for Sverre Rabbelier's remote-hg to work,
but for some magic reason they are not necessary for the current
remote-hg. Makes you wonder how that one gets away with it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 14:18:03 +01:00
Johannes Schindelin
f2f25fb925 Merge 'win-tests-fixes' into HEAD 2017-02-01 14:17:21 +01:00
Johannes Schindelin
aaa0bdc4c2 Merge 'msys2' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 14:16:38 +01:00
Johannes Schindelin
e14bc03674 Merge 'resource-version' into HEAD 2017-02-01 14:15:55 +01:00
Johannes Schindelin
485a829822 Merge 'cygwin-fixes' into HEAD 2017-02-01 14:15:12 +01:00
Johannes Schindelin
0a772c9fe5 Merge 'jberezanski/wincred-sso-r2' into HEAD 2017-02-01 14:14:30 +01:00
Johannes Schindelin
ac5b0072c4 Merge 'gitk' into HEAD 2017-02-01 14:13:47 +01:00
Johannes Schindelin
ed8d394e94 Merge branch 'msys2-git-gui'
This topic branch addresses the bug where Git for Windows 2.x' Git GUI
failed to generate a working shortcut via Repository>Create Desktop
Shortcut.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 14:13:06 +01:00
Johannes Schindelin
27131f2676 Merge 'git-gui' into HEAD 2017-02-01 14:12:25 +01:00
Johannes Schindelin
3c7f07253b Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 14:11:42 +01:00
Johannes Schindelin
9028fa4de4 Merge branch 'redirect-std-handles'
This topic branch introduces a highly-experimental feature allowing to
override stdin/stdout/stderr by setting environment variables e.g. to
named pipes, solving a problem in highly multi-threaded applications
where inheritable handles could cause blocked Git operations.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-02-01 14:11:01 +01:00