Commit Graph

117703 Commits

Author SHA1 Message Date
Karsten Blees
16a9aa79bd mingw: make the dirent implementation pluggable
Emulating the POSIX `dirent` API on Windows via
`FindFirstFile()`/`FindNextFile()` is pretty staightforward, however,
most of the information provided in the `WIN32_FIND_DATA` structure is
thrown away in the process. A more sophisticated implementation may
cache this data, e.g. for later reuse in calls to `lstat()`.

Make the `dirent` implementation pluggable so that it can be switched at
runtime, e.g. based on a config option.

Define a base DIR structure with pointers to `readdir()`/`closedir()`
that match the `opendir()` implementation (similar to vtable pointers in
Object-Oriented Programming). Define `readdir()`/`closedir()` so that
they call the function pointers in the `DIR` structure. This allows to
choose the `opendir()` implementation on a call-by-call basis.

Make the fixed-size `dirent.d_name` buffer a flex array, as `d_name` may
be implementation specific (e.g. a caching implementation may allocate a
`struct dirent` with _just_ the size needed to hold the `d_name` in
question).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:44 +01:00
Karsten Blees
538306569b Win32: dirent.c: Move opendir down
Move opendir down in preparation for the next patch.

Signed-off-by: Karsten Blees <blees@dcon.de>
2021-03-02 23:28:44 +01:00
Karsten Blees
3297d51168 Win32: make FILETIME conversion functions public
We will use them in the upcoming "FSCache" patches (to accelerate
sequential lstat() calls).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:44 +01:00
Johannes Schindelin
735ea089c4 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.
2021-03-02 23:28:43 +01:00
Johannes Schindelin
5d609a23c5 Merge pull request #3017 from dennisameling/add-arm64-artifacts
git-artifacts: add ARM64 artifacts
2021-03-02 23:28:43 +01:00
Johannes Schindelin
f0c729e93d Merge pull request #2586 from dscho/build-git-artifacts
Add a GitHub workflow to generate Git for Windows' installer, portable Git, MinGit, etc
2021-03-02 23:28:42 +01:00
Johannes Schindelin
d7b3c18579 Merge pull request #2971 from dennisameling/vcpkg-dlls
cmake(install): include vcpkg dlls
2021-03-02 23:28:42 +01:00
Johannes Schindelin
62c1bd22c9 Merge pull request #2966 from dennisameling/fix-double-exe
Fix double .exe suffixes in CMakeLists.txt
2021-03-02 23:28:42 +01:00
Johannes Schindelin
b494b4e48b Merge pull request #2915 from dennisameling/windows-arm64-support
Windows arm64 support
2021-03-02 23:28:42 +01:00
Johannes Schindelin
8ad0d8ed05 Merge pull request #2351 from PhilipOakley/vcpkg-tip
Vcpkg Install: detect lack of working Git, and note possible vcpkg time outs
2021-03-02 23:28:41 +01:00
Johannes Schindelin
60f9488b61 Merge pull request #2974 from derrickstolee/maintenance-and-headless
Include Windows-specific maintenance and headless-git
2021-03-02 23:28:41 +01:00
Johannes Schindelin
797f836ddf 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>
2021-03-02 23:28:40 +01:00
Johannes Schindelin
801c97dbc8 Merge branch 'prompt-and-set-u'
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:40 +01:00
Johannes Schindelin
754f4a6c8f Merge pull request #2655 from jglathe/jg/t0014_trace_extra_info
t/t0014: fix: eliminate additional lines from trace
2021-03-02 23:28:40 +01:00
Johannes Schindelin
618d80fe1d Merge pull request #2714 from lbonanomi/main
Rationalize line endings for scissors-cleanup
2021-03-02 23:28:40 +01:00
Johannes Schindelin
6c808a692e Merge pull request #2730 from dscho/crlf-aware-git-add-i
git add -i: handle CR/LF line endings in the interactive input
2021-03-02 23:28:39 +01:00
Johannes Schindelin
a591d0f68c 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>
2021-03-02 23:28:39 +01:00
Johannes Schindelin
95df6664a7 Merge pull request #2618 from dscho/avoid-d/f-conflict-in-vs/master
ci: avoid d/f conflict in vs/master
2021-03-02 23:28:39 +01:00
Johannes Schindelin
1f6f5343f9 Merge pull request #2535 from dscho/schannel-revoke-best-effort
Introduce and use the new "best effort" strategy for Secure Channel revoke checking
2021-03-02 23:28:39 +01:00
Johannes Schindelin
d01607baf3 Merge pull request #2506 from dscho/issue-2283
Allow running Git directly from `C:\Program Files\Git\mingw64\bin\git.exe`
2021-03-02 23:28:38 +01:00
Johannes Schindelin
56f47e6a22 Merge pull request #2504 from dscho/access-repo-via-junction
Handle `git add <file>` where <file> traverses an NTFS junction
2021-03-02 23:28:38 +01:00
Johannes Schindelin
2f05253af7 Merge pull request #2501 from jeffhostetler/clink-debug-curl
clink.pl: fix MSVC compile script to handle libcurl-d.lib
2021-03-02 23:28:38 +01:00
Johannes Schindelin
0500b37cd8 Merge pull request #2488 from bmueller84/master
mingw: fix fatal error working on mapped network drives on Windows
2021-03-02 23:28:37 +01:00
Johannes Schindelin
3a05096b56 Merge pull request #2449 from dscho/mingw-getcwd-and-symlinks
Do resolve symlinks in `getcwd()`
2021-03-02 23:28:37 +01:00
Johannes Schindelin
fd52cdfb4e Merge pull request #2405 from dscho/mingw-setsockopt
Make sure `errno` is set when socket operations fail
2021-03-02 23:28:37 +01:00
Johannes Schindelin
8b89557baa Merge pull request #2375 from assarbad/reintroduce-sideband-config
Config option to disable side-band-64k for transport
2021-03-02 23:28:36 +01:00
Johannes Schindelin
ac72d587b6 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>
2021-03-02 23:28:36 +01:00
Johannes Schindelin
a44b58c8a5 Merge branch 'move-gfw-system-config-to-top-level'
Make `git config --system` work like you think it should on Windows: it
should edit the file that is located in `<Git>\etc\gitconfig`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:36 +01:00
Johannes Schindelin
e3b72b328b Merge pull request #2316 from carenas/win-pcre1-cleanup
config.mak.uname: PCRE1 cleanup
2021-03-02 23:28:36 +01:00
Johannes Schindelin
93493a99cb 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>
2021-03-02 23:28:35 +01:00
Johannes Schindelin
9fbd9b6932 Merge pull request #2170 from dscho/gitk-long-cmdline
Fix gitk (long cmdline)
2021-03-02 23:28:35 +01:00
Johannes Schindelin
3cea806db7 Merge branch 'fsync-object-files-always'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:35 +01:00
Johannes Schindelin
acbe760d23 Merge branch 'dont-spawn-gzip-in-archive'
This topic branch avoids spawning `gzip` when asking `git archive` to
create `.tar.gz` files.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:34 +01:00
Johannes Schindelin
a8ac9a2605 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>
2021-03-02 23:28:34 +01:00
Johannes Schindelin
dc08c758a8 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>
2021-03-02 23:28:34 +01:00
Dennis Ameling
3019bd536c git-artifacts: add ARM64 artifacts
Adds ARM64 artifacts to the git-artifacts GitHub Action workflow.

Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:33 +01:00
Johannes Schindelin
a631c91894 git-artifacts: use the cached build-installers instead of makepkg-git
When building the Pacman packages, we technically do not need the full
`build-installers` artifact (which is substantially larger than the
`makepkg-git` artifact). However, the former is already cached and
includes the latter's files. And it is _so_ much faster to download the
cached (larger) artifact than to download the smaller `makepkg-git`
artifact from Azure Pipelines.

