Commit Graph

64928 Commits

Author SHA1 Message Date
Johannes Schindelin
2ca3333288 fixup! name-hash: precompute hash values during preload-index 2016-11-18 21:39:01 +01:00
Johannes Schindelin
a6b71974e4 fixup! hashmap: allow memihash computation to be continued 2016-11-18 21:38:58 +01:00
Johannes Schindelin
dee873cae6 fixup! name-hash: precompute hash values during preload-index 2016-11-18 21:38:40 +01:00
Johannes Schindelin
c6703c2465 Merge branch 'perl5lib'
With this topic branch, the PERL5LIB variable is unset to avoid external
settings from interfering with Git's own Perl interpreter.

This branch also cleans up some of our Windows-only config setting code
(and this will need to be rearranged in the next merging rebase so that
the cleanup comes first, and fscache and longPaths support build on
top).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-18 13:40:02 +01:00
Johannes Schindelin
ddd3bfb574 mingw: unset PERL5LIB by default
Git for Windows ships with its own Perl interpreter, and insists on
using it, so it will most likely wreak havoc if PERL5LIB is set before
launching Git.

Let's just unset that environment variables when spawning processes.

To make this feature extensible (and overrideable), there is a new
config setting `core.unsetenvvars` that allows specifying a
comma-separated list of names to unset before spawning processes.

Reported by Gabriel Fuhrmann.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-18 13:39:36 +01:00
Johannes Schindelin
4a803195c4 fixup! mingw: respect core.hidedotfiles = false in git-init again 2016-11-18 13:39:36 +01:00
Johannes Schindelin
6dc803c237 Move Windows-specific config settings into compat/mingw.c
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-18 13:39:36 +01:00
Johannes Schindelin
7b8583a8e7 Merge pull request #964 from jeffhostetler/jeffhostetler/memihash_perf
Jeffhostetler/memihash perf
2016-11-18 13:05:10 +01:00
Jeff Hostetler
bca14bed27 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-17 12:03:44 -05:00
Johannes Schindelin
4bf07f0430 Allow for platform-specific core.* config settings
In the Git for Windows project, we have ample precendent for config
settings that apply to Windows, and to Windows only.

Let's formalize this concept by introducing a platform_core_config()
function that can be #define'd in a platform-specific manner.

This will allow us to contain platform-specific code better, as the
corresponding variables no longer need to be exported so that they can
be defined in environment.c and be set in config.c

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-17 17:24:10 +01:00
Jeff Hostetler
b9e1bcb2ed 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-17 10:05:26 -05:00
Jeff Hostetler
0f0af882ce 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-17 09:59:59 -05:00
Jeff Hostetler
191198fc22 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-17 09:23:55 -05:00
Jeff Hostetler
dcfe80c0ec 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-17 09:14:40 -05:00
Johannes Schindelin
300f3464f7 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-16 17:49:17 +01:00
Johannes Schindelin
5ae8a3c0e2 giteveryday: unbreak rendering with AsciiDoctor
The "giteveryday" document has a callout list that contains a code
block. This is not a problem for AsciiDoc, but AsciiDoctor sadly was
explicitly designed *not* to render this correctly [*1*]. The symptom is
an unhelpful

	line 322: callout list item index: expected 1 got 12
	line 325: no callouts refer to list item 1
	line 325: callout list item index: expected 2 got 13
	line 327: no callouts refer to list item 2

In Git for Windows, we rely on the speed improvement of AsciiDoctor (on
this developer's machine, `make -j15 html` takes roughly 30 seconds with
AsciiDoctor, 70 seconds with AsciiDoc), therefore we need a way to
render this correctly.

The easiest way out is to simplify the callout list, as suggested by
AsciiDoctor's author, even while one may very well disagree with him
that a code block hath no place in a callout list.

