Commit Graph

93809 Commits

Author SHA1 Message Date
Johannes Schindelin
28d9da38c2 .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>
2018-12-15 08:35:25 +01:00
Philip Oakley
465cd9c403 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>
2018-12-15 08:35:25 +01:00
Brendan Forster
5e86cb8935 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>
2018-12-15 08:35:25 +01:00
Johannes Schindelin
9610584f1c README.md: Add a Windows-specific preamble
Includes touch-ups by Philip Oakley.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:35:25 +01:00
Derrick Stolee
fb15861090 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>
2018-12-15 08:35:25 +01:00
Johannes Schindelin
4ff629f094 Add a Code of Conduct
It is better to state clearly expectations and intentions than to assume
quietly that everybody agrees.

This Code of Conduct is the Open Code of Conduct as per
http://todogroup.org/opencodeofconduct/ (the only modifications are the
adjustments to reflect that there is no "response team" in addition to the
Git for Windows maintainer, and the addition of the link to the Open Code
of Conduct itself).

[Completely revamped, based on the Covenant 1.4 by Brendan Forster]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:35:25 +01:00
Johannes Schindelin
0c08820773 travis: fix skipping tagged releases
When building a PR, TRAVIS_BRANCH refers to the *target branch*.
Therefore, if a PR targets `master`, and `master` happened to be tagged,
we skipped the build by mistake.

Fix this by using TRAVIS_PULL_REQUEST_BRANCH (i.e. the *source branch*)
when available, falling back to TRAVIS_BRANCH (i.e. for CI builds, also
known as "push builds").

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:34:58 +01:00
Johannes Schindelin
2f334815c6 README: add a build badge (status of the Azure Pipelines build)
Just like so many other OSS projects, we now also have a build badge.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:34:57 +01:00
Johannes Schindelin
095e9ec07e tests: include detailed trace logs with --write-junit-xml upon failure
The JUnit XML format lends itself to be presented in a powerful UI,
where you can drill down to the information you are interested in very
quickly.

For test failures, this usually means that you want to see the detailed
trace of the failing tests.

With Travis CI, we passed the `--verbose-log` option to get those
traces. However, that seems excessive, as we do not need/use the logs in
almost all of those cases: only when a test fails do we have a way to
include the trace.

So let's do something different when using Azure DevOps: let's run all
the tests with `--quiet` first, and only if a failure is encountered,
try to trace the commands as they are executed.

Of course, we cannot turn on `--verbose-log` after the fact. So let's
just re-run the test with all the same options, adding `--verbose-log`.
And then munging the output file into the JUnit XML on the fly.

Note: there is an off chance that re-running the test in verbose mode
"fixes" the failures (and this does happen from time to time!). That is
a possibility we should be able to live with. Ideally, we would label
this as "Passed upon rerun", and Azure Pipelines even know about that
outcome, but it is not available when using the JUnit XML format for
now:
https://github.com/Microsoft/azure-pipelines-agent/blob/master/src/Agent.Worker/TestResults/JunitResultReader.cs

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:34:11 +01:00
Johannes Schindelin
43207143ff git-p4: use test_atexit to kill the daemon
This should be more reliable than the current method, and prepares the
test suite for a consistent way to clean up before re-running the tests
with different options.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:49 +01:00
Johannes Schindelin
65159044cd git-daemon: use test_atexit in the tests
This makes use of the just-introduced consistent way to specify that a
long-running process needs to be terminated at the end of a test script
run.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:49 +01:00
Johannes Schindelin
a515c55c8f tests: introduce test_atexit
When running the p4 daemon or `git daemon`, we want to kill it at the
end of the test script.

So far, we do this "manually".

However, in the next few commits we want to teach the test suite to
optionally re-run scripts with different options, therefore we will have
to have a consistent way to stop daemons.

Let's introduce `test_atexit`, which is loosely modeled after
`test_when_finished` (but has a broader scope: rather than running the
commands after the current test case, run them when the test script
finishes, and also run them when the `--immediate` option is in effect).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:49 +01:00
Johannes Schindelin
b316d0b646 ci: speed up Windows phase
As Unix shell scripting comes at a hefty price on Windows, we have to
see where we can save some time to run the test suite.

