Commit Graph

105665 Commits

Author SHA1 Message Date
Johannes Schindelin
13e1471b10 Merge pull request #1915 from dscho/open-in-gdb
Add a helper function to start GDB that was already attached to the current process
2020-01-03 20:54:16 +01:00
Johannes Schindelin
652b25ea00 Merge branch 'mingw-expand-absolute-user-path'
When compiling Git with a runtime prefix (so that it can be installed
into any location, finding its libexec/ directory relative to the
location of the `git` executable), it is convenient to provide
"absolute" Unix-y paths e.g. for http.sslCAInfo, and have those absolute
paths be resolved relative to the runtime prefix.

This patch makes it so for Windows. It is up for discussion whether we
want this for other platforms, too, as long as building with
RUNTIME_PREFIX.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-03 20:54:16 +01:00
Johannes Schindelin
ac2081a620 Merge branch 'test-unc-fetch'
Fix fetching from UNC paths.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-03 20:54:16 +01:00
Johannes Schindelin
188f09660b Merge branch 'drive-prefix'
This topic branch allows us to specify absolute paths without the drive
prefix e.g. when cloning.

Example:

	C:\Users\me> git clone https://github.com/git/git \upstream-git

This will clone into a new directory C:\upstream-git, in line with how
Windows interprets absolute paths.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-03 20:54:15 +01:00
Johannes Schindelin
0945081118 Merge pull request #996 from jeffhostetler/jeffhostetler/register_rename_src
diffcore-rename: speed up register_rename_src
2020-01-03 20:54:14 +01:00
Johannes Schindelin
4163e8ad8c Merge 'remote-hg-prerequisites' into HEAD
These fixes were necessary for Sverre Rabbelier's remote-hg to work,
but for some magic reason they are not necessary for the current
remote-hg. Makes you wonder how that one gets away with it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-03 20:54:14 +01:00
Johannes Schindelin
19a43cc1a7 Merge branch 'reset-stdin'
This topic branch adds the (experimental) --stdin/-z options to `git
reset`. Those patches are still under review in the upstream Git project,
but are already merged in their experimental form into Git for Windows'
`master` branch, in preparation for a MinGit-only release.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-03 20:54:14 +01:00
Johannes Schindelin
d511a2ae36 mingw: add a helper function to attach GDB to the current process
When debugging Git, the criss-cross spawning of processes can make
things quite a bit difficult, especially when a Unix shell script is
thrown in the mix that calls a `git.exe` that then segfaults.

To help debugging such things, we introduce the `open_in_gdb()` function
which can be called at a code location where the segfault happens (or as
close as one can get); This will open a new MinTTY window with a GDB
that already attached to the current process.

Inspired by Derrick Stolee.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-03 20:45:24 +01:00
Johannes Schindelin
41813ae173 mingw: handle absolute paths in expand_user_path()
On Windows, an absolute POSIX path needs to be turned into a Windows
one.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-03 20:45:24 +01:00
Johannes Schindelin
609e729714 t5580: test cloning without file://, test fetching via UNC paths
It gets a bit silly to add the commands to the name of the test script,
so let's just rename it while we're testing more UNC stuff.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-03 20:45:24 +01:00
Johannes Schindelin
352b8e5c7c mingw: allow absolute paths without drive prefix
When specifying an absolute path without a drive prefix, we convert that
path internally. Let's make sure that we handle that case properly, too
;-)

This fixes the command

	git clone https://github.com/git-for-windows/git \G4W

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-03 20:45:23 +01:00
Jeff Hostetler
1fe940668a diffcore-rename: speed up register_rename_src
Teach register_rename_src() to see if new file pair
can simply be appended to the rename_src[] array before
performing the binary search to find the proper insertion
point.

This is a performance optimization.  This routine is called
during run_diff_files in status and the caller is iterating
over the sorted index, so we should expect to be able to
append in the normal case.  The existing insert logic is
preserved so we don't have to assume that, but simply take
advantage of it if possible.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2020-01-03 20:45:23 +01:00
Johannes Schindelin
789c614aeb Always auto-gc after calling a fast-import transport
After importing anything with fast-import, we should always let the
garbage collector do its job, since the objects are written to disk
inefficiently.

