Commit Graph

85884 Commits

Author SHA1 Message Date
Johannes Schindelin
e50349952f Merge 'case-insensitive-abspath' into HEAD 2018-06-22 08:18:50 +02:00
Johannes Schindelin
4d6941c597 mingw: fix isatty() after dup2()
We newly handle isatty() by special-casing the stdin/stdout/stderr file
descriptors, caching the return value. However, we missed the case where
dup2() overrides the respective file descriptor.

That poses a problem e.g. where the `show` builtin asks for a pager very
early, the `setup_pager()` function sets the pager depending on the
return value of `isatty()` and then redirects stdout. Subsequently,
`cmd_log_init_finish()` calls `setup_pager()` *again*. What should
happen now is that `isatty()` reports that stdout is *not* a TTY and
consequently stdout should be left alone.

Let's override dup2() to handle this appropriately.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:50 +02:00
Johannes Schindelin
5951c8dd31 mingw: make is_hidden tests in t0001/t5611 more robust
We should not actually expect the first `attrib.exe` in the PATH to
be the one we are looking for. Or that it is in the PATH, for that
matter.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:49 +02:00
Johannes Schindelin
584267e9ee mingw: ensure valid CTYPE
A change between versions 2.4.1 and 2.6.0 of the MSYS2 runtime modified
how Cygwin's runtime (and hence Git for Windows' MSYS2 runtime
derivative) handles locales: d16a56306d (Consolidate wctomb/mbtowc calls
for POSIX-1.2008, 2016-07-20).

An unintended side-effect is that "cold-calling" into the POSIX
emulation will start with a locale based on the current code page,
something that Git for Windows is very ill-prepared for, as it expects
to be able to pass a command-line containing non-ASCII characters to the
shell without having those characters munged.

One symptom of this behavior: when `git clone` or `git fetch` shell out
to call `git-upload-pack` with a path that contains non-ASCII
characters, the shell tried to interpret the entire command-line
(including command-line parameters) as executable path, which obviously
must fail.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:49 +02:00
Johannes Schindelin
2666a1e846 Merge pull request #994 from jeffhostetler/jeffhostetler/fscache_nfd
fscache: add not-found directory cache to fscache
2018-06-22 08:18:49 +02:00
Johannes Schindelin
03e4ef86fd Merge pull request #1032 from max630/gitgui_GIT_GIT_unset
git-gui: correctly restore GIT_DIR after invoking commands
2018-06-22 08:18:49 +02:00
Johannes Schindelin
461a7a6883 Merge branch 'test-unc-alternates'
The fix we introduced in Git for Windows will be made obsolete by a more
general fix that has been already accepted into upstream Git's `next`
branch.

But we still can introduce a regression test that verifies that this bug
will be caught very quickly, if reintroduced.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:48 +02:00
Johannes Schindelin
092daf5731 t9001: work around hard-to-debug hangs
Just like the workaround we added for t9116, t9001.83 hangs sometimes --
but not always! -- when being run in the Git for Windows SDK.

The issue seems to be related to redirection via a pipe, but it is really
hard to diagnose, what with git.exe (a non-MSYS2 program) calling a Perl
script (which is executed by an MSYS2 Perl), piping into another MSYS2
program.

As hunting time is scarce these days, simply work around this for now and
leave the real diagnosis and resolution for later.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:48 +02:00
Johannes Schindelin
67f146313d t9116: work around hard-to-debug hangs
As of a couple of weeks ago, t9116 hangs sometimes -- but not always! --
when being run in the Git for Windows SDK.

The issue seems to be related to redirection via a pipe, but it is really
hard to diagnose, what with git.exe (a non-MSYS2 program) calling a Perl
script (which is executed by an MSYS2 Perl), piping into another MSYS2
program.

