Commit Graph

67442 Commits

Author SHA1 Message Date
Johannes Schindelin
bfeb559657 Merge pull request #159 from dscho/vagrant
Add Vagrant support (easy Linux VM setup)
2017-01-18 13:31:03 +01:00
Johannes Schindelin
713b253e85 Merge branch 'http-empty-auth'
This topic branch fixes a rather serious regression with NTLM
authentication: when using "empty credentials", i.e. when inserting ":@"
into a URL (e.g. https://:@me.visualstudio.com/), we used to ask cURL to
use the login credentials. But a recent change broke that. Which this
branch fixes again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:31:02 +01:00
Johannes Schindelin
9f477dbc69 Merge pull request #991 from jeffhostetler/jeffhostetler/string_list_realloc
string-list: use ALLOC_GROW macro when reallocing string_list
2017-01-18 13:31:01 +01:00
Johannes Schindelin
a4e92f41f3 Merge pull request #988 from jeffhostetler/jeffhostetler/quick_add_index_entry
read-cache: speed up add_index_entry during checkout
2017-01-18 13:31:01 +01:00
Johannes Schindelin
f89e820949 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>
2017-01-18 13:31:00 +01:00
Johannes Schindelin
c587090eae http(s): automatically try NTLM authentication first
It is common in corporate setups to have permissions managed via a
domain account. That means that the user does not really have to log in
when accessing a central repository via https://, but that the login
credentials are used to authenticate with that repository.

The common way to do that used to require empty credentials, i.e. hitting
Enter twice when being asked for user name and password, or by using the
very funny notation https://:@server/repository

A recent commit (5275c3081c (http: http.emptyauth should allow empty (not
just NULL) usernames, 2016-10-04)) broke that usage, though, all of a
sudden requiring users to set http.emptyAuth = true.

Which brings us to the bigger question why http.emptyAuth defaults to
false, to begin with.

It would be one thing if cURL would not let the user specify credentials
interactively after attempting NTLM authentication (i.e. login
credentials), but that is not the case.

It would be another thing if attempting NTLM authentication was not
usually what users need to do when trying to authenticate via https://.
But that is also not the case.

So let's just go ahead and change the default, and unbreak the NTLM
authentication. As a bonus, this also makes the "you need to hit Enter
twice" (which is hard to explain: why enter empty credentials when you
want to authenticate with your login credentials?) and the ":@" hack
(which is also pretty, pretty hard to explain to users) obsolete.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:59 +01:00
Jeff Hostetler
bb73a9ea1e string-list: use ALLOC_GROW macro when reallocing string_list
Use ALLOC_GROW() macro when reallocing a string_list array
rather than simply increasing it by 32.  This is a performance
optimization.

During status on a very large repo and there are many changes,
a significant percentage of the total run time was spent
reallocing the wt_status.changes array.

This change decreased the time in wt_status_collect_changes_worktree()
from 125 seconds to 45 seconds on my very large repository.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-01-18 13:30:58 +01:00
Johannes Schindelin
3a3c44062a Merge pull request #978 from jeffhostetler/jeffhostetler/thread_verify_hdr
read-cache: run verify_hdr() in background thread
2017-01-18 13:30:57 +01:00
Johannes Schindelin
2a047a557d Merge 'misc-vs-fixes-extra' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:57 +01:00
Johannes Schindelin
47b231bd3d 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>
2017-01-18 13:30:56 +01:00
Johannes Schindelin
3937dca46c Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2017-01-18 13:30:55 +01:00
Johannes Schindelin
b3c4492a06 Merge pull request #964 from jeffhostetler/jeffhostetler/memihash_perf
Jeffhostetler/memihash perf
2017-01-18 13:30:55 +01:00
Johannes Schindelin
acd9d1900f 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>
2017-01-18 13:30:54 +01:00
Johannes Schindelin
f18d1f979a Merge pull request #955 from jeffhostetler/jeffhostetler/preload_index_perf
preload-index: avoid lstat for skip-worktree items
2017-01-18 13:30:54 +01:00
Johannes Schindelin
97b7c58428 Merge pull request #938 from virtuald/patch-1
git-cvsexportcommit.perl: Force crlf translation
2017-01-18 13:30:53 +01:00
Johannes Schindelin
6463c5078b 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>
2017-01-18 13:30:53 +01:00
Johannes Schindelin
4e9ea68ad7 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>
2017-01-18 13:30:52 +01:00
Johannes Schindelin
49d8331ed3 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>
2017-01-18 13:30:52 +01:00
Johannes Schindelin
ba3b425112 Merge pull request #866 from landstander668/add_platform
Add reporting of build platform
2017-01-18 13:30:51 +01:00
Johannes Schindelin
58dcb80555 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>
2017-01-18 13:30:51 +01:00
Johannes Schindelin
88f79614d5 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>
2017-01-18 13:30:50 +01:00
Johannes Schindelin
81b47ba1a7 Merge pull request #797 from glhez/master
`git bundle create <bundle>` leaks handle the revlist is empty.
2017-01-18 13:30:49 +01:00
Johannes Schindelin
1750ab4417 Merge 'release-gc-repack' into HEAD 2017-01-18 13:30:49 +01:00
Johannes Schindelin
1f830cc068 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-01-18 13:30:48 +01:00
Jeff Hostetler
ecbfc7b1a9 test-strcmp-offset: created test for strcmp_offset
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-01-18 13:30:47 +01:00
Jeff Hostetler
38bccc95f6 read-cache: speed up add_index_entry during checkout
Teach add_index_entry_with_check() and has_dir_name()
to see if the path of the new item is greater than the
last path in the index array before attempting to search
for it.

