Commit Graph

135178 Commits

Author SHA1 Message Date
Johannes Schindelin
5ec6ed8751 git-gui--askyesno: allow overriding the window title
"Question?" is maybe not the most informative thing to ask. In the
absence of better information, it is the best we can do, of course.

However, Git for Windows' auto updater just learned the trick to use
git-gui--askyesno to ask the user whether to update now or not. And in
this scripted scenario, we can easily pass a command-line option to
change the window title.

So let's support that with the new `--title <title>` option.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 15:44:24 -07:00
Johannes Schindelin
cff0c90199 git-gui--askyesno: fix funny text wrapping
The text wrapping seems to be aligned to the right side of the Yes
button, leaving an awful lot of empty space.

Let's try to counter this by using pixel units.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 15:44:24 -07:00
Johannes Schindelin
3833e40fc1 git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 15:44:24 -07:00
Heiko Voigt
e796f2cd23 git-gui: provide question helper for retry fallback on Windows
Make use of the new environment variable GIT_ASK_YESNO to support the
recently implemented fallback in case unlink, rename or rmdir fail for
files in use on Windows. The added dialog will present a yes/no question
to the the user which will currently be used by the windows compat layer
to let the user retry a failed file operation.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
2022-08-11 15:44:24 -07:00
Victoria Dye
18a30267ed Start the merging-rebase to v2.37.2
This commit starts the rebase of ad4a8fbd6f to 31522284ab
2022-08-11 15:44:17 -07:00
Johannes Schindelin
cd2bc1aa59 Merge pull request #3753 from pgrmega/patch-2
Fix when lazy caching of network shares tags directories were just created with previously-unhandled attributes
v2.37.2.windows.1
2022-08-11 13:07:10 -07:00
Johannes Schindelin
21b7200be7 Merge pull request #3942 from rimrul/mingw-tsaware
MinGW: link as terminal server aware
2022-08-11 13:07:10 -07:00
Johannes Schindelin
66deab4991 lstat(mingw): correctly detect ENOTDIR scenarios
Files' attributes can indicate more than just whether they are files or
directories. It was reported in Git for Windows that on certain network
shares, this led to a nasty problem trying to create tags:

	$ git tag -a -m "automatic tag creation"  test_dir/test_tag
	fatal: cannot lock ref 'refs/tags/test_dir/test_tag': unable to resolve reference 'refs/tags/test_dir/test_tag': Not a directory

Note: This does not necessarily happen with all types of network shares.
One setup where it _did_ happen is a Windows Server 2019 VM, and as
hinted in

	http://woshub.com/slow-network-shared-folder-refresh-windows-server/

in the indicated instance the following commands worked around the bug:

	Set-SmbClientConfiguration -DirectoryCacheLifetime 0
	Set-SmbClientConfiguration -FileInfoCacheLifetime 0
	Set-SmbClientConfiguration -FileNotFoundCacheLifetime 0

This would impact performance negatively, though, as it essentially
turns off all caching, therefore we do not want to require users to do
that just to be able to use Git on Windows.

The underlying bug is in the code added in 4b0abd5c69 (mingw: let
lstat() fail with errno == ENOTDIR when appropriate, 2016-01-26) that
emulates the POSIX behavior where `lstat()` should return `ENOENT` if
the file or directory simply does not exist but could be created, and
`ENOTDIR` if there is no file or directory nor could there be because a
leading path already exists and is not a directory.

In that code, the return value of `GetFileAttributesW()` is interpreted
as an enum value, not as a bit field, so that a perfectly fine leading
directory can be misdetected as "not a directory".

As a consequence, the `read_refs_internal()` function would return
`ENOTDIR`, suggesting not only that the tag in the `git tag` invocation
above does not exist, but that it cannot even be created.

Let's fix the code so that it interprets the return value of the
`GetFileAttributesW()` call correctly.

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

Reported-by: Pierre Garnier <pgarnier@mega.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:07:10 -07:00
Johannes Schindelin
cc2552a514 Merge pull request #3960 from dscho/fix-vimdiff-with-spaces-in-paths
mergetool(vimdiff): allow paths to contain spaces again
2022-08-11 13:07:10 -07:00
Matthias Aßhauer
dc07a2ee42 MinGW: link as terminal server aware
Whith Windows 2000, Microsoft introduced a flag to the PE header to mark executables as
"terminal server aware". Windows terminal servers provide a redirected Windows directory and
redirected registry hives when launching legacy applications without this flag set. Since we
do not use any INI files in the Windows directory and don't write to the registry, we don't
need  this additional preparation. Telling the OS that we don't need this should provide
slightly improved startup times in terminal server environments.

When building for supported Windows Versions with MSVC the /TSAWARE linker flag is
automatically set, but MinGW requires us to set the --tsaware flag manually.

