Commit Graph

115389 Commits

Author SHA1 Message Date
Johannes Schindelin
f4186a16c6 status: verify that --show-ignored-directory prints a warning
The option is deprecated now, and we better make sure that keeps saying
so until we finally remove it.

Suggested by Kevin Willford.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:35:27 +02:00
Alejandro Barreto
34df3ddac6 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>
2020-05-15 13:35:27 +02:00
Johannes Schindelin
c798f9a669 .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>
2020-05-15 13:35:27 +02:00
Philip Oakley
759c8c8e4b 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>
2020-05-15 13:35:27 +02:00
Brendan Forster
b2eb7fc1cf Add an issue template
With improvements by Clive Chan, Adric Norris, Ben Bodenmiller and
Philip Oakley.

Helped-by: Clive Chan <cc@clive.io>
Helped-by: Adric Norris <landstander668@gmail.com>
Helped-by: Ben Bodenmiller <bbodenmiller@hotmail.com>
Helped-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Brendan Forster <brendan@github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:35:27 +02:00
Johannes Schindelin
418fe819f1 README.md: Add a Windows-specific preamble
Includes touch-ups by Philip Oakley.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:35:27 +02:00
Derrick Stolee
b818af1c62 CONTRIBUTING.md: add guide for first-time contributors
Getting started contributing to Git can be difficult on a Windows
machine. CONTRIBUTING.md contains a guide to getting started, including
detailed steps for setting up build tools, running tests, and
submitting patches to upstream.

[includes an example by Pratik Karki how to submit v2, v3, v4, etc.]

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
2020-05-15 13:35:27 +02:00
Johannes Schindelin
c0f66feae2 Modify the Code of Conduct for Git for Windows
The Git project followed suite and added their Code of Conduct, based on
the Contributors' Covenant v1.4.

We edit it slightly to reflect Git for Windows' particulars.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:35:27 +02:00
Johannes Schindelin
f111cb7205 status: reinstate --show-ignored-directory as a deprecated option
It was a bad idea to just remove that option from Git for Windows
v2.15.0, as early users of that (still experimental) option would have
been puzzled what they are supposed to do now.

So let's reintroduce the flag, but make sure to show the user good
advice how to fix this going forward.

We'll remove this option in a more orderly fashion either in v2.16.0 or
in v2.17.0.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:35:25 +02:00
Johannes Schindelin
d878e5711c status: carry the --no-lock-index option for backwards-compatibility
When a third-party tool periodically runs `git status` in order to keep
track of the state of the working tree, it is a bad idea to lock the
index: it might interfere with interactive commands executed by the
user, e.g. when the user wants to commit files.

Git for Windows introduced the `--no-lock-index` option a long time ago
to fix that (it made it into Git for Windows v2.9.2(3)) by simply
avoiding to write that file.

The downside is that the periodic `git status` calls will be a little
bit more wasteful because they may have to refresh the index repeatedly,
only to throw away the updates when it exits. This cannot really be
helped, though, as tools wanting to get a periodic update of the status
have no way to predict when the user may want to lock the index herself.

Sadly, a competing approach was submitted (by somebody who apparently
has less work on their plate than this maintainer) that made it into
v2.15.0 but is *different*: instead of a `git status`-only option, it is
an option that comes *before* the Git command and is called differently,
too.

Let's give previous users a chance to upgrade to newer Git for Windows
versions by handling the `--no-lock-index` option, still, though with a
big fat warning.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:35:18 +02:00
Johannes Schindelin
1fb59fa993 Merge 'gitk' into HEAD 2020-05-15 13:34:02 +02:00
Johannes Schindelin
05d4497cce Merge branch 'git-gui-askyesno'
These changes are necessary to support better Git for Windows' new
auto-update feature.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:34:02 +02:00
James J. Raden
0b4f369e2b gitk: make the "list references" default window width wider
When using remotes (with git-flow especially), the remote reference names
are almost always wordwrapped in the "list references" window because it's
somewhat narrow by default. It's possible to resize it with a mouse,
but it's annoying to have to do this every time, especially on Windows 10,
where the window border seems to be only one (1) pixel wide, thus making
the grabbing of the window border tricky.