This brings down an initial import of http://selenic.com/hg from about
230 megabytes to about 14.

In the future, we may want to make this configurable on a per-remote
basis, or maybe teach fast-import about it in the first place.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-03 20:45:23 +01:00
Johannes Schindelin
5311a5d4aa mingw: demonstrate a problem with certain absolute paths
On Windows, there are several categories of absolute paths. One such
category starts with a backslash and is implicitly relative to the
drive associated with the current working directory. Example:

	c:
	git clone https://github.com/git-for-windows/git \G4W

should clone into C:\G4W.

There is currently a problem with that, in that mingw_mktemp() does not
expect the _wmktemp() function to prefix the absolute path with the
drive prefix, and as a consequence, the resulting path does not fit into
the originally-passed string buffer. The symptom is a "Result too large"
error.

Reported by Juan Carlos Arevalo Baeza.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-03 20:45:23 +01:00
Sverre Rabbelier
89d44e46ac remote-helper: check helper status after import/export
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
2020-01-03 20:45:23 +01:00
Sverre Rabbelier
b4d45a7900 transport-helper: add trailing --
[PT: ensure we add an additional element to the argv array]

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-03 20:45:23 +01:00
Sverre Rabbelier
d80a247dfb t9350: point out that refs are not updated correctly
This happens only when the corresponding commits are not exported in
the current fast-export run. This can happen either when the relevant
commit is already marked, or when the commit is explicitly marked
as UNINTERESTING with a negative ref by another argument.

This breaks fast-export basec remote helpers.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
2020-01-03 20:45:23 +01:00
Johannes Schindelin
8857bb52ec Start the merging-rebase to v2.25.0-rc1
This commit starts the rebase of 3ee5f1f885 to d5b9efb81ba
2020-01-03 20:45:22 +01:00
Johannes Schindelin
db8e8a8186 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-01-03 20:45:22 +01:00
Johannes Schindelin
8fc9b8676b Merge pull request #2437 from dscho/only-error-on-backslash-in-index
Disallow writing, but not fetching commits with file names containing backslashes
2020-01-03 20:41:38 +01:00
Johannes Schindelin
0c54f76894 Merge pull request #2449 from dscho/mingw-getcwd-and-symlinks
Do resolve symlinks in `getcwd()`
2020-01-03 20:34:06 +01:00
Junio C Hamano
8679ef24ed Git 2.25-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-02 12:38:30 -08:00
Junio C Hamano
a82027e9e6 Merge branch 'js/use-test-tool-on-path'
Test fix.

* js/use-test-tool-on-path:
  t3008: find test-tool through path lookup
2020-01-02 12:38:30 -08:00
Junio C Hamano
13432fc6dd Merge branch 'js/mingw-reserved-filenames'
Forbid pathnames that the platform's filesystem cannot represent on
MinGW.

* js/mingw-reserved-filenames:
  mingw: refuse paths containing reserved names
  mingw: short-circuit the conversion of `/dev/null` to UTF-16
2020-01-02 12:38:30 -08:00
Junio C Hamano
e0e1ac5db0 Merge branch 'en/rebase-signoff-fix'
"git rebase --signoff" stopped working when the command was written
in C, which has been corrected.

* en/rebase-signoff-fix:
  rebase: fix saving of --signoff state for am-based rebases
2020-01-02 12:38:30 -08:00
Junio C Hamano
b76a244c9d Merge branch 'em/freebsd-cirrus-ci'
* em/freebsd-cirrus-ci:
  CI: add FreeBSD CI support via Cirrus-CI
2020-01-02 12:38:29 -08:00
Junio C Hamano
bc855232bc Merge branch 'bk/p4-misc-usability'
Miscellaneous small UX improvements on "git-p4".

* bk/p4-misc-usability:
  git-p4: show detailed help when parsing options fail
  git-p4: yes/no prompts should sanitize user text
2020-01-02 12:38:29 -08:00
Johannes Schindelin
8afef17373 mingw: do resolve symlinks in getcwd()
As pointed out in https://github.com/git-for-windows/git/issues/1676,
the `git rev-parse --is-inside-work-tree` command currently fails when
the current directory's path contains symbolic links.

