Commit Graph

106194 Commits

Author SHA1 Message Date
Johannes Schindelin
7ab70d4d2d legacy stash -p: respect the add.interactive.usebuiltin setting
As `git add` traditionally did not expose the `--patch=<mode>` modes via
command-line options, the scripted version of `git stash` had to call
`git add--interactive` directly.

But this prevents the built-in `add -p` from kicking in, as
`add--interactive` is the scripted version (which does not have a
"fall-back" to the built-in version).

So let's introduce support for internal switch for `git add` that the
scripted `git stash` can use to call the appropriate backend (scripted
or built-in, depending on `add.interactive.useBuiltin`).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-13 20:20:20 +01:00
Johannes Schindelin
e62e31e7eb built-in add -p: implement the "stash" and "reset" patch modes
The `git stash` and `git reset` commands support a `--patch` option, and
both simply hand off to `git add -p` to perform that work. Let's teach
the built-in version of that command to be able to perform that work, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-13 20:20:20 +01:00
Johannes Schindelin
8b8a1a8b8d built-in add -p: prepare for patch modes other than "stage"
The Perl script backing `git add -p` is used not only for that command,
but also for `git stash -p`, `git reset -p` and `git checkout -p`.

In preparation for teaching the C version of `git add -p` to support
also the latter commands, let's abstract away what is "stage" specific
into a dedicated data structure describing the differences between the
patch modes.

Finally, please note that the Perl version tries to make sure that the
diffs are only generated for the modified files. This is not actually
necessary, as the calls to Git's diff machinery already perform that
work, and perform it well. This makes it unnecessary to port the
`FILTER` field of the `%patch_modes` struct, as well as the
`get_diff_reference()` function.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-13 20:20:19 +01:00
Johannes Schindelin
f049d3763f Start the merging-rebase to v2.25.0
This commit starts the rebase of dabe66acd7 to 61e95214879
2020-01-13 20:20:16 +01:00
Junio C Hamano
d0654dc308 Git 2.25
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-13 10:16:43 -08:00
Junio C Hamano
b4615e40a8 Merge tag 'l10n-2.25.0-rnd1' of git://github.com/git-l10n/git-po
l10n-2.25.0-rnd1

* tag 'l10n-2.25.0-rnd1' of git://github.com/git-l10n/git-po:
  l10n: zh_CN: for git v2.25.0 l10n round 1
  l10n: Update Catalan translation
  l10n: de.po: Update German translation v2.25.0 round 1
  l10n: de.po: Reword generation numbers
  l10n: bg.po: Updated Bulgarian translation (4800t)
  l10n: es: 2.25.0 round #1
  l10n: sv.po: Update Swedish translation (4800t0f0u)
  l10n: fr.po v2.25.0 rnd 1
  l10n: vi(4800t): Updated Vietnamese translation v2.25.0
  l10n: zh_TW.po: update translation for v2.25.0 round 1
  l10n: it.po: update the Italian translation for Git 2.25.0
  l10n: git.pot: v2.25.0 round 1 (119 new, 13 removed)
  l10n: Update Catalan translation
  l10n: zh_TW: add translation for v2.24.0
2020-01-12 13:28:13 -08:00
Junio C Hamano
4d924528d8 Revert "Merge branch 'ra/rebase-i-more-options'"
This reverts commit 5d9324e0f4, reversing
changes made to c58ae96fc4.

The topic turns out to be too buggy for real use.

cf. <f2fe7437-8a48-3315-4d3f-8d51fe4bb8f1@gmail.com>
2020-01-12 13:25:18 -08:00
Jiang Xin
ddc12c429b l10n: zh_CN: for git v2.25.0 l10n round 1
Translate 119 new messages (4800t0f0u) for git 2.25.0.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2020-01-12 19:22:02 +08:00
Jiang Xin
e23b95e75b Merge branch 'master' of github.com:Softcatala/git-po into git-po-master
* 'master' of github.com:Softcatala/git-po:
  l10n: Update Catalan translation
