Commit Graph

49818 Commits

Author SHA1 Message Date
Karsten Blees
d006a7d4ef Win32: add a cache below mingw's lstat and dirent implementations
Checking the work tree status is quite slow on Windows, due to slow lstat
emulation (git calls lstat once for each file in the index). Windows
operating system APIs seem to be much better at scanning the status
of entire directories than checking single files.

Add an lstat implementation that uses a cache for lstat data. Cache misses
read the entire parent directory and add it to the cache. Subsequent lstat
calls for the same directory are served directly from the cache.

Also implement opendir / readdir / closedir so that they create and use
directory listings in the cache.

The cache doesn't track file system changes and doesn't plug into any
modifying file APIs, so it has to be explicitly enabled for git functions
that don't modify the working copy.

Note: in an earlier version of this patch, the cache was always active and
tracked file system changes via ReadDirectoryChangesW. However, this was
much more complex and had negative impact on the performance of modifying
git commands such as 'git checkout'.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-29 10:49:05 +02:00
Karsten Blees
e4c6557897 add infrastructure for read-only file system level caches
Add a macro to mark code sections that only read from the file system,
along with a config option and documentation.

This facilitates implementation of relatively simple file system level
caches without the need to synchronize with the file system.

Enable read-only sections for 'git status' and preload_index.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-29 10:49:05 +02:00
Karsten Blees
3a9194d06c Win32: make the lstat implementation pluggable
Emulating the POSIX lstat API on Windows via GetFileAttributes[Ex] is quite
slow. Windows operating system APIs seem to be much better at scanning the
status of entire directories than checking single files. A caching
implementation may improve performance by bulk-reading entire directories
or reusing data obtained via opendir / readdir.

Make the lstat implementation pluggable so that it can be switched at
runtime, e.g. based on a config option.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-29 10:49:05 +02:00
Karsten Blees
13304841e2 Win32: Make the dirent implementation pluggable
Emulating the POSIX dirent API on Windows via FindFirstFile/FindNextFile is
pretty staightforward, however, most of the information provided in the
WIN32_FIND_DATA structure is thrown away in the process. A more
sophisticated implementation may cache this data, e.g. for later reuse in
calls to lstat.

Make the dirent implementation pluggable so that it can be switched at
runtime, e.g. based on a config option.

Define a base DIR structure with pointers to readdir/closedir that match
the opendir implementation (i.e. similar to vtable pointers in OOP).
Define readdir/closedir so that they call the function pointers in the DIR
structure. This allows to choose the opendir implementation on a
call-by-call basis.

Move the fixed sized dirent.d_name buffer to the dirent-specific DIR
structure, as d_name may be implementation specific (e.g. a caching
implementation may just set d_name to point into the cache instead of
copying the entire file name string).

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-29 10:49:05 +02:00
Karsten Blees
2e3a8ea2c5 Win32: dirent.c: Move opendir down
Move opendir down in preparation for the next patch.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-29 10:49:05 +02:00
Karsten Blees
01e27562da Win32: make FILETIME conversion functions public
Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-29 10:49:05 +02:00
Pat Thoyts
1486bd4cbc mingw: add tests for the hidden attribute on the git directory
With msysGit the .git directory is supposed to be hidden, unless it is
a bare git repository. Test this.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2015-04-29 10:47:56 +02:00
Johannes Schindelin
ccd5a3d47c When initializing .git/, record the current setting of core.hideDotFiles
This is on Windows only, of course.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-29 10:47:56 +02:00
Erik Faye-Lund
eec9973a46 core.hidedotfiles: hide '.git' dir by default
At least for cross-platform projects, it makes sense to hide the
files starting with a dot, as this is the behavior on Unix/MacOSX.

However, at least Eclipse has problems interpreting the hidden flag
correctly, so the default is to hide only the .git/ directory.

The config setting core.hideDotFiles therefore supports not only
'true' and 'false', but also 'dotGitOnly'.

