Commit Graph

106439 Commits

Author SHA1 Message Date
Johannes Schindelin
100d194f29 mingw: implement a platform-specific strbuf_realpath()
There is a Win32 API function to resolve symbolic links, and we can use
that instead of resolving them manually. Even better, this function also
resolves NTFS junction points (which are somewhat similar to bind
mounts).

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-31 16:35:50 +01:00
Johannes Schindelin
2f7720c721 strbuf_realpath(): use platform-dependent API if available
Some platforms (e.g. Windows) provide API functions to resolve paths
much quicker. Let's offer a way to short-cut `strbuf_realpath()` on
those platforms.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-31 12:58:22 +01:00
Johannes Schindelin
d50f290f1b mingw: demonstrate a git add issue with NTFS junctions
NTFS junctions are somewhat similar in spirit to Unix bind mounts: they
point to a different directory and are resolved by the filesystem
driver. As such, they appear to `lstat()` as if they are directories,
not as if they are symbolic links.

_Any_ user can create junctions, while symbolic links can only be
created by non-administrators in Developer Mode on Windows 10. Hence
NTFS junctions are much more common "in the wild" than NTFS symbolic
links.

It was reported in https://github.com/git-for-windows/git/issues/2481
that adding files via an absolute path that traverses an NTFS junction:
since 1e64d18 (mingw: do resolve symlinks in `getcwd()`), we resolve not
only symbolic links but also NTFS junctions when determining the
absolute path of the current directory. The same is not true for `git
add <file>`, where symbolic links are resolved in `<file>`, but not NTFS
junctions.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-31 12:58:20 +01:00
Johannes Schindelin
5f4dea1e46 Merge pull request #2501 from jeffhostetler/clink-debug-curl
clink.pl: fix MSVC compile script to handle libcurl-d.lib
2020-01-30 23:18:53 +01:00
Jeff Hostetler
5aaa8989f7 clink.pl: fix MSVC compile script to handle libcurl-d.lib
Update clink.pl to link with either libcurl.lib or libcurl-d.lib
depending on whether DEBUG=1 is set.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-30 23:15:15 +01:00
Johannes Schindelin
4b1502b33a Merge pull request #2489 from dscho/azp-latest-pools
Azure Pipeline: switch to the latest agent pools

See https://devblogs.microsoft.com/devops/removing-older-images-in-azure-pipelines-hosted-pools/ for details.
2020-01-29 13:26:29 +01:00
Johannes Schindelin
5e47a24382 Azure Pipeline: switch to the latest agent pools
It would seem that at least the `vs2015-win2012r2` pool (which we use
via its old name, `Hosted`) is about to be phased out. Let's switch
before that.

While at it, use the newer pool names as suggested at
https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops#use-a-microsoft-hosted-agent

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-24 10:27:10 +01:00
Johannes Schindelin
387e7103e8 Merge pull request #2488 from bmueller84/master
mingw: fix fatal error working on mapped network drives on Windows
2020-01-22 19:42:25 +01:00
Bjoern Mueller
eabf519c59 mingw: fix fatal error working on mapped network drives on Windows
In 1e64d18 (mingw: do resolve symlinks in `getcwd()`) a problem was
introduced that causes git for Windows to stop working with certain
mapped network drives (in particular, drives that are mapped to
locations with long path names). Error message was "fatal: Unable to
read current working directory: No such file or directory". Present
change fixes this issue as discussed in
https://github.com/git-for-windows/git/issues/2480

Signed-off-by: Bjoern Mueller <bjoernm@gmx.de>
2020-01-22 13:49:13 +01:00
Johannes Schindelin
8f03c5ece6 Merge pull request #2473 from dscho/com0-is-not-a-reserved-name
Do not mistake `COM0` for a reserved file name
2020-01-16 10:54:08 +01:00
Johannes Schindelin
4001aef3b3 Merge pull request #2472 from dscho/builtin-add-i-fixes
Two fixes for the built-in `git add -i`
2020-01-16 00:04:40 +01:00
Johannes Schindelin
f92c7e0301 Merge pull request #2476 from dscho/vcpkg-upgraded-to-openssl-v1.1.x
Accommodate for vcpkg's upgrade to OpenSSL v1.1.x
2020-01-15 22:29:45 +01:00
Johannes Schindelin
96d3d53111 msvc: accommodate for vcpkg's upgrade to OpenSSL v1.1.x
With the upgrade, the library names changed from libeay32/ssleay32 to
libcrypto/libssl.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-15 11:28:30 +01:00
Johannes Schindelin
e3578e301c mingw: do not treat COM0 as a reserved file name
In 4dc42c6c18 (mingw: refuse paths containing reserved names,
2019-12-21), we started disallowing file names that are reserved, e.g.
`NUL`, `CONOUT$`, etc.

