Commit Graph

108378 Commits

Author SHA1 Message Date
Johannes Schindelin
e857ff9b9e 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-04-08 16:45:44 +02:00
Sebastian Schuberth
78e2347c12 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-04-08 16:45:44 +02:00
Karsten Blees
20c0cec3d7 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-04-08 16:45:44 +02:00
Johannes Schindelin
3505ae548d Start the merging-rebase to v2.26.0
When merging the PR that replaces the Azure Pipeline with a GitHub
workflow, we had to resolve merge conflicts (actually, those merge
conflicts were resolved _in_ the PR's commits). Part of the merge
conflicts come from our README modifications, part of them come from our
BusyBox patches.

To avoid having to resolve them every time the `ever-green.sh` script is
used by the automated builds that rebase Git for Windows' `master` onto
Git's four integration branches, let's reorder the patches (and modify
some) to still yield the exact same tree, but with a cleaner commit
history.

This commit starts the rebase of a6da52b51e to adf6396efeb4

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-04-08 16:41:56 +02:00
Johannes Schindelin
8decad3d60 Merge pull request #2577 from dscho/github-action+musl
Add a CI/PR workflow based on GitHub Actions
2020-04-08 01:04:10 +02:00
Johannes Schindelin
7e4a0d29e7 Merge 'sgn/github-action-latest'
This topic thicket defines a Continuous Integration/Pull Request build
using GitHub Actions, and retires our Azure Pipeline in return.

The secondary change in this topic thicket is to make sure that Git
works with musl's libc and with BusyBox (which simplifies/changes a
couple of Git for Windows' own BusyBox patches, too).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-04-07 21:07:16 +02:00
Johannes Schindelin
79570841b4 Merge branch 'sgn/github-action-v4-on-2.26.0'
This topic branch replaces the Azure Pipeline with a GitHub workflow.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-04-07 21:05:46 +02:00
Johannes Schindelin
ef54ed56e6 Merge branch 'dd/test-with-busybox'
This topic branch is actually _required_ for `dd/ci-musl-libc` to work.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-04-07 21:05:45 +02:00
Johannes Schindelin
bae9f17369 Merge branch 'dd/ci-musl-libc'
A new CI job to build and run test suite on linux with musl libc has
been added.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-04-07 21:05:44 +02:00
Johannes Schindelin
36a62374a9 ci: let GitHub Actions upload failed tests' directories
Arguably, CI builds' most important task is to not only identify
regressions, but to make it as easy as possible to investigate what went
wrong.

In that light, we will want to provide users with a way to inspect the
tests' output as well as the corresponding directories.

This commit adds build steps that are only executed when tests failed,
uploading the relevant information as build artifacts. These artifacts
can then be downloaded by interested parties to diagnose the failures
more efficiently.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:36:31 +07:00
Johannes Schindelin
651fd37cd5 ci: add a problem matcher for GitHub Actions
With this patch, test failures will be annotated with a helpful,
clickable message in GitHub Actions. For details, see
https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md

Note: we need to set `TEST_SHELL_PATH` to Bash so that the problem
matcher is fed a file and line number for each test failure.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:36:31 +07:00
Johannes Schindelin
bcf50f3eda tests: when run in Bash, annotate test failures with file name/line number
When a test fails, it is nice to see where the corresponding code lives
in the worktree. Sadly, it seems that only Bash allows us to infer this
information. Let's do it when we detect that we're running in a Bash.

This will come in handy in the next commit, where we teach the GitHub
Actions workflow to annotate failed test runs with this information.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:36:31 +07:00
Johannes Schindelin
0c8ca7efca ci: retire the Azure Pipelines definition
We have GitHub Actions now. Running the same builds and tests in Azure
Pipelines would be redundant, and a waste of energy.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:36:31 +07:00
Johannes Schindelin
9ebd9fcbc9 README: add a build badge for the GitHub Actions runs
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:36:31 +07:00
Đoàn Trần Công Danh
2988786977 ci: configure GitHub Actions for CI/PR
This patch adds CI builds via GitHub Actions. While the underlying
technology is at least _very_ similar to that of Azure Pipelines, GitHub
Actions are much easier to set up than Azure Pipelines:

- no need to install a GitHub App,

- no need to set up an Azure DevOps account,

- all you need to do is push to your fork on GitHub.

Therefore, it makes a lot of sense for us to have a working GitHub
Actions setup.

While copy/editing `azure-pipelines.yml` into
`.github/workflows/main.yml`, we also use the opportunity to accelerate
the step that sets up a minimal subset of Git for Windows' SDK in the
Windows-build job:

- we now download a `.tar.xz` stored in Azure Blobs and extract it
  simultaneously by calling `curl` and piping the result to `tar`,

- decompressing via `xz`,

- all three utilities are installed together with Git for Windows

At the same time, we also make use of the matrix build feature, which
reduces the amount of repeated text by quite a bit.

Also, we do away with the parts that try to mount a file share on which
`prove` can store data between runs. It is just too complicated to set
up, and most times the tree changes anyway, so there is little return on
investment there.

Initial-patch-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:36:31 +07:00
Johannes Schindelin
7bc64fa7d2 ci: run gem with sudo to install asciidoctor
In a later patch, we will run Documentation job in GitHub Actions.
The job will run without elevated permission.

Run `gem` with `sudo` to elevate permission in order to be able to
install to system location.
This will also keep this installation in-line with other installation in
our Linux system for CI.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
[Danh: reword commit message]
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:36:31 +07:00
Đoàn Trần Công Danh
e81d6f7607 ci: explicit install all required packages
In a later patch, we will support GitHub Action.

Explicitly install all of our build dependencies.
Since GitHub Action VM hasn't install our build dependencies, yet.
And there're no harm to reinstall them (in Travis)

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:36:31 +07:00
Johannes Schindelin
25edca25c7 ci: fix the jobname of the GETTEXT_POISON job
In 6cdccfce1e (i18n: make GETTEXT_POISON a runtime option,
2018-11-08), the `jobname` was adjusted to have the `GIT_TEST_` prefix,
but that prefix makes no sense in this context.

Co-authored-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:36:00 +07:00
Đoàn Trần Công Danh
c66945b1ff ci/lib: set TERM environment variable if not exist
GitHub Action doesn't set TERM environment variable, which is required
by "tput".

Fallback to dumb if it's not set.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:30:41 +07:00
Johannes Schindelin
290de522d9 ci/lib: allow running in GitHub Actions
For each CI system we support, we need a specific arm in that if/else
construct in ci/lib.sh. Let's add one for GitHub Actions.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:30:41 +07:00
Johannes Schindelin
e56f24aec4 ci/lib: if CI type is unknown, show the environment variables
This should help with adding new CI-specific if-else arms.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:30:09 +07:00
Đoàn Trần Công Danh
396481a127 travis: build and test on Linux with musl libc and busybox
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:01:54 +07:00
Đoàn Trần Công Danh
3a4609d926 Merge branch 'dd/test-with-busybox' into HEAD 2020-04-07 22:01:54 +07:00
Đoàn Trần Công Danh
3c781e3c27 ci/linux32: libify install-dependencies step
In a later patch, we will add new Travis Job for linux-musl.
Most of other code in this file could be reuse for that job.

Move the code to install dependencies to a common script.
Should we add new CI system that can run directly in container,
we can reuse this script for installation step.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:01:54 +07:00
Đoàn Trần Công Danh
53170f3950 ci: refactor docker runner script
We will support alpine check in docker later in this series.

While we're at it, tell people to run as root in podman,
if podman is used as drop-in replacement for docker,
because podman will map host-user to container's root,
therefore, mapping their permission.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:01:54 +07:00
Đoàn Trần Công Danh
61f96e27c3 ci/linux32: parameterise command to switch arch
In a later patch, the remaining of this command will be re-used for the
CI job for linux with musl libc.

Allow customisation of the emulator, now.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:01:54 +07:00
Đoàn Trần Công Danh
9a6c71177b ci/lib-docker: preserve required environment variables
We're using "su -m" to preserve environment variables in the shell run
by "su". But, that options will be ignored while "-l" (aka "--login") is
specified in util-linux and busybox's su.

In a later patch this script will be reused for checking Git for Linux
with musl libc on Alpine Linux, Alpine Linux uses "su" from busybox.

Since we don't have interest in all environment variables,
pass only those necessary variables to the inner script.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:01:54 +07:00
SZEDER Gábor
8023d01bcc ci: make MAKEFLAGS available inside the Docker container in the Linux32 job
Once upon a time we ran 'make --jobs=2 ...' to build Git, its
documentation, or to apply Coccinelle semantic patches.  Then commit
eaa62291ff (ci: inherit --jobs via MAKEFLAGS in run-build-and-tests,
2019-01-27) came along, and started using the MAKEFLAGS environment
variable to centralize setting the number of parallel jobs in
'ci/libs.sh'.  Alas, it forgot to update 'ci/run-linux32-docker.sh' to
make MAKEFLAGS available inside the Docker container running the 32
bit Linux job, and, consequently, since then that job builds Git
sequentially, and it ignores any Makefile knobs that we might set in
MAKEFLAGS (though we don't set any for the 32 bit Linux job at the
moment).

So update the 'docker run' invocation in 'ci/run-linux32-docker.sh' to
make MAKEFLAGS available inside the Docker container as well.  Set
CC=gcc for the 32 bit Linux job, because that's the compiler installed
in the 32 bit Linux Docker image that we use (Travis CI nowadays sets
CC=clang by default, but clang is not installed in this image).

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-04-07 22:01:54 +07:00
Johannes Schindelin
120c8b8ba0 README: remove obsolete build badge
We no longer test specifically whether Git's source code builds under
`core.autoCRLF=true`, as this is already tested implicitly by our
Windows CI/PR builds.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-04-07 15:17:48 +02:00
Johannes Schindelin
86440948da Merge pull request #2574 from rimrul/ucrt-strftime
mingw: use modern strftime implementation if possible
2020-04-07 02:27:04 +02:00
Matthias Aßhauer
6b80b39d8b mingw: use modern strftime implementation if possible
Microsoft introduced a new "Universal C Runtime Library" (UCRT) with
Visual Studio 2015. The UCRT comes with a new strftime() implementation that
supports more date formats. We link git against the older "Microsoft Visual C
Runtime Library" (MSVCRT), so to use the UCRT strftime() we need to load it from
ucrtbase.dll using DECLARE_PROC_ADDR()/INIT_PROC_ADDR().

Most supported Windows systems should have recieved the UCRT via Windows update,
but in some cases only MSVCRT might be available. In that case we fall back to
using that implementation.

This fixes git-for-windows/git#2495

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
2020-04-05 22:23:24 +02:00
Đoàn Trần Công Danh
84370e36bb t5703: feed raw data into test-tool unpack-sideband
busybox's sed isn't binary clean.
Thus, triggers false-negative on this test.

We could replace sed with perl on this usecase.
But, we could slightly modify the helper to discard unwanted data in the
beginning.

Fix the false negative by updating this helper.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-26 17:30:48 -07:00
Đoàn Trần Công Danh
f73533aa38 t4124: tweak test so that non-compliant diff(1) can also be used
The diff(1) implementation of busybox produces the unified context
format even without being asked, and it cannot produce the default
format, but a test in this script relies on.

We could rewrite the test so that we count the lines in the
postimage out of the unified context format, but the format is not
supported by some implementations of diff (e.g. HP-UX).

Accomodate busybox by adding a fallback code to count postimage
lines in unified context output, when counting in the output in the
default format finds nothing.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
[jc: applied Documentation/CodingGuidelines and tweaked the log message]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-26 17:19:14 -07:00
Đoàn Trần Công Danh
d51dd4ca3a t7063: drop non-POSIX argument "-ls" from find(1)
Since commit 6b7728db81, (t7063: work around FreeBSD's lazy mtime
update feature, 2016-08-03), we started to use ls as a trick to update
directory's mtime.

However, `-ls` flag isn't required by POSIX's find(1), and
busybox(1) doesn't implement it.

Use "-exec ls -ld {} +" instead.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-25 08:54:37 -07:00
Đoàn Trần Công Danh
6c28bef2d4 t5616: use rev-parse instead to get HEAD's object_id
Only HEAD's object_id is necessary, rev-list is an overkill.

Despite POSIX requires grep(1) treat single pattern with <newline>
as multiple patterns.
busybox's grep(1) (as of v1.31.1) haven't implemented it yet.

Use rev-parse to simplify the test and avoid busybox unimplemented
features.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-25 08:54:37 -07:00
Đoàn Trần Công Danh
ff0dab331e t5003: skip conversion test if unzip -a is unavailable
Alpine Linux's default unzip(1) doesn't support `-a`.

Skip those tests on that platform.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-25 08:54:37 -07:00
Đoàn Trần Công Danh
6e45972cd7 t5003: drop the subshell in test_lazy_prereq
test_lazy_prereq will be evaluated in a throw-away directory.

Drop unnecessary subshell and mkdir.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-25 08:54:37 -07:00
Đoàn Trần Công Danh
6ec5df61d5 test-lib-functions: test_cmp: eval $GIT_TEST_CMP
Shell recognises first non-assignment token as command name.
With /bin/sh linked to either /bin/bash or /bin/dash,
`cd t/perf && ./p0000-perf-lib-sanity.sh -d -i -v` reports:

> test_cmp:1: command not found: diff -u

Using `eval` to unquote $GIT_TEST_CMP as same as precedence in `git_editor`.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-25 08:54:37 -07:00
Đoàn Trần Công Danh
1f27522d8c t4061: use POSIX compliant regex(7)
BRE interprets `+` literally, and
`\+` is undefined for POSIX BRE, from:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_02

> The interpretation of an ordinary character preceded
> by an unescaped <backslash> ( '\\' ) is undefined, except for:
> - The characters ')', '(', '{', and '}'
> - The digits 1 to 9 inclusive
> - A character inside a bracket expression

This test is failing with busybox sed, the default sed of Alpine Linux

We have 2 options here:

- Using literal `+` because BRE will interpret it as-is, or
- Using character class `[+]` to defend against a sed that expects ERE

ERE-expected sed is theoretical at this point,
but we haven't found it, yet.
And, we may run into other problems with that sed.
Let's go with first option and fix it later if that sed could be found.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-25 08:54:37 -07:00
Johannes Schindelin
9c98e1ccdf Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
v2.26.0.windows.1
2020-03-23 09:23:40 +01:00
Johannes Schindelin
b55c92f4ad 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>
2020-03-23 09:23:40 +01:00
Johannes Schindelin
2dbfbffd82 Merge pull request #1354 from dscho/phase-out-show-ignored-directory-gracefully
Phase out `--show-ignored-directory` gracefully
2020-03-23 09:23:40 +01:00
Johannes Schindelin
40394e1a0b 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>
2020-03-23 09:23:39 +01:00
Johannes Schindelin
336a39dc54 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>
2020-03-23 09:23:39 +01:00
Johannes Schindelin
94448d8ac6 Merge branch 'busybox-w32'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-23 09:23:39 +01:00
Johannes Schindelin
f9846e6645 Merge pull request #1897 from piscisaureus/symlink-attr
Specify symlink type in .gitattributes
2020-03-23 09:23:38 +01:00
Johannes Schindelin
f1c488a299 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>
2020-03-23 09:23:38 +01:00
Johannes Schindelin
a1d33ba99a Merge branch 'kblees/kb/symlinks' 2020-03-23 09:23:38 +01:00
Johannes Schindelin
7bce52f048 Merge branch 'msys2' 2020-03-23 09:23:37 +01:00
Johannes Schindelin
28e1a795dc Merge branch 'long-paths' 2020-03-23 09:23:37 +01:00