*1*: https://github.com/asciidoctor/asciidoctor/issues/1478

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-16 17:40:56 +01:00
Johannes Schindelin
69ad100e7e fixup! asciidoctor: Fix giteveryday.txt to be built with asciidoctor. 2016-11-16 17:40:56 +01:00
Johannes Schindelin
395ee7843d Merge pull request #955 from jeffhostetler/jeffhostetler/preload_index_perf
preload-index: avoid lstat for skip-worktree items
2016-11-15 17:57:21 +01:00
Jeff Hostetler
6fb1322242 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-14 10:59:03 -05:00
Johannes Schindelin
fe046973c9 compat/vcbuild: possibly reuse Git for Windows' SDK's NuGet
In Git for Windows' SDK, there is already a script to package Git for
Windows as a NuGet package, downloading nuget.exe if needed.

Let's just fall back to using that executable (if it is there) if
nuget.exe was not found in the PATH.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-09 15:04:22 +01:00
Johannes Schindelin
5ea3f1965e git.rc: fix PATCHLEVEL detection with rc versions
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-11-09 14:09:54 +01:00
Johannes Schindelin
14910eab4b Merge pull request #948 from jeffhostetler/jeffhostetler/vs2015_optimize
Jeffhostetler/vs2015 optimize
2016-11-09 10:28:44 +01:00
Jeff Hostetler
fb81b85b0e vs2015: remove todo list item from README_vs2015.txt
Remove todo list item for vs2015 build notes regarding
the third party DLLs.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2016-11-08 11:41:45 -05:00
Jeff Hostetler
ab7a23114a vs2015: teach 'make clean' to delete PDBs
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2016-11-08 11:39:35 -05:00
Jeff Hostetler
87e8294207 vs2015: turn on optimize-for-speed in release build
Set -O2 (maximize speed) rather than -Os (favor small code)
for non-debug builds.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2016-11-08 11:18:43 -05:00
Johannes Schindelin
f37d3b7ba3 Merge pull request #940 from bbodenmiller/patch-1
fix issue template formatting
2016-11-04 13:49:06 +01:00
Johannes Schindelin
a89046e447 fixup! reset: support the experimental --stdin option
There is already a t7107 in current `pu`.
2016-11-04 13:39:35 +01:00
Johannes Schindelin
8e0ad47201 fixup! msvc: fix isatty() 2016-11-04 13:38:42 +01:00
Johannes Schindelin
ac221b3fa1 Merge pull request #938 from virtuald/patch-1
git-cvsexportcommit.perl: Force crlf translation
2016-11-04 12:29:06 +01:00
Ben Bodenmiller
77503ca3d6 enhance issue template formatting
remove additional lines in issue template to improve rendering of issues
filled out using template

Signed-off-by: Ben Bodenmiller <bbodenmiller@hotmail.com>
2016-11-04 04:04:17 -07:00
Dustin Spicuzza
4e77f6d6e1 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-03 11:54:32 -04:00
Johannes Schindelin
4614c34ded 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-10-29 10:41:40 +02:00
Johannes Schindelin
6a4dabc214 Merge branch 'pt/git4win-mods' of https://github.com/patthoyts/git-gui
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:40 +02:00
Johannes Schindelin
19d4ead2b2 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-10-29 10:41:40 +02:00
Johannes Schindelin
4db6fedf3b 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-10-29 10:41:40 +02:00
Johannes Schindelin
f94d3069cf Merge pull request #866 from landstander668/add_platform
Add reporting of build platform
2016-10-29 10:41:40 +02:00
Johannes Schindelin
81aa8c2166 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-10-29 10:41:40 +02:00
Johannes Schindelin
cd91276426 Merge 'cat-file-filters'
This topic branch adds the support for --filters (TAFKA --smudge) and
--path (TAFKA --use-path).