This included `COM<n>` where `<n>` is a digit. Unfortunately, this
includes `COM0` but only `COM1`, ..., `COM9` are reserved, according to
the official documentation, `COM0` is mentioned in the "NT Namespaces"
section but it is explicitly _omitted_ from the list of reserved names:
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions

Tests corroborate this: it is totally possible to write a file called
`com0.c` on Windows 10, but not `com1.c`.

So let's tighten the code to disallow only the reserved `COM<n>` file
names, but to allow `COM0` again.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-14 23:34:00 +01:00
Johannes Schindelin
ff8149b60e built-in add -i: accept open-ended ranges again
The interactive `add` command allows selecting multiple files for some
of its sub-commands, via unique prefixes, indices or index ranges.

When re-implementing `git add -i` in C, we even added a code comment
talking about ranges with a missing end index, such as `2-`, but the
code did not actually accept those, as pointed out in
https://github.com/git-for-windows/git/issues/2466#issuecomment-574142760.

Let's fix this, and add a test case to verify that this stays fixed
forever.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-14 22:33:36 +01:00
Johannes Schindelin
7495b4ffd5 built-in add -i: do not try to patch/diff an empty list of files
When the user does not select any files to `patch` or `diff`, there is
no need to call `run_add_p()` on them.

Even worse: we _have_ to avoid calling `parse_pathspec()` with an empty
list because that would trigger this error:

	BUG: pathspec.c:557: PATHSPEC_PREFER_CWD requires arguments

So let's avoid doing any work on a list of files that is empty anyway.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-14 20:49:26 +01:00
Johannes Schindelin
7c71c859c9 Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
v2.25.0.windows.1
2020-01-13 20:21:32 +01:00
Johannes Schindelin
d50f4f7233 Merge pull request #1354 from dscho/phase-out-show-ignored-directory-gracefully
Phase out `--show-ignored-directory` gracefully
2020-01-13 20:21:31 +01:00
Johannes Schindelin
aecd194181 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>
2020-01-13 20:21:31 +01:00
Johannes Schindelin
fbf01013ab Merge pull request #1170 from dscho/mingw-kill-process
Handle Ctrl+C in Git Bash nicely

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-13 20:21:30 +01:00
Johannes Schindelin
f17d80848f Merge branch 'busybox-w32'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-13 20:21:30 +01:00
Johannes Schindelin
30b9be7ba0 Merge pull request #1897 from piscisaureus/symlink-attr
Specify symlink type in .gitattributes
2020-01-13 20:21:29 +01:00
Johannes Schindelin
c6f8de653d Merge 'docker-volumes-are-no-symlinks'
This was pull request #1645 from ZCube/master

Support windows container.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-13 20:21:28 +01:00
Johannes Schindelin
60b9b0c62d Merge branch 'kblees/kb/symlinks' 2020-01-13 20:21:28 +01:00
Johannes Schindelin
3a7fde51bd Merge branch 'msys2' 2020-01-13 20:21:27 +01:00
Johannes Schindelin
cb7f08f0dd Merge branch 'long-paths' 2020-01-13 20:21:27 +01:00
Johannes Schindelin
8337f1d78f Merge branch 'dont-clean-junctions-fscache'
We already avoid traversing NTFS junction points in `git clean -dfx`.
With this topic branch, we do that when the FSCache is enabled, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-13 20:21:26 +01:00
Derrick Stolee
95a9151f26 Merge branch 'fscache-and-sparse-checkout'
When updating the skip-worktree bits in the index to align with new
values in a sparse-checkout file, Git scans the entire working
directory with lstat() calls. In a sparse-checkout, many of these
lstat() calls are for paths that do not exist.

Enable the fscache feature during this scan.

In a local test of a repo with ~2.2 million paths, updating the index
with `git read-tree -m -u HEAD` with a sparse-checkout file containing
only `/.gitattributes` improved from 2-3 minutes to 15-20 seconds.

