Commit Graph

110804 Commits

Author SHA1 Message Date
Johannes Schindelin
9646b3dbc7 Merge pull request #2714 from lbonanomi/main
Rationalize line endings for scissors-cleanup
2020-07-03 10:33:24 +02:00
Luke Bonanomi
d508f45ebf commit: accept "scissors" with CR/LF line endings
This change enhances `git commit --cleanup=scissors` by detecting
scissors lines ending in either LF (UNIX-style) or CR/LF (DOS-style).

Regression tests are included to specifically test for trailing
comments after a CR/LF-terminated scissors line.

Signed-off-by: Luke Bonanomi <lbonanomi@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-07-02 23:33:06 +02:00
Johannes Schindelin
63ec52b4d4 Merge pull request #2730 from dscho/crlf-aware-git-add-i
git add -i: handle CR/LF line endings in the interactive input
2020-07-02 22:46:27 +02:00
Johannes Schindelin
912269f222 git add -i: handle CR/LF line endings in the interactive input
As of Git for Windows v2.27.0, there is an option to use Windows'
newly-introduced Pseudo Console support. When running an interactive add
operation with this support enabled, Git will receive CR/LF line
endings.

Therefore, let's not pretend that we are expecting Unix line endings.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-07-02 16:37:03 +02:00
Johannes Schindelin
a98b073ae2 fixup! Mirror master and main
The workflow needs to be adjusted so that the just-pushed branch is
cloned (otherwise it is always the default branch that is cloned, even
if in the case that branch is stale).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-06-18 22:21:02 +02:00
Johannes Schindelin
3c88881ab7 Mirror master and main
In preparation for eventually switching over to `main`, let's
synchronize the historical and the designated future main branch.

This follows the excellent advice from
https://github.com/chancancode/branch-rename/#gradual-migration

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-06-16 22:33:19 +02:00
Johannes Schindelin
4df0b59222 Merge pull request #2673 from dscho/also-handle-fscache-addon-for-#2637
Fix `lstat()`'s `st_size` computation for symbolic links when FSCache is in effect
2020-06-08 07:36:43 +02:00
Johannes Schindelin
aeb9254316 fscache: compute correct symlink size in lstat()
In https://github.com/git-for-windows/git/pull/2637, we fixed a bug
where symbolic links' target path sizes were recorded incorrectly in the
index.

However, we did so only in `mingw_lstat()` but not in `fscache_lstat()`.
Meaning: in code paths where the FSCache feature is enabled, Git _still_
got the wrong idea if the symbolic link target's length.

Let's fix this.

Note: as the FSCache feature reads in whole swaths of directory entries
in batch mode, even if metadata for only one of them might be required,
we save the expensive `CreateFile()` call that is required to compute
the symbolic link target's length to the `fscache_lstat()` call.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-06-07 22:40:03 +02:00
Johannes Schindelin
ba031437e7 Merge pull request #2666 from dscho/nicer-upgrade-path-for-#2637
mingw: special-case index entries for symlinks with buggy size
2020-06-07 01:52:52 +02:00
Johannes Schindelin
ce436fdb35 Merge pull request #2665 from dscho/fix-msvc-build-g4w
msvc: fix "REG_STARTEND" issue
2020-06-04 23:50:17 +02:00
Johannes Schindelin
b24ae6b819 mingw: special-case index entries for symlinks with buggy size
In https://github.com/git-for-windows/git/pull/2637, we fixed a bug
where symbolic links' target path sizes were recorded incorrectly in the
index. The downside of this fix was that every user with tracked
symbolic links in their checkouts would see them as modified in `git
status`, but not in `git diff`, and only a `git add <path>` (or `git add
-u`) would "fix" this.

Let's do better than that: we can detect that situation and simply
pretend that a symbolic link with a known bad size (or a size that just
happens to be that bad size, a _very_ unlikely scenario because it would
overflow our buffers due to the trailing NUL byte) means that it needs
to be re-checked as if we had just checked it out.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-06-04 23:16:07 +02:00
Johannes Schindelin
8422b5e207 msvc: fix "REG_STARTEND" issue
In 897d68e7af (Makefile: use curl-config --cflags, 2020-03-26), we
taught the build process to use `curl-config --cflags` to make sure that
it can find cURL's headers.