This partially addresses https://github.com/git-for-windows/git/issues/3935.

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
2022-08-11 13:07:10 -07:00
Johannes Schindelin
ba1aabbb5c Merge branch 'ci-fixes'
Backport a couple fixes to make the CI build run again (so much for
reproducible builds...).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:07:09 -07:00
Victoria Dye
36ff645154 Start the merging-rebase to v2.37.2
This commit starts the rebase of 6ea06d278b to 31522284ab
2022-08-11 13:07:09 -07:00
Taylor Blau
53d3d2c21f azure-pipeline: run static-analysis on bionic
This is a backport of d051ed77ee (.github/workflows/main.yml: run
static-analysis on bionic, 2021-02-08) to the Azure Pipeline.

When Azure Pipelines' build agents transitioned 'ubuntu-latest' from
18.04 to 20.04, it broke our `static-analysis` job, since Coccinelle
isn't available on Ubuntu focal (it is only available in the universe
suite).

Until Coccinelle can be installed from 20.04's main suite, pin the
static-analysis build to run on 18.04, where it can be installed by
default.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:07:02 -07:00
Johannes Schindelin
77a17ab641 azure-pipeline: downcase the job name of the Linux32 job
These many refactorings in Git sure are gifts that keep on giving.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:07:02 -07:00
Johannes Schindelin
0188303728 azure-pipeline: use partial clone/parallel checkout to initialize minimal-sdk
The Azure Pipeline `git-sdk-64-minimal` was retired...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:07:02 -07:00
Johannes Schindelin
2f1f69944d azure-pipeline: drop the code to write to/read from a file share
We haven't used this feature in ages, we don't actually need to.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:07:02 -07:00
Johannes Schindelin
2cc5953e3c azure-pipeline: stop hard-coding apt-get calls
We have `ci/install-dependencies.sh` for that. Incidentally, this avoids
the following error in the linux-* jobs:

    The following packages have unmet dependencies:
    git-email : Depends: git (< 1:2.25.1-.) but 1:2.35.1-0ppa1~ubuntu20.04.1 is to be installed
	  Recommends: libemail-valid-perl but it is not going to be installed

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:07:02 -07:00
Johannes Schindelin
e958ab2025 azure-pipeline: drop the GETTEXT_POISON job
This is a follow-up to 6c280b4142 (ci: remove GETTEXT_POISON jobs,
2021-01-20) after reinstating the Azure Pipeline.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:07:02 -07:00
Johannes Schindelin
2b4dd453df ci: reinstate Azure Pipelines support
... so that we can test a MinGit backport in a private repository (with
GitHub Actions, minutes and parallel jobs are limited way more than with
Azure Pipelines in private repositories).

In this commit, we reinstate the exact version of `azure-pipelines.yml`
as 6081d3898f (ci: retire the Azure Pipelines definition, 2020-04-11)
deleted.

Naturally, many adjustments are required to make it work again. Some of
the changes are actually outside of that file (such as the
`runs_on_pool` changes that are needed in the Azure Pipelines part of
`ci/lib.sh`) and they were made in the commits leading up to this here
commit.

However, other adjustments are required in the `azure-pipelines.yml`
file itself, and for ease of review (read: to build confidence in those
changes) they will be made in subsequent, individual commits that
explain the intent, context, implementation and justification like every
good commit message should do.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:07:02 -07:00
Johannes Schindelin
7a1a140d00 ci: stop linking the prove cache
It is not useful because we do not have any persisted directory anymore,
not since dropping our Travis CI support.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:07:02 -07:00
Johannes Schindelin
256c00fb39 ci: adjust Azure Pipeline for runs_on_pool
These refactorings are really gifts that keep on giving.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:07:02 -07:00
Johannes Schindelin
1b55bcb7c7 vcxproj: avoid escaping double quotes in the defines
Visual Studio 2022 does not like that at all.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:06:59 -07:00
Johannes Schindelin
3bae02fc3b vcxproj: handle libreftable_test, too
Since ef8a6c6268 (reftable: utility functions, 2021-10-07) we not only
have a libreftable, but also a libreftable_test.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:06:59 -07:00
Johannes Schindelin
2c3393db4d vcxproj: include reftable when committing .vcxproj files
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:06:59 -07:00
Johannes Schindelin
3065de244c vcxproj: ignore the -pedantic option
This is now passed by default, ever since 6a8cbc41ba (developer: enable
pedantic by default, 2021-09-03).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:06:59 -07:00
Johannes Schindelin
00f5747aca vcxproj: require C11
This fixes the build after 7bc341e21b (git-compat-util: add a test
balloon for C99 support, 2021-12-01).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:06:59 -07:00
Johannes Schindelin
568c564b96 vcxproj: allow building with NO_PERL again
This is another fall-out of the recent refactoring flurry.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:06:59 -07:00
Johannes Schindelin
acf8ca650f Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:06:21 -07:00
Johannes Schindelin
f1ac5c33fa Merge pull request #2837 from dscho/monitor-component-updates
Start monitoring updates of Git for Windows' component in the open
2022-08-11 13:06:21 -07:00
Johannes Schindelin
a033d0d460 Merge branch 'deprecate-old-runtime-prefix-path-interpolation'
Previously, we interpolated paths in config variables that start with a
forward-slash as relative to the runtime prefix. This was not portable
and has been replaced with `%(prefix)/`.