[jes: clarified the commit message, made git init respect the setting
by marking the .git/ directory only after reading the config, and added
documentation, and rebased on top of current junio/next]

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-29 10:47:56 +02:00
Johannes Schindelin
daaa7cdcb5 Start the merging-rebase to v2.3.7
This commit starts the rebase of 16685c2 to b17db4d
2015-04-29 10:47:55 +02:00
dscho
34d07cc585 Merge pull request #119 from nalla/link-to-governance-model
readme: added link to governance model
2015-04-28 15:35:21 +02:00
마누엘
18864ff2a3 readme: added link to governance model
After publishing the governance model on the [developer
page](http://git-for-windows.github.io), lets add a link on the
`README.md` too.

Signed-off-by: 마누엘 <nalla@hamal.uberspace.de>
2015-04-28 14:52:25 +02:00
Junio C Hamano
16018ae5fb Git 2.3.7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.3.7
2015-04-27 12:25:36 -07:00
Junio C Hamano
ad34ad614d Merge branch 'tb/connect-ipv6-parse-fix' into maint
An earlier update to the parser that disects a URL broke an
address, followed by a colon, followed by an empty string (instead
of the port number), e.g. ssh://example.com:/path/to/repo.

* tb/connect-ipv6-parse-fix:
  connect.c: ignore extra colon after hostname
2015-04-27 12:23:54 -07:00
Junio C Hamano
89ba311df3 Merge branch 'ma/bash-completion-leaking-x' into maint
The completion script (in contrib/) contaminated global namespace
and clobbered on a shell variable $x.

* ma/bash-completion-leaking-x:
  completion: fix global bash variable leak on __gitcompappend
2015-04-27 12:23:51 -07:00
Junio C Hamano
631f6f1d47 Merge branch 'jc/push-cert' into maint
The "git push --signed" protocol extension did not limit what the
"nonce" that is a server-chosen string can contain or how long it
can be, which was unnecessarily lax.  Limit both the length and the
alphabet to a reasonably small space that can still have enough
entropy.

* jc/push-cert:
  push --signed: tighten what the receiving end can ask to sign
2015-04-27 12:23:50 -07:00
Johannes Schindelin
9ba1ada8de squash! windows_wide_config: Fix wbuffer to be of the wchar_t type
With the next merging rebase, replace the commit subject with

fixup! Windows: use %PROGRAMDATA%\Git\config as Windows-wide configuration

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-27 15:49:06 +02:00
dscho
11fb9e096a Merge pull request #118 from git-for-windows/fix-windows_wide_config
windows_wide_config: Fix wbuffer to be of the wchar_t type
2015-04-27 15:46:46 +02:00
Sebastian Schuberth
145027bc2a windows_wide_config: Fix wbuffer to be of the wchar_t type
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2015-04-27 12:29:02 +02:00
Johannes Schindelin
505857c0c7 squash! git am: ignore dirty submodules
Drop this patch because it prevents `git rebase --continue` after
resolving a submodule-only commit's conflict during a rebase.

This reverts commit fbe1f041f9890f4b2eea3ed2265f82c9b845a39b.
2015-04-27 10:02:32 +02:00
Johannes Schindelin
00fb16b7d4 Merge remote-tracking branch 'dscho/xp-config'
This topic branch supports a Windows-wide config on Windows XP, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-25 09:37:11 +00:00
Johannes Schindelin
4583e6bebd squash! Windows: use %PROGRAMDATA%\Git\config as Windows-wide configuration
On XP, there is no %PROGRAMDATA%, therefore we need to use
"%ALLUSERSPROFILE%\Application Data\Git\config" in those setups.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-24 11:49:17 +01:00
Johannes Schindelin
cc9730bd66 Merge pull request #104 from dscho/super-config
Add support for %PROGRAMDATA%\Git\config

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:20:05 +01:00
Johannes Schindelin
669fe4daf5 Document the Windows-wide config file
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:19:39 +01:00
Johannes Schindelin
297386b227 Windows: use %PROGRAMDATA%\Git\config as Windows-wide configuration
Between the libgit2 and the Git for Windows project, there has been a
discussion how we could share Git configuration to avoid duplication (or
worse: skew).

Earlier, libgit2 was nice enough to just re-use Git for Windows'

	C:\Program Files (x86)\Git\etc\gitconfig

but with the upcoming Git for Windows 2.x, there would be more paths to
search, as we will have 64-bit and 32-bit versions, and the
corresponding config files will be in %PROGRAMFILES%\Git\mingw64\etc and
...\mingw32\etc, respectively.

Therefore we came to a consensus to use %PROGRAMDATA%\Git as the
location for Git-specific files that are of wider interest than just Git
for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:19:33 +01:00
Johannes Schindelin
2120bb9ddd Merge pull request #60 from weakcamel/fscanf-64bit-constants
Correct fscanf formatting string for I64u values

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:18:50 +01:00
Waldek Maleska
153f6bd94f Correct fscanf formatting string for I64u values
Signed-off-by: Waldek Maleska <w.maleska@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:18:46 +01:00
Johannes Schindelin
4cc73f766e Merge pull request #98 from nalla/stdout-unbuffered
mingw: explicitly `fflush` stdout
2015-04-23 10:18:37 +01:00
nalla
a49305f98c mingw: explicitly fflush stdout
For performance reasons `stdout` is not unbuffered by default. That leads
to problems if after printing to `stdout` a read on `stdin` is performed.

For that reason interactive commands like `git clean -i` do not function
properly anymore if the `stdout` is not flushed by `fflush(stdout)` before
trying to read from `stdin`.

In the case of `git clean -i` all reads on `stdin` were preceded by a
`fflush(stdout)` call.

Signed-off-by: nalla <nalla@hamal.uberspace.de>
2015-04-23 10:18:33 +01:00
Johannes Schindelin
b0e7bd771e Merge pull request #93 from nalla/asciidoctor-fixes
Asciidoctor fixes

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:18:18 +01:00
nalla
5713fdc791 asciidoctor: Fix giteveryday.txt to be built with asciidoctor.
When building the `doc` with `asciidoctor`, `asciidoctor` complains about
a nested code block in a callout list. This is a really dirty solution to
restore the callout list to function properly. There is a minimal visual
sideeffect; the *immitated* codeblock has no overall greyish background.
Instead the individual lines have it.

Note: When building this patch with `asciidoc` the background is totally
gone but the font is still monospaced.

Signed-off-by: nalla <nalla@hamal.uberspace.de>
2015-04-23 10:17:31 +01:00
nalla
8805a67483 asciidoctor: Fix user-manual to be built by asciidoctor
The `user-manual.txt` ist designed as a `book` but the `Makefile` wants to
build it as an `article`. This seems to be a problem when building the
documentation with `asciidoctor`. Furthermore the parts *Git Glossary*
and *Apendix B* had no subsections which is not allowed when building with
`asciidoctor`. So lets add a *dummy* section.

Signed-off-by: nalla <nalla@hamal.uberspace.de>
2015-04-23 10:17:27 +01:00
Johannes Schindelin
62278b3c2f Merge 'git-wrapper' into HEAD
Use msysGit's `git-wrapper` instead of the builtins. This works around
two issues:

- when the file system does not allow hard links, we would waste over
  800 megabyte by having 109 copies of a multi-megabyte executable

- even when the file system allows hard links, the Windows Explorer
  counts the disk usage as if it did not. Many users complained about
  Git for Windows using too much space (when it actually did not). We
  can easily avoid those user complaints by merging this branch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:16:04 +01:00
Johannes Schindelin
dd94d4896d Merge 'poll_inftim' into HEAD
This was originally 'pull request #330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:16:03 +01:00
Johannes Schindelin
3223662af2 Merge 'non-win-fixes' into HEAD 2015-04-23 10:16:01 +01:00
Johannes Schindelin
4c991835af Merge 'taskkill' into HEAD
git-gui/gitk: Do not use a Cygwin-specific kill flag on Windows

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:15:59 +01:00
Johannes Schindelin
1ae7d91655 Merge 'long-paths' into HEAD
This works around path length limitations by using the \\?\* trick.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:15:20 +01:00
Johannes Schindelin
fb80522111 Merge 'fscache' into HEAD
This brings considerable speed-ups to Git for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:13:58 +01:00
Johannes Schindelin
fc6c231fdd 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>
2015-04-23 10:13:56 +01:00
Johannes Schindelin
65cbf37a0f Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:13:54 +01:00
Johannes Schindelin
d3e496b536 Merge 'fix-is-exe' into HEAD 2015-04-23 10:13:53 +01:00
Johannes Schindelin
e5b84e6d79 Merge 'fix-externals' into HEAD 2015-04-23 10:13:51 +01:00
Johannes Schindelin
08ba4d7b94 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>
2015-04-23 10:13:49 +01:00
Johannes Schindelin
b4ea5398ea Merge 'win-tests-fixes' into HEAD 2015-04-23 10:13:47 +01:00
Johannes Schindelin
d6591e1151 Merge 'msys2' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:13:46 +01:00
Karsten Blees
d537349937 git-wrapper: remove redundant TERM initialization
Remove redundant TERM initialization from git-wrapper in favor of TERM
initialization in git itself.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-23 10:13:30 +01:00
Karsten Blees
194e094d4f git-wrapper: fix HOME initialization
git-wrapper fails to initialize HOME correctly if $HOMEDRIVE$HOMEPATH
points to a disconnected network drive.

Check if the directory exists before using $HOMEDRIVE$HOMEPATH.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-23 10:13:29 +01:00
Vitaly Takmazov
32aedd345c git-wrapper: case-insensitive path comparison 2015-04-23 10:13:28 +01:00
Johannes Schindelin
57860dde5f git-wrapper: interpret --cd=<directory> when configured via resources
This change accompanies the `--no-cd` option when configured via
resources. It is required to support `Git Bash Here`: when
right-clicking an icon in the Explorer to start a Bash, the working
directory is actually the directory that is displayed in the Explorer.
That means if the clicked icon actually refers to a directory, the
working directory would be its *parent* directory.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:13:26 +01:00
Johannes Schindelin
62ba61e49f git-wrapper: serve as git-gui.exe, too
To avoid that ugly Console window when calling \cmd\git.exe gui...

To avoid confusion with builtins, we need to move the code block
handling gitk (and now git-gui, too) to intercept before git-gui is
mistaken for a builtin.

Unfortunately, git-gui is in libexec/git-core/ while gitk is in bin/,
therefore we need slightly more adjustments than just moving and
augmenting the gitk case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-23 10:13:23 +01:00