This is a performance optimization.

During checkout, merge_working_tree() populates the new
index in sorted order, so this change saves at least 2
lookups per file.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-01-18 13:30:47 +01:00
Jeff Hostetler
c99e82eb7e read-cache: run verify_hdr() in background thread
This is a performance optimization.

Teach do_read_index() to call verify_hdr() using a thread
and allow SHA1 verification to run concurrently with the
parsing of index-entries and extensions.

For large index files, this cuts the startup time in half.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2017-01-18 13:30:46 +01:00
Johannes Schindelin
e29800252d msvc: avoid debug assertion windows in Debug Mode
For regular debugging, it is pretty helpful when a debug assertion in a
running application triggers a window that offers to start the debugger.

However, when running the test suite, it is not so helpful, in
particular when the debug assertions are then suppressed anyway because
we disable the invalid parameter checking (via invalidcontinue.obj, see
the comment in config.mak.uname about that object for more information).

So let's simply disable that window in Debug Mode (it is already
disabled in Release Mode).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:45 +01:00
Johannes Schindelin
7215dbc862 Merge 'no-dashed-invocation' into HEAD 2017-01-18 13:30:44 +01:00
Johannes Schindelin
d2c15ed0a4 Merge 'misc-vs-fixes' into HEAD 2017-01-18 13:30:44 +01:00
Johannes Schindelin
b2abefac54 msvc: add a Makefile target to pre-generate the VS solution
The entire idea of generating the VS solution makes only sense if we
generate it via Continuous Integration; otherwise potential users would
still have to download the entire Git for Windows SDK.

So let's just add a target in the Makefile that can be used to generate
said solution; The generated files will then be committed so that they
can be pushed to a branch ready to check out by Visual Studio users.

To make things even more useful, we also generate and commit other files
that are required to run the test suite, such as templates and
bin-wrappers: with this, developers can run the test suite in a regular
Git Bash (that is part of a regular Git for Windows installation) after
building the solution in Visual Studio.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:43 +01:00
Johannes Schindelin
b99429930e msvc: fix make test without having to play PATH games
When building with Microsoft Visual C, we use NuGet to acquire the
dependencies (such as OpenSSL, cURL, etc). We even unpack those
dependencies.