In the MSVC build, this is completely bogus because we're running in a
Git for Windows SDK whose `curl-config` supports the _GCC_ build.

Let's just ignore each and every `-I<path>` option where `<path>` points
to GCC/Clang specific headers.

Reported by Jeff Hostetler in
https://github.com/microsoft/git/issues/275.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-06-04 22:02:09 +02:00
Johannes Schindelin
907ab1011d Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
v2.27.0.windows.1
2020-06-01 20:17:08 +02:00
Johannes Schindelin
cb5998d50e Merge branch 'phase-out-reset-stdin'
This topic branch re-adds the deprecated --stdin/-z options to `git
reset`. Those patches were overridden by a different set of options in
the upstream Git project before we could propose `--stdin`.

We offered this in MinGit to applications that wanted a safer way to
pass lots of pathspecs to Git, and these applications will need to be
adjusted.

Instead of `--stdin`, `--pathspec-from-file=-` should be used, and
instead of `-z`, `--pathspec-file-nul`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-06-01 20:17:08 +02:00
Johannes Schindelin
3674a34b0a Merge pull request #1354 from dscho/phase-out-show-ignored-directory-gracefully
Phase out `--show-ignored-directory` gracefully
2020-06-01 20:17:08 +02:00
Johannes Schindelin
4cdf07c712 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-06-01 20:17:07 +02:00
Johannes Schindelin
7aaf18892c 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-06-01 20:17:07 +02:00
Johannes Schindelin
538f683349 Merge branch 'busybox-w32'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-06-01 20:17:07 +02:00
Johannes Schindelin
7719d5d6e9 Merge pull request #1897 from piscisaureus/symlink-attr
Specify symlink type in .gitattributes
2020-06-01 20:17:06 +02:00
Johannes Schindelin
4fc9e19a35 Merge pull request #2637 from billziss-gh/master
mingw: lstat: compute correct size for symlinks
2020-06-01 20:17:06 +02:00
Johannes Schindelin
d0a8772986 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-06-01 20:17:05 +02:00
Johannes Schindelin
544106af1a Merge branch 'kblees/kb/symlinks' 2020-06-01 20:17:05 +02:00
Johannes Schindelin
9538b4710c Merge branch 'msys2' 2020-06-01 20:17:04 +02:00
Johannes Schindelin
912c9f000a Merge branch 'long-paths' 2020-06-01 20:17:04 +02:00
Johannes Schindelin
c04b011493 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-06-01 20:17:04 +02:00
Derrick Stolee
4316824fa8 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-06-01 20:17:03 +02:00
Johannes Schindelin
58f9ebb15c Merge pull request #1937 from benpeart/fscache-NtQueryDirectoryFile-gfw
fscache: teach fscache to use NtQueryDirectoryFile
2020-06-01 20:17:03 +02:00
Johannes Schindelin
83f3113a93 Merge pull request #1934 from benpeart/fscache-thread-safe-enable-gfw
fscache: make fscache_enable() thread safe
2020-06-01 20:17:03 +02:00
Johannes Schindelin
bf7b6350ba 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-06-01 20:17:02 +02:00
Johannes Schindelin
b0a3d491bc Merge pull request #1910 from benpeart/fscache_statistics-gfw
fscache: add fscache hit statistics
2020-06-01 20:17:02 +02:00
Johannes Schindelin
1465a07a10 Merge pull request #1914 from benpeart/free-fscache-after-add-gfw
At the end of the add command, disable and free the fscache
2020-06-01 20:17:02 +02:00
Johannes Schindelin
6ff18b189f Merge pull request #1911 from benpeart/git_test_fscache-gfw
fscache: add GIT_TEST_FSCACHE support
2020-06-01 20:17:02 +02:00
Johannes Schindelin
ba8a7e378e Merge pull request #1909 from benpeart/free-fscache-after-status-gfw
status: disable and free fscache at the end of the status command
2020-06-01 20:17:01 +02:00
Johannes Schindelin
79e54e476f Merge pull request #1908 from benpeart/FindFirstFileEx-gfw
fscache: use FindFirstFileExW to avoid retrieving the short name
2020-06-01 20:17:01 +02:00
Johannes Schindelin
3ba9bb82ac Merge pull request #1827 from benpeart/fscache_refresh_index
Enable the filesystem cache (fscache) in refresh_index().
2020-06-01 20:17:01 +02:00
Johannes Schindelin
60b8bf1e6e 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-06-01 20:17:00 +02:00
Johannes Schindelin
ff33f74e90 Merge pull request #1426 from atetubou/fetch_pack
fetch-pack.c: enable fscache for stats under .git/objects
2020-06-01 20:17:00 +02:00
Johannes Schindelin
d388b675ba Merge pull request #1344 from jeffhostetler/perf_add_excludes_with_fscache
dir.c: make add_excludes aware of fscache during status
2020-06-01 20:17:00 +02:00
Johannes Schindelin
7aadd86541 Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2020-06-01 20:16:59 +02:00
Johannes Schindelin
1e6af412e4 Merge pull request #994 from jeffhostetler/jeffhostetler/fscache_nfd
fscache: add not-found directory cache to fscache
2020-06-01 20:16:59 +02:00
Johannes Schindelin
1c4b924c78 Merge branch 'fscache' 2020-06-01 20:16:59 +02:00
Johannes Schindelin
272d9e65e6 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-06-01 20:16:58 +02:00
Johannes Schindelin
8336e9926e 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-06-01 20:16:58 +02:00
Johannes Schindelin
10e4fd9ce8 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-06-01 20:16:58 +02:00
Johannes Schindelin
cb25a3c36d 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-06-01 20:16:57 +02:00
Johannes Schindelin
872bff637e reset: reinstate support for the deprecated --stdin option
The `--stdin` option was a well-established paradigm in other commands,
therefore we implemented it in `git reset` for use by Visual Studio.

