Commit Graph

111663 Commits

Author SHA1 Message Date
Johannes Schindelin
d661d6d950 status: reinstate --show-ignored-directory as a deprecated option
It was a bad idea to just remove that option from Git for Windows
v2.15.0, as early users of that (still experimental) option would have
been puzzled what they are supposed to do now.

So let's reintroduce the flag, but make sure to show the user good
advice how to fix this going forward.

We'll remove this option in a more orderly fashion either in v2.16.0 or
in v2.17.0.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-07-22 13:37:09 -04:00
Johannes Schindelin
0b4fcf9510 status: carry the --no-lock-index option for backwards-compatibility
When a third-party tool periodically runs `git status` in order to keep
track of the state of the working tree, it is a bad idea to lock the
index: it might interfere with interactive commands executed by the
user, e.g. when the user wants to commit files.

Git for Windows introduced the `--no-lock-index` option a long time ago
to fix that (it made it into Git for Windows v2.9.2(3)) by simply
avoiding to write that file.

The downside is that the periodic `git status` calls will be a little
bit more wasteful because they may have to refresh the index repeatedly,
only to throw away the updates when it exits. This cannot really be
helped, though, as tools wanting to get a periodic update of the status
have no way to predict when the user may want to lock the index herself.

Sadly, a competing approach was submitted (by somebody who apparently
has less work on their plate than this maintainer) that made it into
v2.15.0 but is *different*: instead of a `git status`-only option, it is
an option that comes *before* the Git command and is called differently,
too.

Let's give previous users a chance to upgrade to newer Git for Windows
versions by handling the `--no-lock-index` option, still, though with a
big fat warning.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-07-22 13:37:08 -04:00
Derrick Stolee
2be6fc24a5 Start the merging-rebase to refs/tags/v2.28.0-rc2
This commit starts the rebase of 57cb028075 to 84a0d5cc210
2020-07-22 13:35:17 -04:00
Junio C Hamano
b066807397 Git 2.28-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-22 09:30:01 -07:00
Junio C Hamano
cfa7ae8b6e Merge branch 'en/sparse-status' into master
Fix to a "git prompt" regression during this development cycle.

* en/sparse-status:
  git-prompt: change == to = for zsh's sake
2020-07-21 14:19:10 -07:00
David J. Malan
e8882a87d9 git-prompt: change == to = for zsh's sake
When using git-prompt.sh with zsh, __git_ps1 currently errs
when inside a repo with:

__git_ps1:96: = not found

Avoid using non-portable "==" that is only understood by bash
and not zsh. Change to "=" so that the prompt script becomes
usable with zsh again.

Signed-off-by: David J. Malan <malan@harvard.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-20 17:37:20 -07:00
Junio C Hamano
e7ae437ac1 Merge https://github.com/prati0100/git-gui into master
* https://github.com/prati0100/git-gui:
  git-gui: allow opening work trees from the startup dialog
2020-07-20 12:04:06 -07:00
Junio C Hamano
ae46588be0 Merge branch 'dl/branch-cleanup' into master
Last minute fix-up to tests for portability.

* dl/branch-cleanup:
  t3200: don't grep for `strerror()` string
2020-07-18 16:35:22 -07:00
Junio C Hamano
00a7a21b97 Merge branch 'js/pu-to-seen' into master
Last minute fix-up to documentation.

* js/pu-to-seen:
  gitworkflows.txt: fix broken subsection underline
2020-07-18 16:35:22 -07:00
Junio C Hamano
d400cb0d1b Merge branch 'jc/relnotes-v0-extension-update' into master
Last minute fix-up to the release notes.

* jc/relnotes-v0-extension-update:
  RelNotes: update the v0 with extension situation
2020-07-18 16:35:20 -07:00
Martin Ågren
d223e85407 t3200: don't grep for strerror() string
In 6b7093064a ("t3200: test for specific errors", 2020-06-15), we
learned to grep stderr to ensure that the failing `git branch`
invocations fail for the right reason. In two of these tests, we grep
for "File exists", expecting the string to show up there since config.c
calls `error_errno()`, which ends up including `strerror(errno)` in the
error message.