This patch teaches the test suite to add the directory with the unpacked
.dll files to the PATH before running the tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:43 +01:00
Johannes Schindelin
5938d875e1 msvc: ignore incremental compile output
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:43 +01:00
Johannes Schindelin
51d7a6c877 msvc: ignore .dll files copied into the top-level directory
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:43 +01:00
Johannes Schindelin
dddac40bae msvc: tell Visual Studio where we expect NuGet packages to be unpacked
We already unpack the NuGet packages in a certain place, via
compat/vcbuild/Makefile. Let's let Visual Studio use the very same place.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:43 +01:00
Philip Oakley
9e4151f8ff msvc: add pragmas for common warnings
MSVC can be overzealous about some warnings. Disable them.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
2017-01-18 13:30:43 +01:00
Philip Oakley
be82159654 msvc: do not include inttypes.h
This file is not available in earlier MSVC versions, and it is not
necessary to include it with MSVC, anyway.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:43 +01:00
Philip Oakley
ed1dff6b20 msvc: add No_SafeExceptionHandler option
Microsoft flipped the Windows Safe Exception Handling default
in VS2013 so that zlib became unacceptable to certain OS versions
(Vista and subsequent 32-bit OS's) without the addition of
the option -SAFESEH:NO.

Provide a switch to disable the Safe Exception Handler when required.

The option ImageHasSafeExceptionHandlers for VS2013 is not available in
earlier versions, so use the SAFESEH:NO linker flag. See
https://msdn.microsoft.com/en-us/library/9a89h429.aspx for
further details.

This has only had limited testing due to the lack of a suitable system.

Helped-by: Yue Lin Ho <b8732003@student.nsysu.edu.tw>
Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:42 +01:00
Johannes Schindelin
e249474a8a Vcproj.pm: urlencode '<' and '>' when generating VC projects
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:42 +01:00
Johannes Schindelin
4b8e785720 Vcproj.pm: do not configure VCWebServiceProxyGeneratorTool
It is not necessary, and Visual Studio 2015 no longer supports it, anyway.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:42 +01:00
Philip Oakley
da7cdfa935 Vcproj.pm: provide more GUIDs
Needed for: test-config; t-dump-split-index; t-dump-untracked-cache;
t-fake-ssh; t-sha1-array; t-submodule-config.

Plus a few spares.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
2017-01-18 13:30:42 +01:00
Philip Oakley
40003ad707 Vcproj.pm: list git.exe first to be startup project
Visual Studio takes the first listed application/library as the default
startup project [1].

Detect the 'git' project and place it the head of the apps list, rather
than the tail.

Export the apps list before libs list for both the projects and global
structures of the .sln file.

[1] http://stackoverflow.com/questions/1238553/
vs2008-where-is-the-startup-project-setting-stored-for-a-solution
    "In the solution file, there are a list of pseudo-XML "Project"
    entries. It turns out that whatever is the first one ends up as
    the Startup Project, unless it’s overridden in the suo file. Argh.
    I just rearranged the order in the file and it’s good."

    "just moving the pseudo-xml isn't enough. You also have to move the
    group of entries in the "GlobalSection(ProjectConfigurationPlatforms)
    = postSolution" group that has the GUID of the project you moved to
    the top. So there are two places to move lines."

Signed-off-by: Philip Oakley <philipoakley@iee.org>
2017-01-18 13:30:42 +01:00
Philip Oakley
c7da1c0b52 Vcproj.pm: remove duplicate GUID
Delete the duplicated GUID from the generation code for the Visual Studio
.sln project file.

The duplicate GUID tended to be allocated to test-svn-fe, which was then
ignored by Visual Studio / MSVC, and its omission from the build never
noticed.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:42 +01:00
Johannes Schindelin
f34f747e07 contrib/buildsystems: make 'Restore NuGet Packages' work in Visual Studio
Visual Studio has this very neat feature that you can get dependencies in
the form of NuGet packages, and even further: you can specify in a project
what NuGet packages it needs. These dependencies can then be fetched via
right-clicking the solution in the Solution Explorer and clicking the
"Restore NuGet Packages" entry.

This feature is so neat, in fact, that we want to support it in Git for
Windows. The idea is that we will be able to provide developers with a
checkout of the Git sources that can be built outside of the Git for
Windows SDK, using *only* Visual Studio.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:42 +01:00
Johannes Schindelin
8866f1bf16 contrib/buildsystems: support modern Visual Studio project definitions
The .sln/.vcproj files were used to define projects up until Visual
Studio 2008, but starting with Visual Studio 2010 the project
definitions are stored in .sln/.vcxproj files (which can also be used
by the MSBuild system).

Let's just copy-edit the generator of the .vcproj files to a new
generator that produces .vcxproj files directly, without forcing Visual
Studio to upgrade the project definitions.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:42 +01:00
Johannes Schindelin
9d7b9c050a contrib/buildsystems: handle options starting with a slash
With the recent changes to allow building with MSVC=1, we now pass the
/OPT:REF option to the compiler. This confuses the parser that wants to
turn the output of a dry run into project definitions for QMake and Visual
Studio:

	Unhandled link option @ line 213: /OPT:REF at [...]

Let's just extend the code that passes through options that start with a
dash, so that it passes through options that start with a slash, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:42 +01:00
Philip Oakley
3dcb63f9d5 contrib/buildsystems: optionally capture the dry-run in a file
Add an option for capturing the output of the make dry-run used in
determining the msvc-build structure for easy debugging.

You can use the output of `--make-out <path>` in subsequent runs via the
`--in <path>` option.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:42 +01:00
Johannes Schindelin
07c55aadcf contrib/buildsystems: handle libiconv, too
Git's test suite shows tons of breakages unless Git is compiled
*without* NO_ICONV. That means, in turn, that we need to generate
build definitions *with* libiconv, which in turn implies that we
have to handle the -liconv option properly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:41 +01:00
Johannes Schindelin
fa04ac6a58 contrib/buildsystems: ignore irrelevant files in Generators/
The Generators/ directory can contain spurious files such as editors'
backup files. Even worse, there could be .swp files which are not even
valid Perl scripts.

Let's just ignore anything but .pm files in said directory.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:41 +01:00
Philip Oakley
703f06d1d5 contrib/buildsystems: handle the curl library option
Upon seeing the '-lcurl' option, point to the libcurl.lib.

While there, fix the elsif indentation.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-01-18 13:30:41 +01:00