Commit Graph

121670 Commits

Author SHA1 Message Date
Johannes Schindelin
bdcbb00aca Merge pull request #3320 from dscho/fix-whitespace-gfw-readme
README: fix whitespace issue
2021-08-03 00:59:16 +02:00
Johannes Schindelin
c0153d5994 Merge pull request #3328 from thombet/fix-rmdir-with-symlinks-on-windows
rmdir: align behavior on Windows when called on symlinks
2021-07-29 15:26:56 +02:00
Thomas Bétous
7620222917 rmdir: align behavior on Windows when called on symlinks
When performing a rebase, rmdir() is called on the folder .git/logs. On
Unix rmdir() exits without deleting anything in case .git/logs is a
symbolic link but the equivalent functions on Windows (_rmdir, _wrmdir
and RemoveDirectoryW) do not behave the same and remove the folder if it
is symlink even if it is not empty.
It generates issues when folders in .git/ are symlinks which is
especially the case when git-repo[1] is used.

This commit updates mingw_rmdir() so that its behavior is the same as
Linux rmdir() in case of symbolic links.

[1]: git-repo is a python tool built on top of Git which helps manage
many Git repositories. It stores all the .git/ folders in a central
place by taking advantage of symbolic links.
More information: https://gerrit.googlesource.com/git-repo/

Signed-off-by: Thomas Bétous <tomspycell@gmail.com>
2021-07-27 22:31:32 +02:00
Johannes Schindelin
0d71536964 Merge pull request #3325 from vdye/fix-pr-description-typo
Fix typo in pull request template
2021-07-25 00:11:10 +02:00
Johannes Schindelin
b6e53edbc9 Merge pull request #3327 from dennisameling/fix-host-cpu
cmake(): allow setting HOST_CPU for cross-compilation
2021-07-19 22:09:55 +02:00
Dennis Ameling
cc48a7e0d6 ci(): add HOST_CPU to CMake command
As mentioned in the Makefile and CMakeLists.txt: "When cross-compiling, define HOST_CPU as the canonical name of the CPU on which the built Git will run (for instance "x86_64")"

This commit sets the HOST_CPU variable since Git for Windows arm64 is cross-compiled from an amd64 host.

Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
2021-07-19 13:05:19 +02:00
Dennis Ameling
390bf68d16 cmake(): allow setting HOST_CPU for cross-compilation
Git's regular Makefile mentions that HOST_CPU should be defined when cross-compiling Git: 37796bca76/Makefile (L438-L439)

This is then used to set the GIT_HOST_CPU variable when compiling Git: 37796bca76/Makefile (L1337-L1341)

Then, when the user runs `git version --build-options`, it returns that value: 37796bca76/help.c (L658)

This commit adds the same functionality to the CMake configuration. Users can now set -DHOST_CPU= to set the target architecture.

Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
2021-07-19 13:05:14 +02:00
Victoria Dye
572fd29683 fixup! Modify the GitHub Pull Request template (to reflect Git for Windows)
Fix typo in PR template