Let's skip the chain linting and the bin-wrappers/ redirection on
Windows; this seems to shave of anywhere between 10-30% from the overall
runtime.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:49 +01:00
Johannes Schindelin
79e1525068 Add a build definition for Azure DevOps
This commit adds an azure-pipelines.yml file which is Azure DevOps'
equivalent to Travis CI's .travis.yml.

To make things a bit easier to understand, we refrain from using the
`matrix` feature here because (while it is powerful) it can be a bit
confusing to users who are not familiar with CI setups. Therefore, we
use a separate phase even for similar configurations (such as GCC vs
Clang on Linux, GCC vs Clang on macOS).

Also, we make use of the shiny new feature we just introduced where the
test suite can output JUnit-style .xml files. This information is made
available in a nice UI that allows the viewer to filter by phase and/or
test number, and to see trends such as: number of (failing) tests, time
spent running the test suite, etc.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:49 +01:00
Johannes Schindelin
56b34b29a5 ci/lib.sh: add support for Azure Pipelines
This patch introduces a conditional arm that defines some environment
variables and a function that displays the URL given the job id (to
identify previous runs for known-good trees).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:48 +01:00
Johannes Schindelin
c7d97e4438 tests: optionally write results as JUnit-style .xml
This will come in handy when publishing the results of Git's test suite
during an automated Azure DevOps run.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:48 +01:00
Johannes Schindelin
64757af28f test-date: add a subcommand to measure times in shell scripts
In the next commit, we want to teach Git's test suite to optionally
output test results in JUnit-style .xml files. These files contain
information about the time spent. So we need a way to measure time.

While we could use `date +%s` for that, this will give us only seconds,
i.e. very coarse-grained timings.

GNU `date` supports `date +%s.%N` (i.e. nanosecond-precision output),
but there is no equivalent in BSD `date` (read: on macOS, we would not
be able to obtain precise timings).

So let's introduce `test-tool date getnanos`, with an optional start
time, that outputs preciser values.