More work could be done to stop running lstat() calls when recursing
into directories that are known to not exist.
2020-01-13 20:21:25 +01:00
Johannes Schindelin
0cb13d5ca2 Merge pull request #1937 from benpeart/fscache-NtQueryDirectoryFile-gfw
fscache: teach fscache to use NtQueryDirectoryFile
2020-01-13 20:21:25 +01:00
Johannes Schindelin
2abc698347 Merge pull request #1934 from benpeart/fscache-thread-safe-enable-gfw
fscache: make fscache_enable() thread safe
2020-01-13 20:21:24 +01:00
Johannes Schindelin
3dcd03239d Merge remote-tracking branch 'benpeart/fscache-per-thread-gfw'
This brings substantial wins in performance because the FSCache is now
per-thread, being merged to the primary thread only at the end, so we do
not have to lock (except while merging).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-13 20:21:24 +01:00
Johannes Schindelin
5a960df710 Merge pull request #1910 from benpeart/fscache_statistics-gfw
fscache: add fscache hit statistics
2020-01-13 20:21:23 +01:00
Johannes Schindelin
9e021934b5 Merge pull request #1914 from benpeart/free-fscache-after-add-gfw
At the end of the add command, disable and free the fscache
2020-01-13 20:21:23 +01:00
Johannes Schindelin
599ec3bd88 Merge pull request #1911 from benpeart/git_test_fscache-gfw
fscache: add GIT_TEST_FSCACHE support
2020-01-13 20:21:23 +01:00
Johannes Schindelin
3cdfe2c2ba Merge pull request #1909 from benpeart/free-fscache-after-status-gfw
status: disable and free fscache at the end of the status command
2020-01-13 20:21:22 +01:00
Johannes Schindelin
5c243450dd Merge pull request #1908 from benpeart/FindFirstFileEx-gfw
fscache: use FindFirstFileExW to avoid retrieving the short name
2020-01-13 20:21:22 +01:00
Johannes Schindelin
acc4b194bf Merge pull request #1827 from benpeart/fscache_refresh_index
Enable the filesystem cache (fscache) in refresh_index().
2020-01-13 20:21:22 +01:00
Johannes Schindelin
083d88820c Merge pull request #1468 from atetubou/fscache_checkout_flush
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-13 20:21:21 +01:00
Johannes Schindelin
75e7c0ddc5 Merge pull request #1426 from atetubou/fetch_pack
fetch-pack.c: enable fscache for stats under .git/objects
2020-01-13 20:21:21 +01:00
Johannes Schindelin
1424216682 Merge pull request #1344 from jeffhostetler/perf_add_excludes_with_fscache
dir.c: make add_excludes aware of fscache during status
2020-01-13 20:21:20 +01:00
Johannes Schindelin
28f2e4c00d Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2020-01-13 20:21:20 +01:00
Johannes Schindelin
7b2c85b4b1 Merge pull request #994 from jeffhostetler/jeffhostetler/fscache_nfd
fscache: add not-found directory cache to fscache
2020-01-13 20:21:19 +01:00
Johannes Schindelin
cadb4fd567 Merge branch 'fscache' 2020-01-13 20:21:19 +01:00
Johannes Schindelin
6f9baa487f Merge 'add-p-many-files'
This topic branch allows `add -p` and `add -i` with a large number of
files. It is kind of a hack that was never really meant to be
upstreamed. Let's see if we can do better in the built-in `add -p`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-13 20:21:18 +01:00
Johannes Schindelin
1886009a8f Merge branch 'gitk-and-git-gui-patches'
These are Git for Windows' Git GUI and gitk patches. We will have to
decide at some point what to do about them, but that's a little lower
priority (as Git GUI seems to be unmaintained for the time being, and
the gitk maintainer keeps a very low profile on the Git mailing list,
too).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-13 20:21:18 +01:00
Johannes Schindelin
7cd43ba68e SECURITY.md: document Git for Windows' policies
This is the recommended way on GitHub to describe policies revolving around
security issues and about supported versions.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-13 20:21:17 +01:00
Johannes Schindelin
477fe8a3ee Merge branch 'ready-for-upstream'
This is the branch thicket of patches in Git for Windows that are
considered ready for upstream. To keep them in a ready-to-submit shape,
they are kept as close to the beginning of the branch thicket as
possible.
2020-01-13 20:21:17 +01:00
Alejandro Barreto
1b9f40de5e Document how $HOME is set on Windows
Git documentation refers to $HOME and $XDG_CONFIG_HOME often, but does not specify how or where these values come from on Windows where neither is set by default. The new documentation reflects the behavior of setup_windows_environment() in compat/mingw.c.

Signed-off-by: Alejandro Barreto <alejandro.barreto@ni.com>
2020-01-13 20:21:17 +01:00
Johannes Schindelin
02b15812ba .github: Add configuration for the Sentiment Bot
The sentiment bot will help detect when things get too heated.
Hopefully.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-13 20:21:16 +01:00
Philip Oakley
f1df9dd8dc Modify the GitHub Pull Request template (to reflect Git for Windows)
Git for Windows accepts pull requests; Core Git does not. Therefore we
need to adjust the template (because it only matches core Git's
project management style, not ours).

Also: direct Git for Windows enhancements to their contributions page,
space out the text for easy reading, and clarify that the mailing list
is plain text, not HTML.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-13 20:21:16 +01:00