Signed-off-by: Victoria Dye <vdye@github.com>
2021-07-16 10:17:50 -04:00
Johannes Schindelin
37796bca76 Merge pull request #3317 from dscho/open-in-vs-code
README: add an "Open in VS Code" badge
2021-07-15 14:14:05 +02:00
Johannes Schindelin
7332f8520c fixup! README.md: Add a Windows-specific preamble
Fix some whitespace issues that were missed by the `check-whitespace`
job (most likely because of issues that are being fixed in
https://github.com/gitgitgadget/git/pull/995).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-07-14 15:17:04 +02:00
Johannes Schindelin
89c470c19b fixup! README.md: Add a Windows-specific preamble
This fixes a whitespace problem introduced by yours truly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-07-13 10:36:20 +02:00
Johannes Schindelin
11896aad4e fixup! README.md: Add a Windows-specific preamble
We're now using the default branch name `main`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-07-13 10:35:51 +02:00
Johannes Schindelin
f511b78df1 fixup! README.md: Add a Windows-specific preamble
Visual Studio Code _just_ introduced a new, neat feature, where clicking
on a badge can open the repository really quickly, without having to
clone it (e.g. when fixing typos or things like that).

Let's add that badge to our README.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-07-12 17:13:47 +02:00
Johannes Schindelin
3d45ac813c Merge pull request #3309 from dscho/fsmonitor-and-unicode-paths
fsmonitor: handle non-ASCII characters in the git_dir/worktree paths
v2.32.0.windows.2
2021-07-06 09:31:10 +02:00
Johannes Schindelin
ef510a35fa Merge pull request #3264 from dscho/fix-subtree-on-windows
Fix subtree on Windows
2021-07-05 16:30:14 +02:00
Johannes Schindelin
8d1cc4476b Merge pull request #3272 from dscho/fix-duplicated-lines-when-moving-in-pager
Fix duplicated lines when scrolling in the pager
2021-07-05 15:21:07 +02:00
Johannes Schindelin
ae49c8405c fixup! mingw: support long paths
Let's allow long paths in the FSMonitor daemon, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-07-05 13:54:13 +02:00
Johannes Schindelin
6f50cde5df fixup! fsmonitor-fs-listen-win32: implement FSMonitor backend on Windows
Let's keep avoiding the `*A()` family of Win32 API functions because
they are susceptible to incoherent encoding problems. In Git for
Windows, we always assume paths to be UTF-8 encoded. Let's use the
dedicated helper to convert such a path to the wide character version,
and then use the `*W()` function instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-07-05 13:51:08 +02:00
Johannes Schindelin
f1590a75e2 Merge pull request #3297 from dscho/docs-about-testing-git-in-place
Document how to build (and test) Git for Windows
2021-06-26 22:26:53 +02:00
Johannes Schindelin
2f88978401 fixup! README.md: Add a Windows-specific preamble
Add a section instructing developers how to build, and how to test the
just-built executables in-place.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-06-25 23:25:11 +02:00
Johannes Schindelin
c0919c9ed5 Merge pull request #3293 from pascalmuller/http-support-automatically-sending-client-certificate
http: Add support for enabling automatic sending of SSL client certificate
2021-06-24 20:32:51 +02:00
Pascal Muller
c1293427d0 http: optionally send SSL client certificate
This adds support for a new http.sslAutoClientCert config value.

In cURL 7.77 or later the schannel backend does not automatically send
client certificates from the Windows Certificate Store anymore.

This config value is only used if http.sslBackend is set to "schannel",
and can be used to opt in to the old behavior and force cURL to send
client certificates.

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

Signed-off-by: Pascal Muller <pascalmuller@gmail.com>
2021-06-24 14:27:01 +02:00
Johannes Schindelin
47d568403f Merge pull request #3287 from dscho/redo-fsmonitor-null-last-update
Redo fix for FSMonitor
2021-06-21 23:24:06 +02:00
Jeff Hostetler
65a2766b34 fixup! fsmonitor: introduce core.useBuiltinFSMonitor to call the daemon via IPC
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2021-06-21 21:29:39 +02:00
Johannes Schindelin
fe2ee68de4 pager: avoid setting COLUMNS when we're guessing its value
We query `TIOCGWINSZ` in Git to determine the correct value for
`COLUMNS`, and then set that environment variable.

If `TIOCGWINSZ` is not available, we fall back to the hard-coded value
80 _and still_ set the environment variable.

On Windows this is a problem. The reason is that Git for
Windows uses a version of `less` that relies on the MSYS2 runtime to
interact with the pseudo terminal (typically inside a MinTTY window,
which is also aware of the MSYS2 runtime). Both MinTTY and `less.exe`
interact with that pseudo terminal via `ioctl()` calls (which the MSYS2
runtime emulates even if there is no such thing on Windows).
Since https://github.com/gwsw/less/commit/bb0ee4e76c2, `less` prefers
the `COLUMNS` variable over asking ncurses itself.

But `git.exe` itself is _not_ aware of the MSYS2 runtime, or for that
matter of that pseudo terminal, and has no way to call `ioctl()` or
`TIOCGWINSZ`.

Therefore, `git.exe` will fall back to hard-coding 80 columns, no matter
what the actual terminal size is.

But `less.exe` is totally able to interact with the MSYS2 runtime and
would not actually require Git's help (which actually makes things
worse here). So let's not override `COLUMNS` on Windows.

