Commit Graph

161302 Commits

Author SHA1 Message Date
Johannes Schindelin
84bd293724 Merge branch 'fsync-object-files-always'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-17 12:03:45 +01:00
Johannes Schindelin
1cccfc6247 Merge branch 'optionally-dont-append-atomically-on-windows'
Fix append failure issue under remote directories #2753

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-17 12:03:45 +01:00
Johannes Schindelin
b788c5e209 Merge pull request #3875 from 1480c1/wine/detect_msys_tty
winansi: check result before using Name for pty
2024-12-17 12:03:45 +01:00
Johannes Schindelin
53782ceca1 Merge pull request #3751 from rkitover/native-term
mingw: set $env:TERM=xterm-256color for newer OSes
2024-12-17 12:03:45 +01:00
Derrick Stolee
2011f83fd9 Merge pull request #3791: Various fixes around safe.directory
The first three commits are rebased versions of those in gitgitgadget/git#1215. These allow the following:

1. Fix `git config --global foo.bar <path>` from allowing the `<path>`. As a bonus, users with a config value starting with `/` will not get a warning about "old-style" paths needing a "`%(prefix)/`".

2. When in WSL, the path starts with `/` so it needs to be interpolated properly. Update the warning to include `%(prefix)/` to get the right value for WSL users. (This is specifically for using Git for Windows from Git Bash, but in a WSL directory.)