2020-01-11 16:04:21 +08:00
Junio C Hamano
1cf4836865 Merge branch 'js/mingw-loosen-overstrict-tree-entry-checks'
Further tweak to a "no backslash in indexed paths" for Windows port
we applied earlier.

* js/mingw-loosen-overstrict-tree-entry-checks:
  mingw: safeguard better against backslashes in file names
2020-01-10 14:45:27 -08:00
Junio C Hamano
d78a1968c5 Merge branch 'ma/config-advice-markup-fix'
Documentation markup fix.

* ma/config-advice-markup-fix:
  config/advice.txt: fix description list separator
2020-01-10 14:45:26 -08:00
Jordi Mas
a20ae3ee29 l10n: Update Catalan translation
Signed-off-by: Jordi Mas <jmas@softcatala.org>
2020-01-10 22:21:55 +01:00
Johannes Schindelin via GitGitGadget
49e268e23e mingw: safeguard better against backslashes in file names
In 224c7d70fa (mingw: only test index entries for backslashes, not tree
entries, 2019-12-31), we relaxed the check for backslashes in tree
entries to check only index entries.

However, the code change was incorrect: it was added to
`add_index_entry_with_check()`, not to `add_index_entry()`, so under
certain circumstances it was possible to side-step the protection.

Besides, the description of that commit purported that all index entries
would be checked when in fact they were only checked when being added to
the index (there are code paths that do not do that, constructing
"transient" index entries).

In any case, it was pointed out in one insightful review at
https://github.com/git-for-windows/git/pull/2437#issuecomment-566771835
that it would be a much better idea to teach `verify_path()` to perform
the check for a backslash. This is safer, even if it comes with two
notable drawbacks:

- `verify_path()` cannot say _what_ is wrong with the path, therefore
  the user will no longer be told that there was a backslash in the
  path, only that the path was invalid.

- The `git apply` command also calls the `verify_path()` function, and
  might have been able to handle Windows-style paths (i.e. with
  backslashes instead of forward slashes). This will no longer be
  possible unless the user (temporarily) sets `core.protectNTFS=false`.

Note that `git add <windows-path>` will _still_ work because
`normalize_path_copy_len()` will convert the backslashes to forward
slashes before hitting the code path that creates an index entry.

The clear advantage is that `verify_path()`'s purpose is to check the
validity of the file name, therefore we naturally tap into all the code
paths that need safeguarding, also implicitly into future code paths.

The benefits of that approach outweigh the downsides, so let's move the
check from `add_index_entry_with_check()` to `verify_path()`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-10 12:29:07 -08:00
Matthias Rüster
63a5650a49 l10n: de.po: Update German translation v2.25.0 round 1
Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com>
Reviewed-by: Phillip Szelat <phillip.szelat@gmail.com>
2020-01-10 12:04:03 +01:00
Thomas Braun
75449c1b39 l10n: de.po: Reword generation numbers
The english term generation is here not used in the sense of "to
generate" but in the sense of "generations of beings".

This corrects the initial translation from cf4c0c25 (l10n: update German
translation, 2018-12-06).