The underlying reason for this bug is that `getcwd()` is supposed to
resolve symbolic links, but our `mingw_getcwd()` implementation did not.

We do have all the building blocks for that, though: the
`GetFinalPathByHandleW()` function will resolve symbolic links. However,
we only called that function if `GetLongPathNameW()` failed, for
historical reasons: the latter function was supported for a long time,
but the former API function was introduced only with Windows Vista, and
we used to support also Windows XP. With that support having been
dropped, we are free to call the symbolic link-resolving function right
away.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-01-01 21:07:22 +01:00
Johannes Sixt
20a67e8ce9 t3008: find test-tool through path lookup
Do not use $GIT_BUILD_DIR without quotes; it may contain spaces and be
split into fields. But it is not necessary to access test-tool with an
absolute path in the first place as it can be found via path lookup.
Remove the explicit path.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-27 14:15:01 -08:00
Johannes Schindelin
2249a76fa1 Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
v2.25.0-rc0.windows.1
2019-12-27 09:26:30 +01:00
Johannes Schindelin
53f13ea32a Merge pull request #1354 from dscho/phase-out-show-ignored-directory-gracefully
Phase out `--show-ignored-directory` gracefully
2019-12-27 09:26:29 +01:00
Johannes Schindelin
9551b5a0be 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-12-27 09:26:28 +01:00
Johannes Schindelin
9dd2877d32 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-12-27 09:26:28 +01:00
Johannes Schindelin
aa2ed60cae Merge branch 'busybox-w32'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-12-27 09:26:27 +01:00
Johannes Schindelin
94cde609ec Merge pull request #1897 from piscisaureus/symlink-attr
Specify symlink type in .gitattributes
2019-12-27 09:26:26 +01:00
Johannes Schindelin
c229d4d3fa 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-12-27 09:26:26 +01:00
Johannes Schindelin
5d455f453f Merge branch 'kblees/kb/symlinks' 2019-12-27 09:26:25 +01:00
Johannes Schindelin
38159a0ad6 Merge branch 'msys2' 2019-12-27 09:26:25 +01:00
Johannes Schindelin
baa71f4be3 Merge branch 'long-paths' 2019-12-27 09:26:24 +01:00
Johannes Schindelin
6021631447 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>
2019-12-27 09:26:23 +01:00
Derrick Stolee
82dc309682 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.
2019-12-27 09:26:23 +01:00
Johannes Schindelin
ee695f37d4 Merge pull request #1937 from benpeart/fscache-NtQueryDirectoryFile-gfw
fscache: teach fscache to use NtQueryDirectoryFile
2019-12-27 09:26:22 +01:00
Johannes Schindelin
89d6ed6119 Merge pull request #1934 from benpeart/fscache-thread-safe-enable-gfw
fscache: make fscache_enable() thread safe
2019-12-27 09:26:22 +01:00
Johannes Schindelin
65d07ba525 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-12-27 09:26:22 +01:00
Johannes Schindelin
8a8eac385f Merge pull request #1910 from benpeart/fscache_statistics-gfw
fscache: add fscache hit statistics
2019-12-27 09:26:21 +01:00
Johannes Schindelin
73ee893b1e Merge pull request #1914 from benpeart/free-fscache-after-add-gfw
At the end of the add command, disable and free the fscache
2019-12-27 09:26:20 +01:00
Johannes Schindelin
ce52d8d04e Merge pull request #1911 from benpeart/git_test_fscache-gfw
fscache: add GIT_TEST_FSCACHE support
2019-12-27 09:26:20 +01:00
Johannes Schindelin
7aa3a5338e Merge pull request #1909 from benpeart/free-fscache-after-status-gfw
status: disable and free fscache at the end of the status command
2019-12-27 09:26:19 +01:00
Johannes Schindelin
c8fa3c784d Merge pull request #1908 from benpeart/FindFirstFileEx-gfw
fscache: use FindFirstFileExW to avoid retrieving the short name
2019-12-27 09:26:19 +01:00
Johannes Schindelin
39f0ed019f Merge pull request #1827 from benpeart/fscache_refresh_index
Enable the filesystem cache (fscache) in refresh_index().
2019-12-27 09:26:19 +01:00