Let's just not set `COLUMNS` unless we managed to query the actual value
from the terminal.

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

Co-authored-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-06-21 15:19:03 +02:00
Johannes Schindelin
5b320b3764 Merge pull request #3275 from dscho/monitor-libgcrypt
Monitor libgpg-error and libgcrypt versions
2021-06-17 09:30:55 +02:00
Johannes Schindelin
75f0e21527 fixup! Add a GitHub workflow to monitor component updates
Since we're now watching out for new libgcrypt versions, let's also
watch out for its dependency libgpg-error.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-06-16 13:50:14 +02:00
Johannes Schindelin
99984b34fa fixup! Add a GitHub workflow to monitor component updates
Let's watch out for new libgcrypt versions, too (this component is a
pretty important dependency of gnupg).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-06-16 13:50:14 +02:00
Johannes Schindelin
a6f7aa4048 subtree: fix assumption about the directory separator
On Windows, both forward and backslash are valid separators. In
22d5507493 (subtree: don't fuss with PATH, 2021-04-27), however, we
added code that assumes that it can only be the forward slash.

Let's fix that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-06-14 13:49:54 +02:00
Johannes Schindelin
5f2d9434b4 subtree: fix the GIT_EXEC_PATH sanity check to work on Windows
In 22d5507493 (subtree: don't fuss with PATH, 2021-04-27), `git
subtree` was broken thoroughly on Windows.

The reason is that it assumes Unix semantics, where `PATH` is
colon-separated, and it assumes that `$GIT_EXEC_PATH:` is a verbatim
prefix of `$PATH`. Neither are true, the latter in particular because
`GIT_EXEC_PATH` is a Windows-style path, while `PATH` is a Unix-style
path list.

Let's make extra certain that `$GIT_EXEC_PATH` and the first component
of `$PATH` refer to different entities before erroring out.

We do that by using the `test <path1> -ef <path2>` command that verifies
that the inode of `<path1>` and of `<path2>` is the same.

Sadly, this construct is non-portable, according to
https://pubs.opengroup.org/onlinepubs/009695399/utilities/test.html.
However, it does not matter in practice because we still first look
whether `$GIT_EXEC_PREFIX` is string-identical to the first component of
`$PATH`. This will give us the expected result everywhere but in Git for
Windows, and Git for Windows' own Bash _does_ handle the `-ef` operator.

Just in case that we _do_ need to show the error message _and_ are
running in a shell that lacks support for `-ef`, we simply suppress the
error output for that part.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-06-14 13:48:06 +02:00
Johannes Schindelin
b312fa405f Merge pull request #3263 from dscho/fix-built-in-fsmonitor
FSMonitor fixes
2021-06-09 18:05:27 +02:00
Johannes Schindelin
cfa0c45308 fixup! fsmonitor--daemon: use a cookie file to sync with file system
When the built-in FSMonitor receives an invalid v2 token, we do not
actually need to wait for a cookie file. There simply is no use for
waiting in this instance. It's not like the client will all of a sudden
realize that it sent an incorrect token and somehow make up a correct
token from thin air in a follow-up query.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-06-09 11:30:46 +02:00
Johannes Schindelin
bc40a560d3 fixup! fsmonitor: introduce core.useBuiltinFSMonitor to call the daemon via IPC
In FSMonitor v1, we made sure to only use a valid `since_token` when
querying the FSMonitor. This condition was accidentally lost in v2, and
caused segmentation faults uncovered by Scalar's Functional Tests.

I had tried to fix this in https://github.com/git-for-windows/pull/3241,
but the fix was incomplete, and I had to follow up with
https://github.com/git-for-windows/pull/3258. However, it turns out that
both of them were actually only work-arounds; I should have dug deeper
to figure out _why_ the `since_token` was no longer guaranteed not to be
`NULL`, and I finally did.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-06-09 11:30:45 +02:00
Johannes Schindelin
92392daccb fixup! fsmonitor--daemon: use a cookie file to sync with file system
When the built-in FSMonitor receives an unexpected token, we do not
actually need to wait for a cookie file. There simply is no use for
waiting in this instance. It's not like the client will all of a sudden
realize that it sent an incorrect token and somehow make up a correct
token from thin air in a follow-up query.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-06-09 11:30:45 +02:00
Johannes Schindelin
5ec07b8c4a fixup! fsmonitor--daemon: use a cookie file to sync with file system
When flushing the FSMonitor data, we do not actually need to wait for a
cookie file. In the worst case, we will over-report a bit.

If we _do_ wait for a cookie file, in the worst case we cause a hang
because the FSMonitor daemon will wait and wait even though the `.git/`
directory might be gone already.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-06-09 11:30:45 +02:00
Johannes Schindelin
7eb8372f9f fixup! fsmonitor-ipc: create client routines for git-fsmonitor--daemon
Now that we have a correct fix where we guarantee again (just like
v1 of the built-in FSMonitor) that `since_token` is not `NULL`, we can
revert the work-arounds introduced by these two PRs:

- https://github.com/git-for-windows/pull/3241

- https://github.com/git-for-windows/pull/3258

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-06-09 11:30:45 +02:00
Johannes Schindelin
4c204998d0 Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
v2.32.0.windows.1
2021-06-07 13:17:37 +02:00
Johannes Schindelin
49ab356854 Merge pull request #2837 from dscho/monitor-component-updates
Start monitoring updates of Git for Windows' component in the open
2021-06-07 13:17:36 +02:00
Johannes Schindelin
05dcc28835 Merge branch 'phase-out-reset-stdin'
This topic branch re-adds the deprecated --stdin/-z options to `git
reset`. Those patches were overridden by a different set of options in
the upstream Git project before we could propose `--stdin`.

We offered this in MinGit to applications that wanted a safer way to
pass lots of pathspecs to Git, and these applications will need to be
adjusted.

Instead of `--stdin`, `--pathspec-from-file=-` should be used, and
instead of `-z`, `--pathspec-file-nul`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-06-07 13:17:35 +02:00
Johannes Schindelin
c62914926f Merge pull request #1354 from dscho/phase-out-show-ignored-directory-gracefully
Phase out `--show-ignored-directory` gracefully
2021-06-07 13:17:35 +02:00
Johannes Schindelin
9de0986555 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>
2021-06-07 13:17:34 +02:00
Johannes Schindelin
b77e8454e6 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>
2021-06-07 13:17:34 +02:00
Johannes Schindelin
d6abe2016f Merge branch 'busybox-w32'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-06-07 13:17:33 +02:00
Johannes Schindelin
a01ee50dc5 Merge pull request #1897 from piscisaureus/symlink-attr
Specify symlink type in .gitattributes
2021-06-07 13:17:33 +02:00
Johannes Schindelin
2d2c48a723 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>
2021-06-07 13:17:32 +02:00
Johannes Schindelin
23990c4c55 Merge branch 'kblees/kb/symlinks' 2021-06-07 13:17:32 +02:00
Johannes Schindelin
4cffb69020 Merge branch 'msys2' 2021-06-07 13:17:31 +02:00
Johannes Schindelin
4a5df48b7f Merge branch 'long-paths' 2021-06-07 13:17:30 +02:00
Johannes Schindelin
c435be679b 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>
2021-06-07 13:17:30 +02:00
Johannes Schindelin
e004dc207e SECURITY.md: document Git for Windows' policies
This is the recommended way on GitHub to describe policies revolving around
security issues and about supported versions.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-06-07 13:17:29 +02:00