Commit Graph

65898 Commits

Author SHA1 Message Date
Johannes Schindelin
4e02fbfe3c obstack: fix compiler warning
MS Visual C suggests that the construct

	condition ? (int) i : (ptrdiff_t) d

is incorrect. Let's fix this by casting to ptrdiff_t also for the
positive arm of the conditional.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-30 15:30:36 +01:00
Philip Oakley
18ff3df3de Avoid multiple PREFIX definitions
The short and sweet PREFIX can be confused when used in many places.

Rename both usages to better describe their purpose. EXEC_CMD_PREFIX is
used in full to disambiguate it from the nearby GIT_EXEC_PATH.

The PREFIX in sideband.c, while nominally independant of the exec_cmd
PREFIX, does reside within libgit[1], so the definitions would clash
when taken together with a PREFIX given on the command line for use by
exec_cmd.c.

Noticed when compiling Git for Windows using MSVC/Visual Studio [1] which
reports the conflict beteeen the command line definition and the
definition in sideband.c within the libgit project.

[1] the libgit functions are brought into a single sub-project
within the Visual Studio construction script provided in contrib,
and hence uses a single command for both exec_cmd.c and sideband.c.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
2016-11-30 15:30:36 +01:00
Philip Oakley
5036e9f3d7 perl/Makefile: treat a missing PM.stamp as if empty
'make clean', or a 'git clean -dfx' will delete the PM stamp file,
so it cannot be a direct target in such clean conditions, resulting
in an error.

Normally the PM.stamp is recreated by the git/Makefile, except when
a dry-run is requested, for example, as used in the msysgit msvc-build
script which implements the compat/vcbuild/README using
contrib/buildsystems. The script msvc-build is introduced later in this
series.

