Commit Graph

66253 Commits

Author SHA1 Message Date
Johannes Schindelin
853d2282ca merge-octopus: avoid dashed invocation
A long time ago, in turn a long time after introducing builtins and
moving Git's scripts to libexec/git-core/, we deprecated the invocation
of dashed commands.

The merge-octopus script is a holdover from the time before that, as it
still tries to invoke a builtin by its dashed form. Let's just not.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-12-12 22:31:40 +01:00
Johannes Schindelin
a30b95fd34 stash: avoid dashed invocation
The invocation of dashed Git commands was rightfully deprecated a long
time ago. We failed to heed that deprecation ourselves, but it is never
too late...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-12-12 22:31:39 +01:00
Johannes Schindelin
632ea98b76 rebase--merge: avoid dashed invocation
We deprecated the dashed invocations ages ago. Might just as well hold
ourselves to that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-12-12 22:31:39 +01:00
Johannes Schindelin
a604537cb5 merge-resolve: avoid dashed call
We started deprecating the dashed form a long time ago, advertising the
fact that dashed invocations of Git commands are deprecated for several
major versions.

Yet we still used them ourselves.

With ashes on our heads, we now start to finally get rid of those calls.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-12-12 22:31:39 +01:00
Johannes Schindelin
751862953a git: avoid calling aliased builtins via their dashed form
This is one of the few places where Git violates its own deprecation of
the dashed form. It is not necessary, either.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-12-12 22:31:39 +01:00
Johannes Schindelin
58e7864ffb Start the merging-rebase to junio/maint
The changes in upstream/maint are actually not really that crucial for Git
for Windows, but we can use it as an excuse to fix the branch thicket: the
`visual-studio` branch clearly wants to be based on the
`jeffhostetler/vs2015` branch, as the latter contains important compile
fixes for Visual C, required to build inside Visual Studio.

While at it, we also move the Vagrant patches farther to the end, as they
are unlikely to be accepted upstream, so we'll try only after getting the
MSVC/VS patches in.

Also, let's reorder a couple other patches into more logical places.

This commit starts the rebase of 4638a925c0 to a274e0a036

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-12-12 22:29:21 +01:00
Johannes Schindelin
6119d9b81b Merge pull request #991 from jeffhostetler/jeffhostetler/string_list_realloc
string-list: use ALLOC_GROW macro when reallocing string_list
2016-12-12 22:06:20 +01:00
Johannes Schindelin
e62496e150 mingw: intercept isatty() to handle /dev/null as Git expects it
When Git's source code calls isatty(), it really asks whether the
respective file descriptor is connected to an interactive terminal.

Windows' _isatty() function, however, determines whether the file
descriptor is associated with a character device. And NUL, Windows'
equivalent of /dev/null, is a character device.

Which means that for years, Git mistakenly detected an associated
interactive terminal when being run through the test suite, which
almost always redirects stdin, stdout and stderr to /dev/null.

This bug only became obvious, and painfully so, when the new
bisect--helper entered the `pu` branch and made the automatic build & test
time out because t6030 was waiting for an answer.

For details, see

	https://msdn.microsoft.com/en-us/library/f4s0ddew.aspx

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-12-12 21:51:27 +01:00
Johannes Schindelin
518cd0cece Merge tag 'prerelease-v2.11.0.windows.1.1'
This merges the "Pre-release to test fixes for #981 and #987".

These commits were actually meant to land in `master` before merging the
Pull Requests; Better late than never.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-12-12 21:49:20 +01:00
Jeff Hostetler
642d8280a4 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>
2016-12-12 12:49:46 -05:00
Johannes Schindelin
13d7269108 Merge pull request #988 from jeffhostetler/jeffhostetler/quick_add_index_entry
read-cache: speed up add_index_entry during checkout
2016-12-12 18:21:56 +01:00
Johannes Schindelin
c480725840 version --build-options: report commit, too, if possible
In particular when local tags are used (or tags that are pushed to some
fork) to build Git, it is very hard to figure out from which particular
revision a particular Git executable was built.

Let's just report that in our build options.

We need to be careful, though, to report when the current commit cannot be
determined, e.g. when building from a tarball without any associated Git
repository.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-12-09 17:53:07 +01:00
Johannes Schindelin
114042a3dd 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>
2016-12-09 17:53:05 +01:00
Jeff Hostetler
3afab69e64 test-strcmp-offset: created test for strcmp_offset
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2016-12-08 10:23:33 -05:00
Jeff Hostetler
7e30f971f0 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>
2016-12-08 10:23:33 -05:00
Junio C Hamano
a274e0a036 Sync with maint-2.10
* maint-2.10:
  preparing for 2.10.3
2016-12-05 11:25:47 -08:00
Junio C Hamano
c3808ca698 preparing for 2.10.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-05 11:25:02 -08:00
Junio C Hamano
cd1c2e7301 Merge branch 'jk/common-main' into maint-2.10
* jk/common-main:
  common-main: stop munging argv[0] path
  git-compat-util: move content inside ifdef/endif guards
