Commit Graph

96163 Commits

Author SHA1 Message Date
Johannes Schindelin
f33dcdba9f 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>
2019-02-21 11:06:54 +01:00
Johannes Schindelin
a4b818922f Start the merging-rebase to v2.21.0-rc2
This is a "dummy" rebase, because we already rebased to that tag.

So why rebase, then? For multiple reasons:

1. to pull in `origin/master`'s commit history (without actually taking
   its changes, because we already forward-ported the
   dont-spawn-gzip-in-archive patches to `rebase-to-v2.21.0`.

2. to reorder some built-in stash related patches into the correct spot.

3. to move the dont-spawn-gzip-in-archive patches into the
   ready-for-upstream branch thicket.

This commit starts the rebase of 948d034ce3 to 1c668b7b88be

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-02-21 11:04:39 +01:00
Johannes Schindelin
c7d5d9dcf0 Merge remote-tracking branch 'origin/master' into rebase-to-v2.21.0
We accepted a Pull Request into `master`, but the main development
happens on the topic branch `rebase-to-v2.21.0` right now, in
preparation for the final v2.21.0 in a couple of days.

So after we forward-ported the changes in a6567c7b2c (Merge pull
request #2077 from r1walz/gzip-cmd-404, 2019-02-20), it is now time to
pull in the commit history of origin/master in a fake merge (i.e. with
`-s ours`), to make `master` fast-forward to `rebase-to-v2.21.0` again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-02-21 11:02:12 +01:00
Johannes Schindelin
406631eac4 stash: avoid unnecessary reset_tree() call
In 45c1389c31 (stash: convert apply to builtin, 2018-12-20), we
introduced code that is the equivalent of `git write-tree && git
read-tree`. But the original shell script only called `git write-tree`
(because the read-tree would obviously be a no-op). So let's skip the
reset_tree() call that is the equivalent that that `git read-tree`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
v2.21.0-rc2.windows.1
2019-02-20 22:22:18 +01:00
Johannes Schindelin
20316daa91 stash: discard in-process cache after spawning index-changing processes
In 9a67cb4f1f (stash: convert push to builtin, 2018-12-20), we started
to call `git apply -R --index` and `git reset --hard`, but held onto the
now-stale index in memory. Let's discard it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-02-20 22:21:43 +01:00
Johannes Schindelin
a6567c7b2c Merge pull request #2077 from r1walz/gzip-cmd-404
[FIX] git-archive error, gzip -cn : command not found
2019-02-20 17:05:41 +01:00
Rohit Ashiwal
a7a57d7ebb archive: avoid spawning gzip
As we already link to `zlib` library, we can perform the
compression without even requiring gzip on the host
machine

We modify write_tar_filter_archive() function in archive-tar.c
to handle the compression when `gzip -cn` is requested

Signed-off-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com>
2019-02-20 17:05:40 +01:00
Rohit Ashiwal
b52568fb0b archive: replace write_or_die() calls with write_block_or_die()
MinGit for Windows comes without `gzip` bundled inside,
git-archive uses `gzip -cn` to compress tar files but
for this to work, gzip needs to be present on the host
system, which sometimes is not the case

In the next commit, we will change the gzip compression
so that we no longer spawn `gzip` but let zlib perform
the compression in the same process

In preparation for this, we consolidate all the block
writes into a single function

Closes: #1970
Signed-off-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com>
2019-02-20 17:05:40 +01:00
Johannes Schindelin
ed2b22adeb Merge pull request #2077 from r1walz/gzip-cmd-404
[FIX] git-archive error, gzip -cn : command not found
2019-02-20 16:59:56 +01:00
Johannes Schindelin
c663e450e5 Merge pull request #1354 from dscho/phase-out-show-ignored-directory-gracefully
Phase out `--show-ignored-directory` gracefully
2019-02-20 12:44:09 +01:00
Johannes Schindelin
216aa4f496 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>
2019-02-20 12:44:09 +01:00
Johannes Schindelin
ebcd5deeee Merge pull request #1958 from dscho/ansi-unicode
mingw: safeguard against compiling with `-DUNICODE`
2019-02-20 12:44:09 +01:00
Johannes Schindelin
9fde78db61 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>
2019-02-20 12:44:08 +01:00
Johannes Schindelin
f4deacbbbe 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>
2019-02-20 12:44:08 +01:00
Johannes Schindelin
3611eb9b6e 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>
2019-02-20 12:44:08 +01:00
Jameson Miller
b8ad3e7af6 Merge 'builtin-stash-rebase-v3'
To avoid having to play tricks as in earlier rounds, we bit the sour
apple and rebased the `builtin-stash-rebase-v3` branch thicket onto the
commit starting Git for Windows' merging-rebase.

(The merging-rebase pulls in the previous branch thicket via a "fake
merge", i.e. a merge commit that does not actually apply any changes
from the merged commit history. This has the unfortunate side effect of
confusing `merge` into thinking that any branch that was merged into an
earlier round does not need to be merged again.)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-02-20 12:44:07 +01:00
Johannes Schindelin
78aa45b766 mingw: use ANSI or Unicode functions explicitly
For many Win32 functions, there actually exist two variants: one with
the `A` suffix that takes ANSI parameters (`char *` or `const char *`)
and one with the `W` suffix that takes Unicode parameters (`wchar_t *`
or `const wchar_t *`).

Let's be precise what we want to use.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-02-20 12:44:07 +01:00
Johannes Schindelin
4b7c2d0acd Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-02-20 12:44:07 +01:00
Johannes Schindelin
6f84c18a8e Merge branch 'fix-terminal-prompt'
This fixes the issue identified in

	https://github.com/git-for-windows/git/issues/1498

where Git would not fall back to reading credentials from a Win32
Console when the credentials could not be read from the terminal via the
Bash hack (that is necessary to support running in a MinTTY).

Tested in a Powershell window.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-02-20 12:44:06 +01:00
Johannes Schindelin
3d20fcd7cf 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>
2019-02-20 12:44:06 +01:00
Johannes Schindelin
3963f55dd1 Merge branch 'fsync-object-files-always'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-02-20 12:44:06 +01:00
Johannes Schindelin
d308870033 Merge pull request #1937 from benpeart/fscache-NtQueryDirectoryFile-gfw
fscache: teach fscache to use NtQueryDirectoryFile
2019-02-20 12:44:06 +01:00
Johannes Schindelin
7f7244d96d Merge pull request #1934 from benpeart/fscache-thread-safe-enable-gfw
fscache: make fscache_enable() thread safe
2019-02-20 12:44:06 +01:00
Johannes Schindelin
f20a580e0a 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>
2019-02-20 12:44:05 +01:00
Johannes Schindelin
8e703abf4f Merge pull request #1910 from benpeart/fscache_statistics-gfw
fscache: add fscache hit statistics
2019-02-20 12:44:05 +01:00
Johannes Schindelin
5f51db4cad Merge pull request #1914 from benpeart/free-fscache-after-add-gfw
At the end of the add command, disable and free the fscache
2019-02-20 12:44:04 +01:00
Johannes Schindelin
c451d27363 Merge pull request #1911 from benpeart/git_test_fscache-gfw
fscache: add GIT_TEST_FSCACHE support
2019-02-20 12:44:04 +01:00
Johannes Schindelin
d9c4d670ac Merge pull request #1909 from benpeart/free-fscache-after-status-gfw
status: disable and free fscache at the end of the status command
2019-02-20 12:44:04 +01:00
Johannes Schindelin
13238ae07a Merge pull request #1908 from benpeart/FindFirstFileEx-gfw
fscache: use FindFirstFileExW to avoid retrieving the short name
2019-02-20 12:44:04 +01:00
Johannes Schindelin
90a343cd89 Merge pull request #1827 from benpeart/fscache_refresh_index
Enable the filesystem cache (fscache) in refresh_index().
2019-02-20 12:44:03 +01:00
Johannes Schindelin
20aa7a9122 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>
2019-02-20 12:44:03 +01:00
Johannes Schindelin
4a6ca25aa6 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>
2019-02-20 12:44:03 +01:00
Johannes Schindelin
ba59c3af75 Merge pull request #1426 from atetubou/fetch_pack
fetch-pack.c: enable fscache for stats under .git/objects
2019-02-20 12:44:03 +01:00
Johannes Schindelin
ce5cb61de2 Merge pull request #1344 from jeffhostetler/perf_add_excludes_with_fscache
dir.c: make add_excludes aware of fscache during status
2019-02-20 12:44:03 +01:00
Johannes Schindelin
1aa4acb020 Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2019-02-20 12:44:02 +01:00
Johannes Schindelin
74d8c105c3 Merge branch 'core-longpaths-everywhere'
Git for Windows supports the core.longPaths config setting to allow
writing/reading long paths via the \\?\ trick for a long time now.

However, for that support to work, it is absolutely necessary that
git_default_config() is given a chance to parse the config. Otherwise
Git will be non the wiser.

So let's make sure that as many commands that previously failed to
parse the core.* settings now do that, implicitly enabling long path
support in a lot more places.

Note: this is not a perfect solution, and it cannot be, as there is
a chicken-and-egg problem in reading the config itself...

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-02-20 12:44:02 +01:00
Johannes Schindelin
4950aaf5b3 Merge pull request #994 from jeffhostetler/jeffhostetler/fscache_nfd
fscache: add not-found directory cache to fscache
2019-02-20 12:44:02 +01:00
Johannes Schindelin
47db272245 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>
2019-02-20 12:44:02 +01:00
Johannes Schindelin
3a466e0c62 Merge branch 'clean-long-paths'
This addresses https://github.com/git-for-windows/git/issues/521

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-02-20 12:44:01 +01:00
Johannes Schindelin
61089d6129 Merge pull request #305 from dscho/msysgit_issues_182
Allow `add -p` and `add -i` with a large number of files
2019-02-20 12:44:01 +01:00
Johannes Schindelin
e3dd3e872a Merge branch 'program-data-config'
This branch introduces support for reading the "Windows-wide" Git
configuration from `%PROGRAMDATA%\Git\config`. As these settings are
intended to be shared between *all* Git-related software, that config
file takes an even lower precedence than `$(prefix)/etc/gitconfig`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-02-20 12:44:01 +01:00
Johannes Schindelin
c2b6a011cd Merge pull request #1897 from piscisaureus/symlink-attr
Specify symlink type in .gitattributes
2019-02-20 12:44:01 +01:00
Johannes Schindelin
560c232153 Merge branch 'kblees/kb/symlinks' 2019-02-20 12:44:00 +01:00
Johannes Schindelin
51b29ec86d Merge branch 'msys2' 2019-02-20 12:44:00 +01:00
Johannes Schindelin
9d7b43f413 Merge branch 'long-paths' 2019-02-20 12:44:00 +01:00
Johannes Schindelin
fdcc778db6 Merge branch 'fscache' 2019-02-20 12:44:00 +01:00
Jeff Hostetler
bdbd4add27 Merge branch 'visual-studio'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-02-20 12:43:59 +01:00
Jeff Hostetler
51fb46acca Merge branch 'msvc'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-02-20 12:43:59 +01:00
Johannes Schindelin
ea204d35c9 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>
2019-02-20 12:43:59 +01:00
Johannes Schindelin
d9ee543b19 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.
2019-02-20 12:43:59 +01:00