Commit Graph

81198 Commits

Author SHA1 Message Date
Johannes Schindelin
831d34ddb4 Merge pull request #1003 from shoelzer/master
poll: Use GetTickCount64 to avoid wraparound issues
2018-01-22 13:00:11 +01:00
Johannes Schindelin
f953db0fbf Merge pull request #159 from dscho/vagrant
Add Vagrant support (easy Linux VM setup)
2018-01-22 13:00:11 +01:00
Johannes Schindelin
b85e45671b Merge 'misc-vs-fixes-extra' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-01-22 13:00:11 +01:00
Johannes Schindelin
b8aa23484e 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-01-22 13:00:11 +01:00
Johannes Schindelin
ca39d9867a Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2018-01-22 13:00:11 +01:00
Johannes Schindelin
febd108296 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-01-22 13:00:11 +01:00
Johannes Schindelin
e837313205 Merge pull request #938 from virtuald/patch-1
git-cvsexportcommit.perl: Force crlf translation
2018-01-22 13:00:11 +01:00
Johannes Schindelin
b8e5f2cd12 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-01-22 13:00:11 +01:00
Johannes Schindelin
a917e47dd4 Merge branch 'mingw-strftime'
This topic branch works around an out-of-memory bug when the user
specified a format via --date=format:<format> that strftime() does
not like.

Reported by Stefan Naewe.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-01-22 13:00:11 +01:00
Johannes Schindelin
7919da9d99 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-01-22 13:00:10 +01:00
Johannes Schindelin
320b8957ef 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-01-22 13:00:10 +01:00
Johannes Schindelin
d67867f12a 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-01-22 13:00:10 +01:00
Johannes Schindelin
c7ea9864a2 Merge pull request #797 from glhez/master
`git bundle create <bundle>` leaks handle the revlist is empty.
2018-01-22 13:00:10 +01:00
Johannes Schindelin
f74e2d1b84 Merge 'release-gc-repack' into HEAD 2018-01-22 13:00:10 +01:00
Johannes Schindelin
fb87676eb1 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-01-22 13:00:10 +01:00
Johannes Schindelin
011726d5b5 Merge pull request #677 from yaras/fix-git-675
Fixed masking username with asterisks when reading credentials
2018-01-22 13:00:10 +01:00
Johannes Schindelin
af9a385b24 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-01-22 13:00:10 +01:00
Johannes Schindelin
52f76e0102 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-01-22 13:00:10 +01:00
Johannes Schindelin
c6ddfef9bc Merge pull request #552 from duncansmart/fix-vcproj-gen
Fix Visual Studio .sln/.vcproj generation.
2018-01-22 13:00:10 +01:00
Johannes Schindelin
d91c9d0258 Merge pull request #773 from jeffhostetler/vs2015
Build with VS2015
2018-01-22 13:00:09 +01:00
Johannes Schindelin
43810630cc Merge pull request #305 from dscho/msysgit_issues_182
Allow `add -p` and `add -i` with a large number of files
2018-01-22 13:00:09 +01:00
Johannes Schindelin
855a5d9adc 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-01-22 13:00:09 +01:00
Johannes Schindelin
ad49ee56b2 Merge 'mingw-getcwd' into HEAD 2018-01-22 13:00:09 +01:00
Johannes Schindelin
74471bb0d5 Merge pull request #443 from kblees/kb/nanosecond-file-times-v2.5.3
nanosecond file times for v2.5.3
2018-01-22 13:00:09 +01:00
Johannes Schindelin
10757b6da6 Merge pull request #156 from kblees/kb/symlinks
Symlink support
2018-01-22 13:00:09 +01:00
Johannes Schindelin
2c863ce390 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-01-22 13:00:09 +01:00
Johannes Schindelin
43d8950344 Merge 'fix-externals' into HEAD 2018-01-22 13:00:09 +01:00
Johannes Schindelin
22771bb694 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-01-22 13:00:09 +01:00
Johannes Schindelin
e2d1e05a19 Merge 'win-tests-fixes' into HEAD 2018-01-22 13:00:09 +01:00
Johannes Schindelin
09204fe7fd Merge 'msys2' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-01-22 13:00:09 +01:00
Johannes Schindelin
b2fec5d116 mingw: allow absolute paths without drive prefix
When specifying an absolute path without a drive prefix, we convert that
path internally. Let's make sure that we handle that case properly, too
;-)

This fixes the command

	git clone https://github.com/git-for-windows/git \G4W

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-01-22 13:00:08 +01:00
Johannes Schindelin
ebed29df16 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-01-22 13:00:08 +01:00
Johannes Schindelin
4164203c3f gettext: avoid initialization if the locale dir is not present
The runtime of a simple `git.exe version` call on Windows is currently
dominated by the gettext setup, adding a whopping ~150ms to the ~210ms
total.

Given that this cost is added to each and every git.exe invocation goes
through common-main's invocation of git_setup_gettext(), and given that
scripts have to call git.exe dozens, if not hundreds, of times, this is
a substantial performance penalty.

This is particularly pointless when considering that Git for Windows
ships without localization (to keep the installer's size to a bearable
~34MB): all that time setting up gettext is for naught.

So let's be smart about it and skip setting up gettext if the locale
directory is not even present.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-01-22 13:00:08 +01:00
Johannes Schindelin
9e7113953d Merge 'gitk' into HEAD 2018-01-22 13:00:08 +01:00
Johannes Schindelin
f3704b4e55 mingw: demonstrate a problem with certain absolute paths
On Windows, there are several categories of absolute paths. One such
category starts with a backslash and is implicitly relative to the
drive associated with the current working directory. Example:

	c:
	git clone https://github.com/git-for-windows/git \G4W