Signed-off-by: James J. Raden <james.raden@gmail.com>
2020-05-15 13:34:01 +02:00
Johannes Schindelin
c0685e236d Merge branch 'git-gui-hooks-path' of https://github.com/dscho/git-gui
Let's try to address #1755 this way.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:34:01 +02:00
Johannes Schindelin
45b1fa5daa git-gui--askyesno (mingw): use Git for Windows' icon, if available
For additional GUI goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:34:01 +02:00
Johannes Schindelin
56dd649502 gitk: fix arrow keys in input fields with Tcl/Tk >= 8.6
Tcl/Tk 8.6 introduced new events for the cursor left/right keys and
apparently changed the behavior of the previous event.

Let's work around that by using the new events when we are running with
Tcl/Tk 8.6 or later.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:34:01 +02:00
Johannes Schindelin
6523434f40 Merge 'git-gui' into HEAD 2020-05-15 13:34:01 +02:00
Sebastian Schuberth
ce909d8f68 gitk: Use an external icon file on Windows
Git for Windows now ships with the new Git icon from git-scm.com. Use that
icon file if it exists instead of the old procedurally drawn one.

This patch was sent upstream but so far no decision on its inclusion was
made, so commit it to our fork.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2020-05-15 13:34:01 +02:00
Karsten Blees
68106d40b2 gitk: Unicode file name support
Assumes file names in git tree objects are UTF-8 encoded.

On most unix systems, the system encoding (and thus the TCL system
encoding) will be UTF-8, so file names will be displayed correctly.

On Windows, it is impossible to set the system encoding to UTF-8.
Changing the TCL system encoding (via 'encoding system ...', e.g. in the
startup code) is explicitly discouraged by the TCL docs.

Change gitk functions dealing with file names to always convert
from and to UTF-8.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:34:01 +02:00
Jeff Hostetler
69c97cf319 Merge pull request #2589 from jeffhostetler/unlink-perf-gfw
mingw: improve performance of mingw_unlink()
2020-05-15 13:34:00 +02:00
Johannes Schindelin
c505148f10 respect core.hooksPath, falling back to .git/hooks
Since v2.9.0, Git knows about the config variable core.hookspath
that allows overriding the path to the directory containing the
Git hooks.

Since v2.10.0, the `--git-path` option respects that config
variable, too, so we may just as well use that command.

For Git versions older than v2.5.0 (which was the first version to
support the `--git-path` option for the `rev-parse` command), we
simply fall back to the previous code.

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