As hunting time is scarce these days, simply work around this for now and
leave the real diagnosis and resolution for later.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:48 +02:00
Johannes Schindelin
d5fcbeda6b Merge pull request #996 from jeffhostetler/jeffhostetler/register_rename_src
diffcore-rename: speed up register_rename_src
2018-06-22 08:18:47 +02:00
Johannes Schindelin
5467ab6d35 Merge pull request #1003 from shoelzer/master
poll: Use GetTickCount64 to avoid wraparound issues
2018-06-22 08:18:47 +02:00
Johannes Schindelin
603325f0f6 Merge pull request #159 from dscho/vagrant
Add Vagrant support (easy Linux VM setup)
2018-06-22 08:18:47 +02:00
Johannes Schindelin
ba27d2feb2 Merge 'misc-vs-fixes-extra' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:46 +02:00
Johannes Schindelin
99dd0cbfe4 Merge branch 'visual-studio'
This topic branch teaches the project generator to generate a Visual
Studio solution, ready to be opened in Visual Studio 2010 or later.

The idea, of course, is to let some automatic build job generate and
commit the project files with

	make MSVC=1 vcxproj

and then (force-)push to a special-purpose branch.

The major part of this branch thicket concerns itself not only with
generating the Visual Studio project files, but making sure that the
user can then run the test suite from a regular Git Bash (i.e. *not*
requiring a Git for Windows SDK), e.g. by running

	cd t
	prove --timer --jobs 15 ./t[0-9]*.sh

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:46 +02:00
Johannes Schindelin
c7202182a5 Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2018-06-22 08:18:45 +02:00
Johannes Schindelin
01da1fe642 mingw: make readlink() independent of core.symlinks
Regardless whether we think we are able to create symbolic links, we
should always read them.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:45 +02:00
Johannes Schindelin
71b5f2951b Merge pull request #938 from virtuald/patch-1
git-cvsexportcommit.perl: Force crlf translation
2018-06-22 08:18:45 +02:00
Johannes Schindelin
e3cd097b95 Merge branch 'reset-stdin'
This topic branch adds the (experimental) --stdin/-z options to `git
reset`. Those patches are still under review in the upstream Git project,
but are already merged in their experimental form into Git for Windows'
`master` branch, in preparation for a MinGit-only release.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:44 +02:00
Johannes Schindelin
86ff3f9ac9 Unbreak interactive GPG prompt upon signing
With the recent update in efee955 (gpg-interface: check gpg signature
creation status, 2016-06-17), we ask GPG to send all status updates to
stderr, and then catch the stderr in an strbuf.

But GPG might fail, and send error messages to stderr. And we simply
do not show them to the user.

Even worse: this swallows any interactive prompt for a passphrase. And
detaches stderr from the tty so that the passphrase cannot be read.

So while the first problem could be fixed (by printing the captured
stderr upon error), the second problem cannot be easily fixed, and
presents a major regression.

So let's just revert commit efee9553a4.

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