3. When using WSL, the ownership check fails and reports an error message. This is noisy, and happens even if the user has marked the path with `safe.directory`. Remove that error message.
2024-12-17 12:03:44 +01:00
Johannes Schindelin
4902a50cc2 Merge pull request #3533 from PhilipOakley/hashliteral_t
Begin `unsigned long`->`size_t` conversion to support large files on Windows
2024-12-17 12:03:44 +01:00
Johannes Schindelin
559cd3c0ea Merge pull request #3417 from dscho/initialize-core.symlinks-earlier
init: respect core.symlinks before copying the templates
2024-12-17 12:03:44 +01:00
Johannes Schindelin
8d747fbc26 Merge pull request #3306 from PhilipOakley/vs-sln
Make Git for Windows start builds in modern Visual Studio
2024-12-17 12:03:43 +01:00
Johannes Schindelin
6393ad87c7 Merge pull request #3349 from vdye/feature/ci-subtree-tests
Add `contrib/subtree` test execution to CI builds
2024-12-17 12:03:43 +01:00
Johannes Schindelin
1ec408e0c2 Merge pull request #3293 from pascalmuller/http-support-automatically-sending-client-certificate
http: Add support for enabling automatic sending of SSL client certificate
2024-12-17 12:03:43 +01:00
Johannes Schindelin
faea22a20d Merge pull request #3220 from dscho/there-is-no-vs/master-anymore
Let the documentation reflect that there is no vs/master anymore
2024-12-17 12:03:43 +01:00
Johannes Schindelin
e24ed89552 Merge pull request #3165 from dscho/increase-allowed-length-of-interpreter-path
mingw: allow for longer paths in `parse_interpreter()`
2024-12-17 12:03:42 +01:00
Johannes Schindelin
dc8830b393 Merge pull request #3327 from dennisameling/fix-host-cpu
cmake(): allow setting HOST_CPU for cross-compilation
2024-12-17 12:03:42 +01:00
Johannes Schindelin
6d58ceba04 Merge pull request #2915 from dennisameling/windows-arm64-support
Windows arm64 support
2024-12-17 12:03:42 +01:00
Johannes Schindelin
94f38f54a1 Merge pull request #2351 from PhilipOakley/vcpkg-tip
Vcpkg Install: detect lack of working Git, and note possible vcpkg time outs
2024-12-17 12:03:42 +01:00
Johannes Schindelin
31005bfb6d cmake: install headless-git. (#4338)
Even if CMake is not the canonical way to build Git for Windows, but
CMake support merely exists in Git to support building Git for Windows
using Visual Studio, we should include `headless-git` in such a scenario
when installing the binaries to a given location.
2024-12-17 12:03:36 +01:00
Johannes Schindelin
d35ad5344f Merge pull request #2974 from derrickstolee/maintenance-and-headless
Include Windows-specific maintenance and headless-git
2024-12-17 12:03:36 +01:00
Johannes Schindelin
c6201fa6bf Merge 'git-gui/js/intent-to-add'
This merges the current version of the patch that tries to address Git
GUI's problems with intent-to-add files.

This patch will likely be improved substantially before it is merged
into Git GUI's main branch, but we want to have _something_ resembling a
fix already in Git for Windows v2.29.0.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-17 12:03:36 +01:00
Johannes Schindelin
ec26b3cde8 Merge pull request #2655 from jglathe/jg/t0014_trace_extra_info
t/t0014: fix: eliminate additional lines from trace
2024-12-17 12:03:35 +01:00
Johannes Schindelin
9562c4808d Merge pull request #2714 from lbonanomi/crlf-scissors
Rationalize line endings for scissors-cleanup
2024-12-17 12:03:35 +01:00
Johannes Schindelin
aff6492b15 Merge pull request #2730 from dscho/crlf-aware-git-add-i
git add -i: handle CR/LF line endings in the interactive input
2024-12-17 12:03:35 +01:00
Johannes Schindelin
c6f2476438 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>
2024-12-17 12:03:35 +01:00
Johannes Schindelin
0b0e10e630 Merge pull request #2618 from dscho/avoid-d/f-conflict-in-vs/master
ci: avoid d/f conflict in vs/master
2024-12-17 12:03:34 +01:00
Johannes Schindelin
2d57219f04 Merge pull request #2535 from dscho/schannel-revoke-best-effort
Introduce and use the new "best effort" strategy for Secure Channel revoke checking
2024-12-17 12:03:34 +01:00
Johannes Schindelin
c8bb3d8299 Merge pull request #2506 from dscho/issue-2283
Allow running Git directly from `C:\Program Files\Git\mingw64\bin\git.exe`
2024-12-17 12:03:34 +01:00
Johannes Schindelin
3e0e261460 Merge pull request #2504 from dscho/access-repo-via-junction
Handle `git add <file>` where <file> traverses an NTFS junction
2024-12-17 12:03:34 +01:00
Johannes Schindelin
cfb00aa998 Merge pull request #2501 from jeffhostetler/clink-debug-curl
clink.pl: fix MSVC compile script to handle libcurl-d.lib
2024-12-17 12:03:33 +01:00
Johannes Schindelin
30147249c3 Merge pull request #2488 from bmueller84/master
mingw: fix fatal error working on mapped network drives on Windows
2024-12-17 12:03:32 +01:00
Johannes Schindelin
a326603ef6 Merge pull request #2449 from dscho/mingw-getcwd-and-symlinks
Do resolve symlinks in `getcwd()`
2024-12-17 12:03:32 +01:00
Johannes Schindelin
6ee43699d4 Merge pull request #2405 from dscho/mingw-setsockopt
Make sure `errno` is set when socket operations fail
2024-12-17 12:03:32 +01:00
Johannes Schindelin
d670f2995a Merge pull request #2375 from assarbad/reintroduce-sideband-config
Config option to disable side-band-64k for transport
2024-12-17 12:03:32 +01:00
Johannes Schindelin
5d3008c0ae Merge branch 'mimalloc-v2.0.9'
This topic vendors in mimalloc v2.0.9, a fast allocator that allows Git
for Windows to perform efficiently.

Switch Git for Windows to using mimalloc instead of nedmalloc
2024-12-17 12:03:31 +01:00
Johannes Schindelin
43c4720a37 Merge branch 'msys2-python'
In MSYS2, we have two Python interpreters at our disposal, so we can
include the Python stuff in the build.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-17 12:03:31 +01:00
Johannes Schindelin
9e75f6b3e8 Merge branch 'dont-clean-junctions'
This topic branch teaches `git clean` to respect NTFS junctions and Unix
bind mounts: it will now stop at those boundaries.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-17 12:03:31 +01:00
Johannes Schindelin
fb8ad81147 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>
2024-12-17 12:03:31 +01:00
Johannes Schindelin
e623d47515 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>
2024-12-17 12:03:28 +01:00
Johannes Schindelin
ba722f00ef Merge branch 'safe-PATH-lookup-in-gitk-on-Windows'
This topic branch extends the protections introduced for Git GUI's
CVE-2022-41953 to cover `gitk`, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-17 12:03:28 +01:00
Johannes Schindelin
a33f3af782 Merge branch 'ps-build-followups'
This topic branch contains fixups required to make the CMake-based build
work again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-17 12:03:04 +01:00
Johannes Schindelin
31125529fb cmake/vcxproj: stop special-casing remote-ext
When the `vcxproj` target was introduced in `config.mak.uname` to allow
building Git with the Visual C toolchain, the `git remote-ext` command
was always executed in its dashed form. Therefore, it was impossible to
pass the test suite unless that command existed in its dashed form, and
we had to special-case this.

Later, when the `vcxproj` target got out of fashion because Visual
Studio gained native support for CMake builds, this special-casing was
copied without questioning it.

But as of 675df192c5 (transport-helper: do not run git-remote-ext etc.
in dashed form, 2020-08-26), the reason for this special-casing no
longer exists. So let's just drop it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-17 12:02:23 +01:00
Johannes Schindelin
9d204d28e2 cmake: put the Perl modules into the correct location again
In ccfba9e0c4 (Makefile: use "generate-perl.sh" to massage Perl
library, 2024-12-06), the previous strategy (which avoided spawning a
shell script to transform the files) was replaced by the same
`generate-perl.sh` invocation as for the Makefile-based build.

The only difference is that now the transformation tries to handle the
Perl modules in-place (which ends up in empty files because the same
file is used as input and output via stdin/stdout redirection), and the
Perl script cannot find them anymore because they are not in the
expected place.

Let's put them into the expected place again, i.e. into
`perl/build/lib/` instead of `perl/`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-17 12:02:22 +01:00
Johannes Schindelin
1671a0534a cmake: use the correct file name for the Perl header
In e4b488049a (Makefile: extract script to massage Perl scripts,
2024-12-06), the code was refactored that is used to transform the Perl
scripts/modules to their final form.

Even the CMake-based build was adjusted, but the change used the file
name `PERL-HEADER` instead of the file name used by the Makefile-based
build (same name but with the `GIT-` prefix). Let's adjust the former to
the latter.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-17 12:02:22 +01:00
Johannes Schindelin
555743c004 cmake(mergetools): better support for out-of-tree builds
In 7e0730c8ba (t: better support for out-of-tree builds, 2024-12-06)
the strategy was changed from letting `t7609-mergetool--lib.sh`
hard-code the directory where it expects to find the merge tools to
hard-coding that value in the placeholder `@GIT_TEST_MERGE_TOOLS_DIR@`
that is replaced during the build.

However, likely due to a copy/paste mistake (and reviewers missed this,
too), the CMake-based build was adjusted incorrectly, replacing that
placeholder not with the path to the merge tools, but with a Boolean
indicating whether to use a runtime-generated path prefix or not.

Let's fix that, addressing this CMake-build's symptom:

  Initialized empty Git repository in D:/a/git/git/t/trash directory.t7609-mergetool--lib/.git/
  ++ . true/vimdiff
  ./test-lib.sh: line 1021: true/vimdiff: No such file or directory

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-17 12:02:22 +01:00
Johannes Schindelin
a150449586 cmake: better support for out-of-tree builds follow-up
In 7e0730c8ba (t: better support for out-of-tree builds, 2024-12-06),
the `bin-wrappers/` strategy was changed so that it no longer hard-codes
the template directory to be `@BUILD_DIR@/templates/blt`, but instead
interpolates the `@TEMPLATE_DIR@` placeholder during the build.

However, this commit only adjusted the `Makefile`-based build.

Let's adjust the CMake-based build as well. This fixes t0000.15 which
would otherwise fail with:

  ++ echo ''\''t1234-verbose/err'\'' is not empty, it contains:'
  't1234-verbose/err' is not empty, it contains:
  ++ cat t1234-verbose/err
  warning: templates not found in @TEMPLATE_DIR@

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-17 12:02:22 +01:00
Johannes Schindelin
4652b18b7b Merge branch 'ps/mingw-rename-followup'
This fixes a bug in the implementation of `ps/mingw-rename` that
prevented directories from being handled by the POSIX-compliant
`SetFileInformationByHandle()` code path.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-17 00:44:39 +01:00
Johannes Schindelin
00eb543269 mingw_rename: do support directory renames
In 391bceae43 (compat/mingw: support POSIX semantics for atomic
renames, 2024-10-27), we taught the `mingw_rename()` function to respect
POSIX semantics, but we did so only as a fallback after `_wrename()`
fails.

This hid a bug in the implementation that was not caught by Git's test
suite: The `CreateFileW()` function _can_ open handles to directories,
but not when asked to use the `FILE_ATTRIBUTE_NORMAL` flag, as that flag
only is allowed for files.

Let's fix this by using the common `FILE_FLAG_BACKUP_SEMANTICS` flag
that can be used for opening handles to directories, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-17 00:42:56 +01:00
Johannes Schindelin
793e9903be ci: work around a problem with HTTP/2 vs libcurl v8.10.0
As reported in https://lore.kernel.org/git/ZuPKvYP9ZZ2mhb4m@pks.im/,
libcurl v8.10.0 had a regression that was picked up by Git's t5559.30
"large fetch-pack requests can be sent using chunked encoding".

This bug was fixed in libcurl v8.10.1.

Sadly, the macos-13 runner image was updated in the brief window between
these two libcurl versions, breaking each and every CI build, as
reported at https://github.com/git-for-windows/git/issues/5159.

This would usually not matter, we would just ignore the failing CI
builds until the macos-13 runner image is rebuilt in a couple of days,
and then the CI builds would succeed again.

However.

As has become the custom, a surprise Git version was released, and now
that Git for Windows wants to follow suit, since Git for Windows has
this custom of trying to never release a version with a failing CI
build, we _must_ work around it.

This patch implements this work-around, basically for the sake of Git
for Windows v2.46.2's CI build.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-16 21:04:45 +01:00
Johannes Schindelin
242321221d mingw: change core.fsyncObjectFiles = 1 by default
From the documentation of said setting:

	This boolean will enable fsync() when writing object files.

	This is a total waste of time and effort on a filesystem that
	orders data writes properly, but can be useful for filesystems
	that do not use journalling (traditional UNIX filesystems) or
	that only journal metadata and not file contents (OS X’s HFS+,
	or Linux ext3 with "data=writeback").

The most common file system on Windows (NTFS) does not guarantee that
order, therefore a sudden loss of power (or any other event causing an
unclean shutdown) would cause corrupt files (i.e. files filled with
NULs). Therefore we need to change the default.

Note that the documentation makes it sound as if this causes really bad
performance. In reality, writing loose objects is something that is done
only rarely, and only a handful of files at a time.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-16 21:04:06 +01:00
孙卓识
3b721e80b3 Add config option windows.appendAtomically
Atomic append on windows is only supported on local disk files, and it may
cause errors in other situations, e.g. network file system. If that is the
case, this config option should be used to turn atomic append off.

Co-Authored-By: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: 孙卓识 <sunzhuoshi@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-16 21:04:06 +01:00
Christopher Degawa
c2c7e037f6 winansi: check result and Buffer before using Name
NtQueryObject under Wine can return a success but fill out no name.
In those situations, Wine will set Buffer to NULL, and set result to
the sizeof(OBJECT_NAME_INFORMATION).

Running a command such as

echo "$(git.exe --version 2>/dev/null)"

will crash due to a NULL pointer dereference when the code attempts to
null terminate the buffer, although, weirdly, removing the subshell or
redirecting stdout to a file will not trigger the crash.

Code has been added to also check Buffer and Length to ensure the check
is as robust as possible due to the current behavior being fragile at
best, and could potentially change in the future

This code is based on the behavior of NtQueryObject under wine and
reactos.

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
2024-12-16 21:04:06 +01:00
Rafael Kitover
c0b742a364 mingw: $env:TERM="xterm-256color" for newer OSes
For Windows builds >= 15063 set $env:TERM to "xterm-256color" instead of
"cygwin" because they have a more capable console system that supports
this. Also set $env:COLORTERM="truecolor" if unset.

$env:TERM is initialized so that ANSI colors in color.c work, see
29a3963484 (Win32: patch Windows environment on startup, 2012-01-15).

See git-for-windows/git#3629 regarding problems caused by always setting
$env:TERM="cygwin".

This is the same heuristic used by the Cygwin runtime.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-12-16 21:04:06 +01:00