Granted, it is a bit pointless to try measuring times accurately in
shell scripts, certainly to nanosecond precision. But it is better than
second-granularity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:47 +01:00
Johannes Schindelin
d790b5e9bf ci: try to work around issues with the test cleanup
It seems that on some build agents, there might be some transient file
locking issues, so when we cannot delete the trash directory, let's be
gentle and try again five seconds later, and only error out if it still
fails the second time.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:47 +01:00
Johannes Schindelin
39ce1fdd3a ci: use a junction on Windows instead of a symlink
Symbolic links are still not quite as easy to use on Windows as on Linux
(for example, on versions older than Windows 10, only administrators can
create symlinks, and on Windows 10 you still need to be in developer
mode for regular users to have permission), but NTFS junctions can give
us a way out.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:47 +01:00
Johannes Schindelin
521e8d566e ci: inherit --jobs via MAKEFLAGS in run-build-and-tests
Let's not decide in the generic ci/ script how many jobs to run in
parallel; it is easy enough to hand that information down via the
`MAKEFLAGS`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:47 +01:00
Johannes Schindelin
0749882903 ci/lib.sh: encapsulate Travis-specific things
The upcoming patches will allow building git.git via Azure Pipelines
(i.e. Azure DevOps' Continuous Integration), where variable names and
URLs look a bit different than in Travis CI.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:47 +01:00
Johannes Schindelin
7bf19defbd ci: rename the library of common functions
The name is hard-coded to reflect that we use Travis CI for continuous
testing.

In the next commits, we will extend this to be able use Azure DevOps,
too.

So let's adjust the name to make it more generic.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:47 +01:00
Johannes Schindelin
17ff2d1502 tests: optionally skip bin-wrappers/
This speeds up the tests by a bit on Windows, where running Unix shell
scripts (and spawning processes) is not exactly a cheap operation.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:47 +01:00
Johannes Schindelin
9685a45a7e t0061: fix with --with-dashes and RUNTIME_PREFIX
When building Git with RUNTIME_PREFIX and starting a test helper from
t/helper/, it fails to detect the system prefix correctly.

This is the reason that the warning

	RUNTIME_PREFIX requested, but prefix computation failed. [...]

to be printed.

In t0061, we did not expect that to happen, and it actually did not
happen in the normal case, because bin-wrappers/test-tool specifically
sets GIT_TEXTDOMAINDIR (and as a consequence, nothing in test-tool wants
to know about the runtime prefix).

However, with --with-dashes, bin-wrappers/test-tool is no longer called,
but t/helper/test-tool is called directly.

So let's just ignore the RUNTIME_PREFIX warning.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:46 +01:00
Johannes Schindelin
b2e1384688 tests: add t/helper/ to the PATH with --with-dashes
We really need to be able to find the test helpers... Really. This
change was forgotten when we moved the test helpers into t/helper/

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:32:46 +01:00
Johannes Schindelin
4c87c4e2e3 Start the merging-rebase to v2.20.1
This commit starts the rebase of e2445268b4 to 7a95a1cd08
2018-12-15 08:32:43 +01:00
Johannes Schindelin
0668893f83 Merge branch 'azure-pipelines-fixups'
Technically, this topic branch would need a little bit more polishing.
However, it consists largely of fixup! commits which will be squashed
into the original `azure-pipelines` branch, anyway. And v2.20.1 is out
already, so the rebase is imminent. So...

There are two things to do, still, before submitting a new iteration of
that patch series:

- We need a better way to encode the text we paste into the XML.
  Probably we should extend the test-tool.

- We will also want to replace the perl invocation to retrieve the file
  size by a test-tool command.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-15 08:27:26 +01:00
Junio C Hamano
0d0ac3826a Git 2.20.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.20.1
2018-12-15 12:31:34 +09:00
Junio C Hamano
83243020c8 Merge branch 'jc/run-command-report-exec-failure-fix' into maint
A recent update accidentally squelched an error message when the
run_command API failed to run a missing command, which has been
corrected.

* jc/run-command-report-exec-failure-fix:
  run-command: report exec failure
2018-12-15 12:24:34 +09:00
Junio C Hamano
916f56d38b Merge branch 'js/help-commands-verbose-by-default-fix' into maint
"git help -a" did not work well when an overly long alias is
defined, which has been corrected.

* js/help-commands-verbose-by-default-fix:
  help -a: handle aliases with long names gracefully
  help.h: fix coding style
2018-12-15 12:24:33 +09:00
Junio C Hamano
bf29f074ed Merge branch 'nd/show-gitcomp-compilation-fix' into maint
Portability fix for a recent update to parse-options API.

* nd/show-gitcomp-compilation-fix:
  parse-options: fix SunCC compiler warning
2018-12-15 12:24:33 +09:00
Junio C Hamano
6be6e6629f Merge branch 'js/t9902-send-email-completion-fix' into maint
* js/t9902-send-email-completion-fix:
  t9902: 'send-email' test case requires PERL
2018-12-15 12:24:32 +09:00
Junio C Hamano
6cba471533 Merge branch 'js/mailinfo-format-flowed-fix' into maint
Test portability fix.

* js/mailinfo-format-flowed-fix:
  t4256: mark support files as LF-only
2018-12-15 12:24:32 +09:00
Junio C Hamano
3f8c27c369 Merge branch 'ds/hash-independent-tests-fix' into maint
Test portability fix.

* ds/hash-independent-tests-fix:
  .gitattributes: ensure t/oid-info/* has eol=lf
2018-12-15 12:24:32 +09:00
Derrick Stolee
fc767afe77 .gitattributes: ensure t/oid-info/* has eol=lf
The new test_oid machinery in the test library requires reading
some information from t/oid-info/hash-info and t/oid-info/oid.

The logic to read from these files in shell uses built-in "read"
command, which leaves CR at the end of these text files when they
are checked out with CRLF line endings, at least when run with bash
shipped with Git for Windows.  This results in an unexpected value
in the variable these lines are read into, leading the tests to
fail.

Mark them to be checked out always with the LF line endings.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-12-14 12:53:06 +09:00
Johannes Schindelin
0365b9ec59 t9902: 'send-email' test case requires PERL
The oneline notwithstanding, 13374987dd (completion: use _gitcompbuiltin
for format-patch, 2018-11-03) changed also the way send-email options
are completed, by asking the git send-email command itself what options
it offers.

Necessarily, this must fail when built with NO_PERL because send-email
itself is a Perl script. Which means that we need the PERL prerequisite
for the send-email test case in t9902.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-12-14 11:56:02 +09:00
Johannes Schindelin
33e4ee373f Merge pull request #1983 from dscho/builtin-rebase-perf-fix
Fix a performance regression in the built-in rebase
2018-12-13 20:22:51 +01:00
Johannes Schindelin
81269053d9 Merge pull request #1977 from derrickstolee/test-oid-fix-windows
.gitattributes: ensure t/oid-info/* has eol=lf
2018-12-13 20:13:18 +01:00
Johannes Schindelin
a1e5cf7138 ci: speed up Windows phase
As Unix shell scripting comes at a hefty price on Windows, we have to
see where we can save some time to run the test suite.

Let's skip the chain linting and the bin-wrappers/ redirection on
Windows; this seems to shave of anywhere between 10-30% from the overall
runtime.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:17:16 +01:00
Johannes Schindelin
fa5cacd9f8 fixup! tests: optionally write results as JUnit-style .xml
Actually, seems like \x1c is never valid in an XML... so let's use the
replacement character for such values.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:17:15 +01:00
Johannes Schindelin
79943a2008 fixup! tests: optionally write results as JUnit-style .xml
Let's use correct XML encoding for the likes of \x1c... ;-)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:17:15 +01:00
Johannes Schindelin
0349f73f7c fixup! tests: optionally write results as JUnit-style .xml
The t9902 test puts funny characters into its output, like \x1c. Let's
translate them into XML attributes, too.

At some stage, we will just want to add a function to the `test-tool` to
perform this for us, instead of that ugly shell script construct that is
incomplete to begin with.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:17:15 +01:00
Johannes Schindelin
0aca55dafd fixup! tests: include detailed trace logs with --write-junit-xml upon failure
It is actually better not to modify (or even truncate) the .out files
because the ci/ scripts want to provide a full output in the log.

So let's just remember the file offset at the beginning of each test
case, and use `cut <offset>-` to use that specifically.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:17:15 +01:00
Johannes Schindelin
2d28b0fd75 fixup! Add a build definition for Azure DevOps
As we use the common ci/ scripts to build and test on Windows, we now
have to make sure that there are no untracked, unignored files after the
build. That includes the SDK, and the test-cache directory.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:17:05 +01:00
Johannes Schindelin
e508bb8e05 fixup! Add a build definition for Azure DevOps
Let's start the display names in upper case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:59 +01:00
Johannes Schindelin
ce26793045 fixup! Add a build definition for Azure DevOps
Let's really use the common ci/ scripts to build and test on Windows,
meaning that we do not source `ci/lib.sh` ourselves.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:59 +01:00
Johannes Schindelin
b24f114473 fixup! Add a build definition for Azure DevOps
This is needed by the split.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:58 +01:00
Johannes Schindelin
acf700009b fixup! Add a build definition for Azure DevOps
It might be that mkpasswd cannot help speed up the tests on Windows, but
then, it won't hurt.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:58 +01:00
Johannes Schindelin
ecc47f8ea1 fixup! Add a build definition for Azure DevOps
Let's use the common ci/ scripts to build and test on Windows, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:58 +01:00
Johannes Schindelin
53941eedc6 fixup! Add a build definition for Azure DevOps
Let's not run things in quiet mode by default.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:58 +01:00