Initial-patch-by: Philipp Gortan <philipp@gortan.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:34:00 +02:00
Johannes Schindelin
2f2d9a630f 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>
2020-05-15 13:34:00 +02:00
Johannes Schindelin
56256f9f4c git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:34:00 +02:00
Johannes Schindelin
c0d1782f79 Merge pull request #2549 from remybohmer/master
[fix] Gitk fails to open on a bare Git repository on Windows
2020-05-15 13:34:00 +02:00
Johannes Schindelin
391a2e2128 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>
2020-05-15 13:34:00 +02:00
Heiko Voigt
1d9531960c 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>
2020-05-15 13:34:00 +02:00
Johannes Schindelin
9e229d4479 Merge pull request #2535 from dscho/schannel-revoke-best-effort
Introduce and use the new "best effort" strategy for Secure Channel revoke checking
2020-05-15 13:33:59 +02:00
Johannes Schindelin
2d9966aad4 Merge pull request #2516 from nyckyta/crlf-aware-git-credential
credential.c: fix credential reading with regards to CR/LF
2020-05-15 13:33:59 +02:00
Johannes Schindelin
e3fdb4d081 Merge pull request #2506 from dscho/issue-2283
Allow running Git directly from `C:\Program Files\Git\mingw64\bin\git.exe`
2020-05-15 13:33:59 +02:00
Johannes Schindelin
59505e7ac2 Merge pull request #2504 from dscho/access-repo-via-junction
Handle `git add <file>` where <file> traverses an NTFS junction
2020-05-15 13:33:59 +02:00
Johannes Schindelin
d31733a9da Merge pull request #2501 from jeffhostetler/clink-debug-curl
clink.pl: fix MSVC compile script to handle libcurl-d.lib
2020-05-15 13:33:58 +02:00
Johannes Schindelin
72b90e77a4 Merge pull request #2488 from bmueller84/master
mingw: fix fatal error working on mapped network drives on Windows
2020-05-15 13:33:58 +02:00
Johannes Schindelin
7ed4f72f50 Merge pull request #2449 from dscho/mingw-getcwd-and-symlinks
Do resolve symlinks in `getcwd()`
2020-05-15 13:33:58 +02:00
Johannes Schindelin
a7ca33f87a Merge pull request #2405 from dscho/mingw-setsockopt
Make sure `errno` is set when socket operations fail
2020-05-15 13:33:58 +02:00
Johannes Schindelin
8237af3efc Merge pull request #2375 from assarbad/reintroduce-sideband-config
Config option to disable side-band-64k for transport
2020-05-15 13:33:57 +02:00
Johannes Schindelin
fb4028f831 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>
2020-05-15 13:33:57 +02:00
Johannes Schindelin
230c84a493 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>
2020-05-15 13:33:57 +02:00
Johannes Schindelin
786deec2c8 Merge pull request #2351 from PhilipOakley/vcpkg-tip
Vcpkg Install: detect lack of working Git, and note possible vcpkg time outs
2020-05-15 13:33:57 +02:00
Johannes Schindelin
662703aa5b Merge pull request #2316 from carenas/win-pcre1-cleanup
config.mak.uname: PCRE1 cleanup
2020-05-15 13:33:57 +02:00
Johannes Schindelin
81d92d848c 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>
2020-05-15 13:33:56 +02:00
Johannes Schindelin
89d64660ab Merge pull request #2170 from dscho/gitk-long-cmdline
Fix gitk (long cmdline)
2020-05-15 13:33:56 +02:00
Johannes Schindelin
a46a4a9268 Merge branch 'fsync-object-files-always'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:33:56 +02:00
Johannes Schindelin
38f062611c 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>
2020-05-15 13:33:55 +02:00
Johannes Schindelin
295358df49 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-05-15 13:33:55 +02:00
Johannes Schindelin
dbcdc07b55 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-05-15 13:33:55 +02:00
Johannes Schindelin
faf5d48f43 Merge pull request #996 from jeffhostetler/jeffhostetler/register_rename_src
diffcore-rename: speed up register_rename_src
2020-05-15 13:33:55 +02:00
Johannes Schindelin
e3d8a55b28 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-05-15 13:33:55 +02:00
Jeff Hostetler
24c7e680d1 mingw: improve performance of mingw_unlink()
Update mingw_unlink() to first try to delete the file with existing
permissions before trying to force it.

Windows throws an error when trying to delete a read-only file.  The
mingw_unlink() compatibility wrapper always tries to _wchmod(666) the
file before calling _wunlink() to avoid that error.  However, since
most files in the worktree are already writable, this is usually
wasted effort.

Update mingw_unlink() to just call DeleteFileW() directly and if that
succeeds return.  If that fails, fall back into the existing code path
to update the permissions and use _wunlink() to get the existing
error code mapping.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:33:54 +02:00
Remy Bohmer
d9bb41b42e [fix] Gitk fails to open on a bare Git repository on Windows
Running 'git rev-parse --show-toplevel' fails on a bare git repo.
This causes gitk to fail to startup.

Signed-off-by: Remy Bohmer <github@bohmer.net>
2020-05-15 13:33:54 +02:00
Johannes Schindelin
c45a7c4598 http: use new "best effort" strategy for Secure Channel revoke checking
The native Windows HTTPS backend is based on Secure Channel which lets
the caller decide how to handle revocation checking problems caused by
missing information in the certificate or offline CRL distribution
points.

Unfortunately, cURL chose to handle these problems differently than
OpenSSL by default: while OpenSSL happily ignores those problems
(essentially saying "¯\_(ツ)_/¯"), the Secure Channel backend will error
out instead.

As a remedy, the "no revoke" mode was introduced, which turns off
revocation checking altogether. This is a bit heavy-handed. We support
this via the `http.schannelCheckRevoke` setting.

In https://github.com/curl/curl/pull/4981, we contributed an opt-in
"best effort" strategy that emulates what OpenSSL seems to do.

In Git for Windows, we actually want this to be the default. This patch
makes it so, introducing it as a new value for the
`http.schannelCheckRevoke" setting, which now becmes a tristate: it
accepts the values "false", "true" or "best-effort" (defaulting to the
last one).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-05-15 13:29:29 +02:00