Unfortunately, upstream Git decided that it is time to introduce
`--pathspec-from-file` instead.

To keep backwards-compatibility for some grace period, we therefore
reinstate the `--stdin` option on top of the `--pathspec-from-file`
option, but mark it firmly as deprecated.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-06-01 20:16:57 +02:00
Johannes Schindelin
6ddf97a43f status: verify that --show-ignored-directory prints a warning
The option is deprecated now, and we better make sure that keeps saying
so until we finally remove it.

Suggested by Kevin Willford.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-06-01 20:16:57 +02:00
Bill Zissimopoulos
3681d27b6f mingw: lstat: compute correct size for symlinks
This commit fixes mingw_lstat by computing the proper size for symlinks
according to POSIX. POSIX specifies that upon successful return from
lstat: "the value of the st_size member shall be set to the length of
the pathname contained in the symbolic link not including any
terminating null byte".

Prior to this commit the mingw_lstat function returned a fixed size of
4096. This caused problems in git repositories that were accessed by
git for Cygwin or git for WSL. For example, doing `git reset --hard`
using git for Windows would update the size of symlinks in the index
to be 4096; at a later time git for Cygwin or git for WSL would find
that symlinks have changed size during `git status`. Vice versa doing
`git reset --hard` in git for Cygwin or git for WSL would update the
size of symlinks in the index with the correct value, only for git for
Windows to find incorrectly at a later time that the size had changed.

Additional fixup by: Johannes Schindelin <johannes.schindelin@gmx.de>

Signed-off-by: Bill Zissimopoulos <billziss@navimatics.com>
2020-06-01 20:16:57 +02:00
Alejandro Barreto
9da5406dc9 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-06-01 20:16:57 +02:00
Johannes Schindelin
0a32b32542 .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-06-01 20:16:57 +02:00