Let's warn users when they use the now-deprecated form.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:06:21 -07:00
Johannes Schindelin
0857aec358 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>
2022-08-11 13:06:21 -07:00
Johannes Schindelin
477d2fff41 Merge branch 'un-revert-editor-save-and-reset'
A fix for calling `vim` in Windows Terminal caused a regression and was
reverted. We partially un-revert this, to get the fix again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:06:20 -07:00
Victoria Dye
2792d3971b Merge pull request #3492 from dscho/ns/batched-fsync
Switch to batched fsync by default
2022-08-11 13:06:20 -07:00
Johannes Schindelin
fc4e08bd0c 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>
2022-08-11 13:06:20 -07:00
Johannes Schindelin
7174d4f517 Merge branch 'busybox-w32'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:06:20 -07:00
Johannes Schindelin
c4df6cfd07 Merge pull request #1897 from piscisaureus/symlink-attr
Specify symlink type in .gitattributes
2022-08-11 13:06:20 -07:00
Johannes Schindelin
484434a2ee 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>
2022-08-11 13:06:20 -07:00
Johannes Schindelin
4739b36333 Merge branch 'kblees/kb/symlinks' 2022-08-11 13:06:20 -07:00
Johannes Schindelin
d65e2a3c07 Merge branch 'msys2' 2022-08-11 13:06:20 -07:00
Johannes Schindelin
8a8b55f28d 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>
2022-08-11 13:06:19 -07:00
Johannes Schindelin
64315a5e56 Add a GitHub workflow to monitor component updates
Rather than using private IFTTT Applets that send mails to this
maintainer whenever a new version of a Git for Windows component was
released, let's use the power of GitHub workflows to make this process
publicly visible.

This workflow monitors the Atom/RSS feeds, and opens a ticket whenever a
new version was released.

Note: Bash sometimes releases multiple patched versions within a few
minutes of each other (i.e. 5.1p1 through 5.1p4, 5.0p15 and 5.0p16). The
MSYS2 runtime also has a similar system. We can address those patches as
a group, so we shouldn't get multiple issues about them.

Note further: We're not acting on newlib releases, OpenSSL alphas, Perl
release candidates or non-stable Perl releases. There's no need to open
issues about them.

Co-authored-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:06:19 -07:00
Johannes Schindelin
b3285b2cd2 mingw: deprecate old-style runtime-prefix handling in interpolate_path()
On Windows, an absolute POSIX path needs to be turned into a Windows
one. We used to interpret paths starting with a single `/` as relative
to the runtime-prefix, but now these need to be prefixed with
`%(prefix)/`. Let's warn for now, but still handle it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:06:19 -07:00
Johannes Schindelin
e18ccd7770 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>
2022-08-11 13:06:19 -07:00
Johannes Schindelin
2b4ba8aaef Merge pull request #3817 from mathstuf/name-too-long-advice
clean: suggest using `core.longPaths` if paths are too long to remove
2022-08-11 13:06:19 -07:00
Alejandro Barreto
5e0a74ed90 Document how $HOME is set on Windows
Git documentation refers to $HOME and $XDG_CONFIG_HOME often, but does not specify how or where these values come from on Windows where neither is set by default. The new documentation reflects the behavior of setup_windows_environment() in compat/mingw.c.

Signed-off-by: Alejandro Barreto <alejandro.barreto@ni.com>
2022-08-11 13:06:19 -07:00
Jeff Hostetler
6ec7924798 Merge branch 'fix-v4-fsmonitor-long-paths' into try-v4-fsmonitor 2022-08-11 13:06:19 -07:00
Johannes Schindelin
33fc84b577 .github: Add configuration for the Sentiment Bot
The sentiment bot will help detect when things get too heated.
Hopefully.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:06:19 -07:00
Johannes Schindelin
fd560de49f Merge branch 'long-paths' 2022-08-11 13:06:19 -07:00
Philip Oakley
abf71d400c Modify the GitHub Pull Request template (to reflect Git for Windows)
Git for Windows accepts pull requests; Core Git does not. Therefore we
need to adjust the template (because it only matches core Git's
project management style, not ours).

Also: direct Git for Windows enhancements to their contributions page,
space out the text for easy reading, and clarify that the mailing list
is plain text, not HTML.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-08-11 13:06:19 -07:00
Johannes Schindelin
affd109b57 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>
2022-08-11 13:06:19 -07:00