should clone into C:\G4W.

There is currently a problem with that, in that mingw_mktemp() does not
expect the _wmktemp() function to prefix the absolute path with the
drive prefix, and as a consequence, the resulting path does not fit into
the originally-passed string buffer. The symptom is a "Result too large"
error.

Reported by Juan Carlos Arevalo Baeza.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-01-22 13:00:08 +01:00
Johannes Schindelin
ef620ef1f4 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-01-22 13:00:08 +01:00
Johannes Schindelin
779f75c777 Merge 'git-gui' into HEAD 2018-01-22 13:00:08 +01:00
Johannes Schindelin
5ec675beb7 Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-01-22 13:00:08 +01:00
Johannes Schindelin
ede9e0f41e fscache: add a test for the dir-not-found optimization
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-01-22 13:00:07 +01:00
Max Kirillov
7275f40e64 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-01-22 13:00:07 +01:00
Johannes Schindelin
11389d5ce6 gettext: use a GIT_LOCALE_PATH relative to $(prefix)
On Windows, we simply pass a POSIX path to bindtextdomain(), relying on
the current libintl-8.dll implementation to handle that gracefully by
resolving the path relative to the "root" directory inferred from the
location of the .dll file itself.

However, not only does this rely on the custom patches of the gettext
library as shipped with MSYS2 (gettext's own source code is not prepared
to handle POSIX paths on Windows), it also means that Git itself cannot
use the `podir` variable at all because it does not handle absolute
POSIX paths in system_path() correctly, leaving them as-is.

This patch fixes that behavior by always using a GIT_LOCALE_PATH
relative to the (runtime) prefix.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-01-22 13:00:07 +01:00
Jeff Hostetler
fed65c3a81 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-01-22 13:00:07 +01:00
Johannes Schindelin
b70ac3e234 Merge branch 'git-gui'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-01-22 13:00:07 +01:00
Johannes Schindelin
2721332d43 gettext: handle GIT_TEXTDOMAINDIR relative to $(prefix)
On Windows, there is no single root directory. And what Git thinks is a
root directory is not a root directory at all: everything is relative to
the location where Git is installed.

To handle this situation better, let's just allow for GIT_TEXTDOMAINDIR
to be a path relative to the (runtime) prefix.

To that end, we have to switch the order in which common-main handles
argv0 and sets up gettext: in order to have access to the runtime
prefix, we need it to be inferred from argv0 already.

This patch also prepares for GIT_LOCALE_PATH to be relative to prefix,
which is the even more important fix.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-01-22 13:00:07 +01:00
Jeff Hostetler
c433955dab 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-01-22 13:00:07 +01:00
Johannes Schindelin
a5c77326b9 Merge branch 'long-paths'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-01-22 13:00:07 +01:00
Johannes Schindelin
22b2042ffa 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-01-22 13:00:06 +01:00
Jeff Hostetler
12e507efd4 diffcore-rename: speed up register_rename_src
Teach register_rename_src() to see if new file pair
can simply be appended to the rename_src[] array before
performing the binary search to find the proper insertion
point.

This is a performance optimization.  This routine is called
during run_diff_files in status and the caller is iterating
over the sorted index, so we should expect to be able to
append in the normal case.  The existing insert logic is
preserved so we don't have to assume that, but simply take
advantage of it if possible.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2018-01-22 13:00:06 +01:00
Johannes Schindelin
e55b96f365 poll: lazy-load GetTickCount64()
This fixes the compilation, actually, as we still did not make the jump to
post-Windows XP completely: we still compile with _WIN32_WINNT set to
0x0502 (which corresponds to Windows Server 2003 and is technically
greater than Windows XP's 0x0501).

However, GetTickCount64() is only available starting with Windows
Vista/Windows Server 2008.

Let's just lazy-load the function, which should also help Git for Windows
contributors who want to reinstate Windows XP support.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-01-22 13:00:06 +01:00
Johannes Schindelin
4e9de0faac Support Vagrant: quick & easy Linux virtual machine setup
When developing Git for Windows, we always have to ensure that we do not
break any non-Windows platforms, e.g. by introducing Windows-specific code
into the platform-independent source code.

At other times, it is necessary to test whether a bug is Windows-specific
or not, in order to send the bug report to the correct place. Having
access to a Linux-based Git comes in really handy in such a situation.

Vagrant offers a painless way to install and use a defined Linux
development environment on Windows (and other Operating Systems). We offer
a Vagrantfile to that end for two reasons:

1) To allow Windows users to gain the full power of Linux' Git

2) To offer users an easy path to verify that the issue they are about
   to report is really a Windows-specific issue; otherwise they would
   need to report it to git@vger.kernel.org instead.

Using it is easy: Download and install https://www.virtualbox.org/, then
download and install https://www.vagrantup.com/, then direct your
command-line window to the Git source directory containing the Vagrantfile
and run the commands:

	vagrant up
	vagrant ssh

See https://github.com/git-for-windows/git/wiki/Vagrant for details.

As part of switching Git for Windows' development environment from msysGit
to the MSys2-based Git SDK, this Vagrantfile was copy-edited from msysGit:

	https://github.com/msysgit/msysgit/blob/0be8f2208/Vagrantfile

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-01-22 13:00:06 +01:00