Cc: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:44 +02:00
Johannes Schindelin
471ae9cc5d Merge branch 'unhidden-git'
It has been reported that core.hideDotFiles=false stopped working...
This topic branch fixes it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:44 +02:00
Johannes Schindelin
757dbcfddd Merge branch 'status-no-lock-index'
This branch allows third-party tools to call `git status
--no-lock-index` to avoid lock contention with the interactive Git usage
of the actual human user.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:43 +02:00
Johannes Schindelin
c2f46e655e Merge pull request #797 from glhez/master
`git bundle create <bundle>` leaks handle the revlist is empty.
2018-06-22 08:18:43 +02:00
Johannes Schindelin
5f234534ac Merge 'release-gc-repack' into HEAD 2018-06-22 08:18:42 +02:00
Johannes Schindelin
7623549eb1 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>
2018-06-22 08:18:42 +02:00
Johannes Schindelin
11b5e02145 Merge pull request #677 from yaras/fix-git-675
Fixed masking username with asterisks when reading credentials
2018-06-22 08:18:42 +02:00
Johannes Schindelin
d2e0dfa1b7 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>
2018-06-22 08:18:41 +02:00
Johannes Schindelin
1b822d9e0c 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>
2018-06-22 08:18:41 +02:00
Johannes Schindelin
199021bd6c Merge pull request #552 from duncansmart/fix-vcproj-gen
Fix Visual Studio .sln/.vcproj generation.
2018-06-22 08:18:40 +02:00
Johannes Schindelin
e8da3b70d1 Merge pull request #773 from jeffhostetler/vs2015
Build with VS2015
2018-06-22 08:18:40 +02:00
Johannes Schindelin
2486150442 Merge pull request #305 from dscho/msysgit_issues_182
Allow `add -p` and `add -i` with a large number of files
2018-06-22 08:18:39 +02:00
Johannes Schindelin
72b6f6ec5d 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>
2018-06-22 08:18:39 +02:00
Johannes Schindelin
d69ecdfe19 Merge 'mingw-getcwd' into HEAD 2018-06-22 08:18:38 +02:00
Johannes Schindelin
c414e95ba2 Merge pull request #443 from kblees/kb/nanosecond-file-times-v2.5.3
nanosecond file times for v2.5.3
2018-06-22 08:18:38 +02:00
Johannes Schindelin
2683408a71 Merge pull request #156 from kblees/kb/symlinks
Symlink support
2018-06-22 08:18:37 +02:00
Johannes Schindelin
6b278f28f8 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>
2018-06-22 08:18:37 +02:00
Johannes Schindelin
b020fcebf1 Merge 'fix-externals' into HEAD 2018-06-22 08:18:36 +02:00
Johannes Schindelin
d6a0e2c3ea 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>
2018-06-22 08:18:36 +02:00
Johannes Schindelin
f915b998c9 Merge 'win-tests-fixes' into HEAD 2018-06-22 08:18:36 +02:00
Johannes Schindelin
6785bd25e2 Merge 'msys2' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:35 +02:00
Johannes Schindelin
bfdf73cbb3 Merge 'gitk' into HEAD 2018-06-22 08:18:35 +02:00
Johannes Schindelin
3693a7bc7a 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>
2018-06-22 08:18:34 +02:00
Johannes Schindelin
2d2bc08707 Merge 'git-gui' into HEAD 2018-06-22 08:18:34 +02:00
Johannes Schindelin
7f1a34995e abspath_part_inside_repo: respect core.fileMode
If the file system is case-insensitive, we really must be careful to
ignore differences in case only.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:33 +02:00
Johannes Schindelin
95c8963bf8 Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:33 +02:00
Johannes Schindelin
e80986db23 fscache: add a test for the dir-not-found optimization
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:32 +02:00
Max Kirillov
513d100a9c git-gui: correctly restore GIT_DIR after invoking gitk
git-gui tries to temporary set GIT_DIR for starting gitk and restore
it back after they are started. But in case of GIT_DIR which was not set
prior to invocation it is not unset after it. This affects commands
which can be later started from that git gui, for example "Git Bash".

Fix it.

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:32 +02:00
Jeff Hostetler
90ba40bc39 fscache: remember not-found directories
Teach FSCACHE to remember "not found" directories.

This is a performance optimization.

FSCACHE is a performance optimization available for Windows.  It
intercepts Posix-style lstat() calls into an in-memory directory
using FindFirst/FindNext.  It improves performance on Windows by
catching the first lstat() call in a directory, using FindFirst/
FindNext to read the list of files (and attribute data) for the
entire directory into the cache, and short-cut subsequent lstat()
calls in the same directory.  This gives a major performance
boost on Windows.

However, it does not remember "not found" directories.  When STATUS
runs and there are missing directories, the lstat() interception
fails to find the parent directory and simply return ENOENT for the
file -- it does not remember that the FindFirst on the directory
failed. Thus subsequent lstat() calls in the same directory, each
re-attempt the FindFirst.  This completely defeats any performance
gains.

This can be seen by doing a sparse-checkout on a large repo and
then doing a read-tree to reset the skip-worktree bits and then
running status.

This change reduced status times for my very large repo by 60%.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:32 +02:00
Jeff Hostetler
c62dc76abf fscache: add key for GIT_TRACE_FSCACHE
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:32 +02:00
Johannes Schindelin
44f46869f1 Merge branch 'long-paths'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:32 +02:00
Johannes Schindelin
8de5624832 t5580: verify that alternates can be UNC paths
On Windows, UNC paths are a very convenient way to share data, and
alternates are all about sharing data.

We fixed a bug where alternates specifying UNC paths were not handled
properly, and it is high time that we add a regression test to ensure
that this bug is not reintroduced.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-06-22 08:18:31 +02:00