Protect the PM.stamp target when the PM.stamp file does not exist,
allowing a Git 'Makefile -n' to succeed on a clean repo.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
---
This is development of the original "[PATCH 4/17] Makefile: a dry-run
can error out if no perl. Document the issue" 2015-06-25,
(http://marc.info/?l=git&m=143519054716960&w=2), which simply documented
the issue and then used NO_PERL to avoid the problem. See follow on
email thread for some discussion.
2016-11-30 15:30:35 +01:00
Johannes Schindelin
4c1e67488b Really work around "uninitialized value" warning
Ever since 457f08a (git-rev-list: add --bisect-vars option.,
2007-03-21), Git's source code uses the following trick to fool GCC into
*not* warning about uninitialized values:

	int value = value;

We use this trick to silence the "warning: ‘x’ is used uninitialized in
this function [-Wuninitialized]" when the variables are not really used
uninitialized (but it is hard for the compiler to determine that).

This trick works well for GCC, and even Clang seems to appease that
workaround.

Not so Visual C. It does realize that this is just a trick to fool it,
and it simply refuses to be fooled.

The only way to silence the warning for Visual C would be to write
something like this:

	#pragma warning(suppress: 4700)
	int value;

Obviously this is not portable, and neither is that trick that fools
GCC. So let's just introduce a new macro that continues to fool GCC, but
simply initializes the values everywhere else.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-30 15:30:35 +01:00
Johannes Schindelin
5f3656e4b4 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-24 22:31:28 +01:00
Johannes Schindelin
936afe95d1 Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2016-11-24 22:11:11 +01:00
Johannes Schindelin
a431a5fd4b Merge pull request #964 from jeffhostetler/jeffhostetler/memihash_perf
Jeffhostetler/memihash perf
2016-11-24 22:11:10 +01:00
Johannes Schindelin
1d2552ee11 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>
2016-11-24 22:11:10 +01:00
Jeff Hostetler
19aaf301cf name-hash: remember previous dir_entry during lazy_init_name_hash
Teach hash_dir_entry() to remember the previously found dir_entry
during lazy_init_name_hash() iteration.  This is a performance
optimization.  Since items in the index array are sorted by full
pathname, adjacent items are likely to be in the same directory.
This can save memihash() computations and HashMap lookups.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2016-11-24 22:11:10 +01:00
Jeff Hostetler
4a64b91afc name-hash: specify initial size for istate.dir_hash table
Specify an initial size for the istate.dir_hash HashMap matching
the size of the istate.name_hash.

Previously hashmap_init() was given 0, causing a 64 bucket
hashmap to be created.  When working with very large
repositories, this would cause numerous rehash() calls to
realloc and rebalance the hashmap. This is especially true
when the worktree is deep, with many directories containing
a few files.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2016-11-24 22:11:10 +01:00
Jeff Hostetler
79bcd45598 name-hash: precompute hash values during preload-index
Precompute the istate.name_hash and istate.dir_hash values
for each cache-entry during the preload-index phase.

Move the expensive memihash() calculations from lazy_init_name_hash()
to the multi-threaded preload-index phase.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2016-11-24 22:11:10 +01:00
Jeff Hostetler
f2cbea605c hashmap: allow memihash computation to be continued
Add variant of memihash() to allow the hash computation to
be continued.  There are times when we compute the hash on
a full path and then the hash on just the path to the parent
directory.  This can be expensive on large repositories.

With this, we can hash the parent directory first. And then
continue the computation to include the "/filename".

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2016-11-24 22:11:10 +01:00
Jeff Hostetler
eeb2150b71 name-hash: eliminate duplicate memihash call
Remove duplicate memihash() call in hash_dir_entry().
The existing code called memihash() to do the find_dir_entry()
and it not found, called memihash() again to do the hashmap_add().

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2016-11-24 22:11:09 +01:00
Johannes Schindelin
ae75e8c5ad Merge pull request #955 from jeffhostetler/jeffhostetler/preload_index_perf
preload-index: avoid lstat for skip-worktree items
2016-11-24 22:11:08 +01:00
Jeff Hostetler
c4d2b1b44e preload-index: avoid lstat for skip-worktree items
Teach preload-index to avoid lstat() calls for index-entries
with skip-worktree bit set.  This is a performance optimization.

During a sparse-checkout, the skip-worktree bit is set on items
that were not populated and therefore are not present in the
worktree.  The per-thread preload-index loop performs a series
of tests on each index-entry as it attempts to compare the
worktree version with the index and mark them up-to-date.
This patch short-cuts that work.

On a Windows 10 system with a very large repo (450MB index)
and various levels of sparseness, performance was improved
in the {preloadindex=true, fscache=false} case by 80% and
in the {preloadindex=true, fscache=true} case by 20% for various
commands.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2016-11-24 22:11:08 +01:00
Johannes Schindelin
95a19dd11e Merge pull request #938 from virtuald/patch-1
git-cvsexportcommit.perl: Force crlf translation
2016-11-24 22:11:07 +01:00
Dustin Spicuzza
a1d5be54c8 cvsexportcommit: force crlf translation
When using cvsnt + msys + git, it seems like the output of cvs status
had \r\n in it, and caused the command to fail.

This fixes that.

Signed-off-by: Dustin Spicuzza <dustin@virtualroadside.com>
2016-11-24 22:11:06 +01:00
Johannes Schindelin
5a55613426 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>
2016-11-24 22:11:05 +01:00
Johannes Schindelin
cc297c59a5 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>
2016-11-24 22:11:04 +01:00
Johannes Schindelin
6f92bb1ba8 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>
2016-11-24 22:11:04 +01:00
Johannes Schindelin
61feb7cf88 Merge pull request #866 from landstander668/add_platform
Add reporting of build platform
2016-11-24 22:11:02 +01:00
Johannes Schindelin
29bcd1a3ff Merge branch 'interactive-rebase'
This series of branches introduces the git-rebase--helper, a builtin
helping to accelerate the interactive rebase dramatically.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-24 22:11:01 +01:00
Johannes Schindelin
718dae2676 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>
2016-11-24 22:11:00 +01:00
Johannes Schindelin
7ba775a22e 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>
2016-11-24 22:10:59 +01:00
Johannes Schindelin
c9b76ac281 Merge pull request #797 from glhez/master
`git bundle create <bundle>` leaks handle the revlist is empty.
2016-11-24 22:10:58 +01:00
Johannes Schindelin
707f86684d Merge 'release-gc-repack' into HEAD 2016-11-24 22:10:56 +01:00
Johannes Schindelin
1be6fd2c5a 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>
2016-11-24 22:10:55 +01:00
Johannes Schindelin
ea292b51b8 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>
2016-11-24 22:10:52 +01:00
Johannes Schindelin
bfe52cfdd7 Merge pull request #677 from yaras/fix-git-675
Fixed masking username with asterisks when reading credentials
2016-11-24 22:10:51 +01:00
Johannes Schindelin
763e325fe8 Merge 'git-gui-add-2nd-line' into HEAD 2016-11-24 22:10:50 +01:00
Johannes Schindelin
70ff6f3b23 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>
2016-11-24 22:10:48 +01:00
Johannes Schindelin
c2213ca59b 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>
2016-11-24 22:10:47 +01:00
Johannes Schindelin
60b60cfd75 Merge 'unc-alternates' into HEAD 2016-11-24 22:10:46 +01:00
Johannes Schindelin
954b2ba8ef Merge pull request #552 from duncansmart/fix-vcproj-gen
Fix Visual Studio .sln/.vcproj generation.
2016-11-24 22:10:45 +01:00
Johannes Schindelin
d42571973b Merge pull request #773 from jeffhostetler/vs2015
Build with VS2015
2016-11-24 22:10:44 +01:00
Johannes Schindelin
b6b58ce1d1 Merge pull request #305 from dscho/msysgit_issues_182
Allow `add -p` and `add -i` with a large number of files
2016-11-24 22:10:42 +01:00
Johannes Schindelin
edddff8a15 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>
2016-11-24 22:10:41 +01:00
Johannes Schindelin
9908a38f3a Merge pull request #159 from dscho/vagrant
Add Vagrant support (easy Linux VM setup)
2016-11-24 22:10:40 +01:00
Johannes Schindelin
b4458812f1 Merge 'mingw-getcwd' into HEAD 2016-11-24 22:10:39 +01:00
Johannes Schindelin
fa39c208c7 Merge pull request #443 from kblees/kb/nanosecond-file-times-v2.5.3
nanosecond file times for v2.5.3
2016-11-24 22:10:37 +01:00
Johannes Schindelin
d98ee5d10d Merge pull request #156 from kblees/kb/symlinks
Symlink support
2016-11-24 22:10:36 +01:00
Johannes Schindelin
e82cdd0206 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>
2016-11-24 22:10:35 +01:00
Johannes Schindelin
92c84f109d Merge 'fix-is-exe' into HEAD 2016-11-24 22:10:34 +01:00
Johannes Schindelin
7a54e15c85 Merge 'fix-externals' into HEAD 2016-11-24 22:10:33 +01:00
Johannes Schindelin
f3c2525785 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>
2016-11-24 22:10:31 +01:00
Johannes Schindelin
bd64a95022 Merge 'win-tests-fixes' into HEAD 2016-11-24 22:10:30 +01:00
Johannes Schindelin
65ca3b36d6 Merge 'msys2' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-24 22:10:29 +01:00
Johannes Schindelin
b9b82386c0 Merge 'resource-version' into HEAD 2016-11-24 22:10:28 +01:00
Johannes Schindelin
77295001ba Merge 'jberezanski/wincred-sso-r2' into HEAD 2016-11-24 22:10:27 +01:00
Johannes Schindelin
e16e0643b7 Merge 'gitk' into HEAD 2016-11-24 22:10:25 +01:00