Suggested-by: Dennis Ameling <dennis@dennisameling.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:33 +01:00
Johannes Schindelin
a3c49ec4c5 Merge pull request #996 from jeffhostetler/jeffhostetler/register_rename_src
diffcore-rename: speed up register_rename_src
2021-03-02 23:28:33 +01:00
Dennis Ameling
d19c2664e0 git-artifacts: cache the build-installers artifact
It is a bit expensive to fetch just the git-sdk-64-build-installers
artifact from Azure Pipelines and then to unpack it (takes some 6-7
minutes, typically). Let's cache it if possible.

Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:33 +01:00
Johannes Schindelin
014ed8265d 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>
2021-03-02 23:28:33 +01:00
Johannes Schindelin
97a09572bb git-artifacts: allow specifying repo/ref via workflow_dispatch
With this change, users can specify the branch and repository from which
they want to build Git for Windows' artifacts, via the `ref` and
`repository` inputs.

This allows e.g. building `refs/heads/seen` of `git/git` (even if no
`git-artifacts` workflow is configured in that repository), or
`refs/pull/<number>/merge` for a given Pull Request.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:33 +01:00
Johannes Schindelin
6833c9e87b git-artifacts: allow restricting which artifacts are built
Users can now specify which artifacts they want to build, via the
`build_only` input, which is a space-separated list of artifacts. For
example, `installer portable` will build `installer-x86_64`,
`installer-i686`, `portable-x86_64` and `portable-i686`, and an empty or
unset value will build all artifacts.