While at it, we also add support for --filters/--textconv in --batch mode
(the input lines now need to contain the path in addition to the object
name, separated by a single white space character).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:39 +02:00
Johannes Schindelin
055babf7b3 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-10-29 10:41:39 +02:00
Johannes Schindelin
7c22e5e3a0 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-10-29 10:41:39 +02:00
Johannes Schindelin
4bdc1ae668 Merge pull request #797 from glhez/master
`git bundle create <bundle>` leaks handle the revlist is empty.
2016-10-29 10:41:39 +02:00
Johannes Schindelin
74ea8fc626 reset: support the experimental --stdin option
Just like with other Git commands, this option makes it read the paths
from the standard input. It comes in handy when resetting many, many
paths at once and wildcards are not an option (e.g. when the paths are
generated by a tool).

Note: we first parse the entire list and perform the actual reset action
only in a second phase. Not only does this make things simpler, it also
helps performance, as do_diff_cache() traverses the index and the
(sorted) pathspecs in simultaneously to avoid unnecessary lookups.

This feature is marked experimental because it is still under review in
the upstream Git project.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:38 +02:00
Johannes Schindelin
2faf5f6b58 Merge 'release-gc-repack' into HEAD 2016-10-29 10:41:38 +02:00
Johannes Schindelin
1abb9c5218 Merge pull request #726 from orgads/git-gui-preserve-author-windows
git-gui: Do not reset author details on amend
2016-10-29 10:41:38 +02:00
Johannes Schindelin
fba0367f14 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-10-29 10:41:38 +02:00
Pat Thoyts
3c8202075b git-gui (Windows): use git-gui.exe in Create Desktop Shortcut
When calling `Repository>Create Desktop Shortcut`, Git GUI assumes
that it is okay to call `wish.exe` directly on Windows. However, in
Git for Windows 2.x' context, that leaves several crucial environment
variables uninitialized, resulting in a shortcut that does not work.

To fix those environment variable woes, Git for Windows comes with a
convenient `git-gui.exe`, so let's just use it when it is available.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:23 +02:00
Pat Thoyts
17b04073b4 git-gui: fix detection of Cygwin
MSys2 might *look* like Cygwin, but it is *not* Cygwin... Unless it
is run with `MSYSTEM=MSYS`, that is.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:23 +02:00
Johannes Schindelin
840bc860ce mingw: abort on invalid strftime formats
On Windows, strftime() does not silently ignore invalid formats, but
warns about them and then returns 0 and sets errno to EINVAL.

Unfortunately, Git does not expect such a behavior, as it disagrees
with strftime()'s semantics on Linux. As a consequence, Git
misinterprets the return value 0 as "I need more space" and grows the
buffer. As the larger buffer does not fix the format, the buffer grows
and grows and grows until we are out of memory and abort.

Ideally, we would switch off the parameter validation just for
strftime(), but we cannot even override the invalid parameter handler
via _set_thread_local_invalid_parameter_handler() using MINGW because
that function is not declared. Even _set_invalid_parameter_handler(),
which *is* declared, does not help, as it simply does... nothing.

So let's just bite the bullet and override strftime() for MINGW and
abort on an invalid format string. While this does not provide the
best user experience, it is the best we can do.

See https://msdn.microsoft.com/en-us/library/fe06s4ak.aspx for more
details.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:22 +02:00
Adric Norris
82e7b98130 Preliminary support for reporting build platform
Add preliminary support for detection of the build plaform, and reporting
of same with the `git version --build-options' command. This can be useful
for bug reporting, to distinguish between 32 and 64-bit builds for
example.

The current implementation can only distinguish between x86 and x86_64.
This will be extended in future patches. In addition, all 32-bit variants
(i686, i586, etc.) are collapsed into `x86'. An example of the output is:

   $ git version --build-options
   git version 2.9.3.windows.2.826.g06c0f2f
   sizeof-long: 4
   machine: x86_64

The label of `machine' was chosen so the new information will approximate
the output of `uname -m'.

Signed-off-by: Adric Norris <landstander668@gmail.com>
2016-10-29 10:41:22 +02:00
Johannes Schindelin
06349e0866 Merge 'rebase-i-extra' into HEAD 2016-10-29 10:41:21 +02:00