2016-12-05 11:24:28 -08:00
Johannes Schindelin
8e6ca48956 Merge pull request #978 from jeffhostetler/jeffhostetler/thread_verify_hdr
read-cache: run verify_hdr() in background thread
2016-12-02 16:31:56 +01:00
Jeff Hostetler
05f02133cb 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>
2016-12-01 14:39:42 -05:00
Johannes Schindelin
d661ea9455 Merge 'misc-vs-fixes-extra' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-30 23:42:15 +01:00
Johannes Schindelin
8e4b8e4f81 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>
2016-11-30 23:34:56 +01:00
Johannes Schindelin
056b413116 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>
2016-11-30 18:03:10 +01:00
Johannes Schindelin
6ce069a772 Merge branch 'cherry-pick-segfault'
This branch fixes the problem where merge-recursive's add_cacheinfo()
expected refresh_cache_entry() always to return a valid cache entry (but
it does not do that e.g. when the file in the worktree is modified).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-30 18:02:32 +01:00
Johannes Schindelin
2ccd85831f Merge branch 'builtin-difftool'
This topic branch brings the new, experimental builtin version of the
difftool into Git for Windows' master branch.

It still hands off to the legacy Perl script unless the feature flag is
flipped: only when the config setting difftool.useBuiltin is set to true
will `git difftool` actually use the experimental builtin. The idea is to
play it safe for the majority of users, but to allow heavy difftool users
to test early and to help make the builtin robust, before we actually
retire the Perl script.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-30 18:01:54 +01:00
Johannes Schindelin
38c56e3d45 Merge 'no-dashed-invocation' into HEAD 2016-11-30 17:59:20 +01:00
Johannes Schindelin
1501e605d6 Merge 'misc-vs-fixes' into HEAD 2016-11-30 17:59:18 +01:00
Johannes Schindelin
bdd78f9aec 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>
2016-11-30 17:59:18 +01:00
Johannes Schindelin
b91836a6ed 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>
2016-11-30 17:59:18 +01:00
Johannes Schindelin
53b2de33bb msvc: ignore incremental compile output
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-30 17:59:18 +01:00
Johannes Schindelin
b7de342589 msvc: ignore .dll files copied into the top-level directory
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-30 17:59:18 +01:00
Johannes Schindelin
dc78302fdc 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>
2016-11-30 17:59:18 +01:00
Philip Oakley
6c2d418326 msvc: add pragmas for common warnings
MSVC can be overzealous about some warnings. Disable them.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
2016-11-30 17:59:18 +01:00
Philip Oakley
8bd9d7416a 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>
2016-11-30 17:59:18 +01:00
Philip Oakley
56c8db2f51 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>
2016-11-30 17:59:17 +01:00
Johannes Schindelin
161ab2a223 Vcproj.pm: urlencode '<' and '>' when generating VC projects
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-30 17:59:17 +01:00
Johannes Schindelin
ff446724b1 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>
2016-11-30 17:59:17 +01:00
Philip Oakley
98438950e9 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>
2016-11-30 17:59:17 +01:00
Philip Oakley
4b3c8b01d8 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>
2016-11-30 17:59:17 +01:00
Philip Oakley
3116872079 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>
2016-11-30 17:59:17 +01:00
Johannes Schindelin
526ab50bb6 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>
2016-11-30 17:59:17 +01:00
Johannes Schindelin
0109f03274 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>
2016-11-30 17:59:17 +01:00
Johannes Schindelin
e77e645562 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>
2016-11-30 17:59:17 +01:00
Philip Oakley
142041123c 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>
2016-11-30 17:59:17 +01:00
Johannes Schindelin
cd62af22fc 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>
2016-11-30 17:59:17 +01:00
Johannes Schindelin
6b376d0ac3 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>
2016-11-30 17:59:17 +01:00
Philip Oakley
d56e0e5464 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>
2016-11-30 17:59:16 +01:00
Philip Oakley
df0fd7cddd contrib/buildsystems: redirect errors of the dry run into a log file
Rather than swallowing the errors, it is better to have them in a file.

To make it obvious what this is about, use the file name
'msvc-build-makedryerrors.txt'.

Further, if the output is empty, simply delete that file. As we target
Git for Windows' SDK (which, unlike its predecessor msysGit, offers
Perl versions newer than 5.8), we can use the quite readable syntax
`if -f -z $ErrsFile` (available in Perl >=5.10).

Note that the file will contain the new values of the GIT_VERSION
and GITGUI_VERSION if they were generated by the make file. They
are omitted if the release is tagged and indentically defined in
their respective GIT_VERSION_GEN file DEF_VER variables.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-30 17:59:16 +01:00
Philip Oakley
a40e119986 contrib/buildsystems: ignore gettext stuff
Git's build contains steps to handle internationalization. This caused
hiccups in the parser used to generate QMake/Visual Studio project files.

As those steps are irrelevant in this context, let's just ignore them.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-30 17:59:16 +01:00
Philip Oakley
f233b5ce42 contrib/buildsystems: handle quoted spaces in filenames
The engine.pl script expects file names not to contain spaces. However,
paths with spaces are quite prevalent on Windows. Use shellwords() rather
than split() to parse them correctly.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-30 17:59:16 +01:00