Please note that the `mingw-w64-git` packages are built always, as it
would be tricky to figure out when they need to be built (for example,
`build_only=portable-x86_64` technically does not need `pkg-i686` to be
built, while `build_only=portable` does).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:33 +01:00
Johannes Schindelin
d2c045813e git-artifacts: also build the nuget package
The two NuGet artifact exists only in the 64-bit version. So let's make
them in a separate, non-matrix job.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:33 +01:00
Dennis Ameling
defe76a4eb GitHub Actions: Add vcpkg initialization step
This commit adds a step called "initialize vcpkg" to the GitHub Actions
workflow, because we need some build scripts from vcpkg that aren't
present in our vcpkg artifacts from Azure Pipelines.

Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
2021-03-02 23:28:32 +01:00
Dennis Ameling
f41c508ac5 cmake(install): fix double .exe suffixes
By mistake, the `.exe` extension is appended _twice_ when installing the
dashed executables into `libexec/git-core/` on Windows (the extension is
already appended when adding items to the `git_links` list in the
`#Creating hardlinks` section).

Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:32 +01:00
Johannes Schindelin
9cb7a41c78 git-artifacts: also build 32-bit versions
Just in case that we need to generate those real quick.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:32 +01:00
Johannes Schindelin
17eb505b3c cmake: work around recent vcpkg update
In f1f5dff9e7 (cmake: installation support for git, 2020-06-26), we
added support for the CMake equivalent of `make install` that makes
use of multiple targets within one invocation of `install(TARGETS ...).
This is totally fine according to CMake's documentation at
https://cmake.org/cmake/help/latest/command/install.html#command:install).

And this was still fine even after ecf7ee3cd5 (cmake(install):
include vcpkg dlls, 2021-01-08) where we started to use `vcpkg`'s CMake
scripts to ensure that the `.dll` files of Git's dependencies are also
installed.

However, with a recent update of `vcpkg`, the handling of local
dependencies was changed in a way that is incompatible with our CMake
definition. The symptom looks like this:

CMake Error at <worktree>/compat/vcbuild/vcpkg/scripts/buildsystems/vcpkg.cmake:734 (get_target_property):
  get_target_property() called with non-existent target "git;git-shell".
Call Stack (most recent call first):
  <worktree>/compat/vcbuild/vcpkg/scripts/buildsystems/vcpkg.cmake:784 (x_vcpkg_install_local_dependencies)
  CMakeLists.txt:821 (install)

The apparent reason for this breakage is that the `vcpkg` changes in
https://github.com/microsoft/vcpkg/commit/1bb5ea10a3 no longer allows an
arbitrary number of targets to be specified in `install(TARGETS ...)`.

Let's work around this by feeding the target individually to the
`install(TARGETS ...)` function.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:32 +01:00
Johannes Schindelin
becf528744 git-artifacts: also build portable, mingit and mingit-busybox
... because we can.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:32 +01:00
Dennis Ameling
e24bff717a cmake(install): include vcpkg dlls
Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
2021-03-02 23:28:32 +01:00
Johannes Schindelin
eb1720bb56 git-artifacts: also build the installer
While at it, we might just as well build the Git for Windows installer
;-)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-03-02 23:28:32 +01:00