But as we saw in 4605a73073 ("t1091: don't grep for `strerror()`
string", 2020-03-08), there exists at least one implementation where
`strerror()` yields a slightly different string than the one we're
grepping for. In particular, these tests fail on the NonStop platform.

Similar to 4605a73073, grep for the beginning of the string instead to
avoid relying on `strerror()` behavior.

Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-18 13:47:05 -07:00
Martin Ågren
ca8bb509d2 gitworkflows.txt: fix broken subsection underline
AsciiDoctor renders the "~~~~~~~~~" literally. That's not our intention:
it is supposed to indicate a level 2 subsection. In 828197de8f ("docs:
adjust for the recent rename of `pu` to `seen`", 2020-06-25), the length
of this section header grew by two characters but we didn't adjust the
number of ~ characters accordingly. AsciiDoc handles this discrepancy ok
and still picks this up as a subsection title, but Asciidoctor is not as
forgiving.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-18 13:43:34 -07:00
Johannes Schindelin
25517c9655 Merge pull request #2731 from SyntevoAlex/#0312(win)_clone_adds_worktree
Fix problem where clone adds core.worktree due to path case differences
v2.28.0-rc1.windows.1
2020-07-17 16:41:23 -04:00
Johannes Schindelin
2c60714ce6 Merge pull request #2714 from lbonanomi/main
Rationalize line endings for scissors-cleanup
2020-07-17 16:41:22 -04:00
Johannes Schindelin
54e784ccfc 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-17 16:41:22 -04:00
Alexandr Miloslavskiy
e0b5b40ec7 mingw_strbuf_realpath(): handle case of non existent last path component
git often requests `strbuf_realpath(path + "/.git")`, where "./git" does
not yet exist on disk.

This causes the following to happen:
1. `mingw_strbuf_realpath()` fails
2. Non-mingw `strbuf_realpath()` does the work
3. Result of `strbuf_realpath()` is slightly different, for example it
   will not normalize the case of disk/folder names
4. `needs_work_tree_config()` becomes confused by these differences
5. clone adds `core.worktree` setting

This in turn causes various problems, for example:
1. Repository folder can no longer be renamed/moved without breaking it
2. Using the repository on WSL (Windows Subsystem for Linux) doesn't
   work, because it has windows-style path saved

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

Co-Authored-By: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
2020-07-17 16:41:21 -04:00
Luke Bonanomi
c1c6ad6e94 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-17 16:41:20 -04:00
Johannes Schindelin
1dfd9a7461 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-17 16:41:20 -04:00
Johannes Schindelin
06088f22b1 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-07-17 16:41:19 -04:00
Johannes Schindelin
ea875649db 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-07-17 16:41:19 -04:00
Johannes Schindelin
c9a8f11705 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-07-17 16:41:19 -04:00
Johannes Schindelin
6f7771b784 Merge pull request #2666 from dscho/nicer-upgrade-path-for-#2637
mingw: special-case index entries for symlinks with buggy size
2020-07-17 16:41:18 -04:00
Johannes Schindelin
e7e6093b0a 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-07-17 16:41:18 -04:00
Johannes Schindelin
9bf04cfc28 Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-07-17 16:41:17 -04:00
Johannes Schindelin
8366a39c35 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-07-17 16:41:16 -04:00
Johannes Schindelin
c55e223657 Merge pull request #1354 from dscho/phase-out-show-ignored-directory-gracefully
Phase out `--show-ignored-directory` gracefully
2020-07-17 16:41:16 -04:00
Johannes Schindelin
5dbb4a239e 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-07-17 16:41:15 -04:00
Johannes Schindelin
61c97245f2 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-07-17 16:41:15 -04:00
Johannes Schindelin
a5aa1a12cd Merge branch 'busybox-w32'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-07-17 16:41:14 -04:00
Johannes Schindelin
1ab0f34e42 Merge pull request #1897 from piscisaureus/symlink-attr
Specify symlink type in .gitattributes
2020-07-17 16:41:13 -04:00
Johannes Schindelin
a881584424 Merge pull request #2637 from billziss-gh/master
mingw: lstat: compute correct size for symlinks
2020-07-17 16:41:13 -04:00
Johannes Schindelin
c65ec4267f 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-07-17 16:41:12 -04:00
Johannes Schindelin
1ca8bad609 Merge branch 'kblees/kb/symlinks' 2020-07-17 16:41:11 -04:00
Johannes Schindelin
8134b3cab5 Merge branch 'msys2' 2020-07-17 16:41:11 -04:00
Johannes Schindelin
87133340ef Merge branch 'long-paths' 2020-07-17 16:41:10 -04:00
Johannes Schindelin
1731d49e99 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-07-17 16:41:10 -04:00
Derrick Stolee
e03f58c3b0 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-07-17 16:41:09 -04:00
Johannes Schindelin
57a27c15a1 Merge pull request #1937 from benpeart/fscache-NtQueryDirectoryFile-gfw
fscache: teach fscache to use NtQueryDirectoryFile
2020-07-17 16:41:09 -04:00
Johannes Schindelin
f7e99bc56d Merge pull request #1934 from benpeart/fscache-thread-safe-enable-gfw
fscache: make fscache_enable() thread safe
2020-07-17 16:41:08 -04:00
Johannes Schindelin
8c252329a5 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-07-17 16:41:07 -04:00
Johannes Schindelin
c959a0158c Merge pull request #1910 from benpeart/fscache_statistics-gfw
fscache: add fscache hit statistics
2020-07-17 16:41:07 -04:00
Johannes Schindelin
535c92ae71 Merge pull request #1914 from benpeart/free-fscache-after-add-gfw
At the end of the add command, disable and free the fscache
2020-07-17 16:41:06 -04:00
Johannes Schindelin
5e68cdd0c7 Merge pull request #1911 from benpeart/git_test_fscache-gfw
fscache: add GIT_TEST_FSCACHE support
2020-07-17 16:41:06 -04:00
Johannes Schindelin
229ebc8da0 Merge pull request #1909 from benpeart/free-fscache-after-status-gfw
status: disable and free fscache at the end of the status command
2020-07-17 16:41:05 -04:00
Johannes Schindelin
80d39bc6ae Merge pull request #1908 from benpeart/FindFirstFileEx-gfw
fscache: use FindFirstFileExW to avoid retrieving the short name
2020-07-17 16:41:05 -04:00
Johannes Schindelin
c63a480fc1 Merge pull request #1827 from benpeart/fscache_refresh_index
Enable the filesystem cache (fscache) in refresh_index().
2020-07-17 16:41:04 -04:00
Johannes Schindelin
c32469e795 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-07-17 16:41:03 -04:00
Johannes Schindelin
642b48b54a Merge pull request #1426 from atetubou/fetch_pack
fetch-pack.c: enable fscache for stats under .git/objects
2020-07-17 16:41:03 -04:00
Johannes Schindelin
cfef8513b4 Merge pull request #1344 from jeffhostetler/perf_add_excludes_with_fscache
dir.c: make add_excludes aware of fscache during status
2020-07-17 16:41:02 -04:00
Johannes Schindelin
52ad2569ed Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2020-07-17 16:41:02 -04:00