Fixed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2020-01-10 12:04:03 +01:00
Alexander Shopov
6b6a9803fb l10n: bg.po: Updated Bulgarian translation (4800t)
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2020-01-09 16:32:25 +01:00
Johannes Schindelin
a4e27d9244 Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
v2.25.0-rc2.windows.1
2020-01-09 12:28:53 +01:00
Johannes Schindelin
b1fdf067cd Merge pull request #1354 from dscho/phase-out-show-ignored-directory-gracefully
Phase out `--show-ignored-directory` gracefully
2020-01-09 12:28:53 +01:00
Johannes Schindelin
f5725f6f15 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-09 12:28:53 +01:00
Johannes Schindelin
f842e9d4f6 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-09 12:28:53 +01:00
Johannes Schindelin
b97f359268 Merge branch 'busybox-w32'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-09 12:28:52 +01:00
Johannes Schindelin
a136ec1c98 Merge pull request #1897 from piscisaureus/symlink-attr
Specify symlink type in .gitattributes
2020-01-09 12:28:52 +01:00
Johannes Schindelin
876afc32a6 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-09 12:28:52 +01:00
Johannes Schindelin
5f65dea85b Merge branch 'kblees/kb/symlinks' 2020-01-09 12:28:52 +01:00
Johannes Schindelin
9728e3be52 Merge branch 'msys2' 2020-01-09 12:28:51 +01:00
Johannes Schindelin
8304d019ef Merge branch 'long-paths' 2020-01-09 12:28:51 +01:00
Johannes Schindelin
3dc6b01d8b 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-09 12:28:51 +01:00
Derrick Stolee
42414207e4 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-09 12:28:51 +01:00
Johannes Schindelin
e12f4b78b3 Merge pull request #1937 from benpeart/fscache-NtQueryDirectoryFile-gfw
fscache: teach fscache to use NtQueryDirectoryFile
2020-01-09 12:28:51 +01:00
Johannes Schindelin
91cc4715ba Merge pull request #1934 from benpeart/fscache-thread-safe-enable-gfw
fscache: make fscache_enable() thread safe
2020-01-09 12:28:50 +01:00
Johannes Schindelin
b92c7f12c3 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-09 12:28:50 +01:00
Johannes Schindelin
aa0dc8addc Merge pull request #1910 from benpeart/fscache_statistics-gfw
fscache: add fscache hit statistics
2020-01-09 12:28:50 +01:00
Johannes Schindelin
d899d0b9ef 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-09 12:28:49 +01:00
Johannes Schindelin
c8ae37999c Merge pull request #1911 from benpeart/git_test_fscache-gfw
fscache: add GIT_TEST_FSCACHE support
2020-01-09 12:28:49 +01:00
Johannes Schindelin
8603133f5a 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-09 12:28:49 +01:00
Johannes Schindelin
e8189be255 Merge pull request #1908 from benpeart/FindFirstFileEx-gfw
fscache: use FindFirstFileExW to avoid retrieving the short name
2020-01-09 12:28:49 +01:00
Johannes Schindelin
f797a728fd Merge pull request #1827 from benpeart/fscache_refresh_index
Enable the filesystem cache (fscache) in refresh_index().
2020-01-09 12:28:49 +01:00
Johannes Schindelin
a1b1c622c9 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-09 12:28:48 +01:00
Johannes Schindelin
b3d07facef Merge pull request #1426 from atetubou/fetch_pack
fetch-pack.c: enable fscache for stats under .git/objects
2020-01-09 12:28:48 +01:00
Johannes Schindelin
7d6439ea38 Merge pull request #1344 from jeffhostetler/perf_add_excludes_with_fscache
dir.c: make add_excludes aware of fscache during status
2020-01-09 12:28:48 +01:00
Johannes Schindelin
42e19aefa1 Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2020-01-09 12:28:48 +01:00
Johannes Schindelin
481cafa889 Merge pull request #994 from jeffhostetler/jeffhostetler/fscache_nfd
fscache: add not-found directory cache to fscache
2020-01-09 12:28:47 +01:00
Johannes Schindelin
400a23c613 Merge branch 'fscache' 2020-01-09 12:28:47 +01:00
Johannes Schindelin
c0d3e026ee 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-09 12:28:47 +01:00
Johannes Schindelin
19e25b4fe8 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-09 12:28:46 +01:00
Johannes Schindelin
a022cbae61 Merge 'gitk' into HEAD 2020-01-09 12:28:38 +01:00
Johannes Schindelin
8f7d1aa1fc Merge branch 'git-gui-askyesno'
These changes are necessary to support better Git for Windows' new
auto-update feature.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-09 12:28:38 +01:00
Johannes Schindelin
fc57b53668 Merge branch 'git-gui-hooks-path' of https://github.com/dscho/git-gui
Let's try to address #1755 this way.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-09 12:28:38 +01:00
Johannes Schindelin
f77e62e518 Merge 'git-gui' into HEAD 2020-01-09 12:28:38 +01:00
Johannes Schindelin
5cd16c2d5b git-gui--askyesno (mingw): use Git for Windows' icon, if available
For additional GUI goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-09 12:28:37 +01:00