Commit Graph

93785 Commits

Author SHA1 Message Date
Johannes Schindelin
dd16ecdaf6 mingw (t5580): document bug when cloning from backslashed UNC paths
Due to a quirk in Git's method to spawn git-upload-pack, there is a
problem when passing paths with backslashes in them: Git will force the
command-line through the shell, which has different quoting semantics in
Git for Windows (being an MSYS2 program) than regular Win32 executables
such as git.exe itself.

The symptom is that the first of the two backslashes in UNC paths of the
form \\myserver\folder\repository.git is *stripped off*.

Document this bug by introducing a test case.

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
Johannes Schindelin
a303e3d0e9 fixup! Add a build definition for Azure DevOps
Use the `env` construct (possibly avoiding quoting issues).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:58 +01:00
Johannes Schindelin
38acbe0e33 fixup! Add a build definition for Azure DevOps
Ignore failures to mount the network share. It is purely to speed up
recurrent builds, and it is only in effect in non-forked builds, anyway,
so it is in a way optional.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:58 +01:00
Johannes Schindelin
bcf5b9518d fixup! Add a build definition for Azure DevOps
Remove invalid and unnecessary `condition` line.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:58 +01:00
Johannes Schindelin
521ae790a5 fixup! Add a build definition for Azure DevOps
Let's split the Windows phase into multiple, logical tasks so that we
can quickly determine whether the build failed, or the test suite, or
whether there was a problem with initializing the SDK.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:58 +01:00
Johannes Schindelin
ac0638c050 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-13 15:16:58 +01:00
Johannes Schindelin
68a0f4c622 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-13 15:16:58 +01:00
Johannes Schindelin
f78fe845be 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-13 15:16:58 +01:00
Johannes Schindelin
26404155c4 fixup! tests: introduce test_atexit
Turns out that there are problems with that approach that are totally
not related to Azure Pipelines, so in order to focus on the latter,
let's skip the test_atexit patches for now.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:57 +01:00
Johannes Schindelin
4aea72c59f fixup! git-daemon: use test_atexit in the tests
Turns out that there are problems with that approach that are totally
not related to Azure Pipelines, so in order to focus on the latter,
let's skip the test_atexit patches for now.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:57 +01:00
Johannes Schindelin
d24a561032 fixup! git-p4: use test_atexit to kill the daemon
Turns out that there are problems with that approach that are totally
not related to Azure Pipelines, so in order to focus on the latter,
let's skip the test_atexit patches for now.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:57 +01:00
Johannes Schindelin
6b3d21c32d t9902: 'send-email' test case requires PERL
With NO_PERL, the `git send-email` script errors out with code 128,
mentioning that Git was built without Perl support.

Therefore, when the completion tries to ask for possible completions via
`git send-email --git-completion-helper`, it won't provide what is
necessary for that test case to pass.

So let's mark it with the PERL prerequisite.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:57 +01:00
Johannes Schindelin
587be1411e t4256: mark support files as LF-only
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 15:16:57 +01:00
Derrick Stolee
82118f897b .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 shell logic that reads from these files is sensitive to CRLF
line endings, causing a problem when the test suite is run on a
Windows machine that converts LF to CRLF.

Exclude the files in this folder from this conversion.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
2018-12-13 15:16:57 +01:00
Johannes Schindelin
aa0c61fe42 t9902: 'send-email' test case requires PERL
With NO_PERL, the `git send-email` script errors out with code 128,
mentioning that Git was built without Perl support.

Therefore, when the completion tries to ask for possible completions via
`git send-email --git-completion-helper`, it won't provide what is
necessary for that test case to pass.

So let's mark it with the PERL prerequisite.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
2018-12-13 14:04:07 +00:00
Johannes Schindelin
dfd940bdf2 t4256: mark support files as LF-only
The test t4256-am-format-flowed.sh requires carefully applying a
patch after ignoring padding whitespace. This breaks if the file
is munged to include CRLF line endings instead of LF.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
2018-12-13 14:04:07 +00:00
Derrick Stolee
0e92d39f10 .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 shell logic that reads from these files is sensitive to CRLF
line endings, causing a failure when the test suite is run on a
Windows machine that converts LF to CRLF: the test suite fails
with a "bad hash algorithm" message, but does not record any
failed test cases. This caused CI builds to pass because they
fail only after reporting the failed test cases.

Exclude the files in this folder from this conversion.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
2018-12-13 14:02:52 +00:00
Johannes Schindelin
6c0d9e5685 fixup! builtin rebase: call git am directly
In the scripted version, we call `move_to_original_branch`, which
updates `HEAD` to point to the original branch again, after updating
that branch to point at the current commit. This does not require any
worktree update.

In the built-in version, we tried to reuse the `reset_head()` function,
which however does try to update the worktree. Of course, as there are
no changes, no actual worktree updates are performed. However, with an
insanely large repository, even just looking whether we need to write
anything takes a noticeable time. So let's avoid that in the built-in
version, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 13:06:58 +01:00
Johannes Schindelin
e61d6952c7 rebase: teach reset_head() to optionally skip the worktree
This is what the legacy (scripted) rebase does in
`move_to_original_branch`, and we will need this functionality in the
next commit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-13 13:05:14 +01:00
Johannes Schindelin
98f2d930d1 t4256: mark support files as LF-only
The test t4256-am-format-flowed.sh requires carefully applying a
patch after ignoring padding whitespace. This breaks if the file
is munged to include CRLF line endings instead of LF.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-12-13 11:39:45 +09:00
Nguyễn Thái Ngọc Duy
a92ec7efe0 parse-options: fix SunCC compiler warning
The compiler reports this because show_gitcomp() never actually
returns a value:

    "parse-options.c", line 520: warning: Function has no return
    statement : show_gitcomp

We could shut the compiler up. But instead let's not bury exit() too
deep. Do the same as internal -h handling, return a special error code
and handle the exit() in parse_options() (and other
parse_options_step() callers) instead.

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-12-12 17:21:33 +09:00
Johannes Schindelin
1c4b985965 help -a: handle aliases with long names gracefully
We take pains to determine the longest command beforehand, so that we
can align the category column after printing the command names.

However, then we re-use that value when printing the aliases. If any
alias name is longer than the longest command name, we consequently try
to add a negative number of spaces (but `mput_char()` does not expect
any negative values and simply decrements until the value is 0, i.e.
it tries to add close to 2**31 spaces).

Let's fix this by adjusting the `longest` variable before printing the
aliases.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-12-12 17:18:38 +09:00
Johannes Schindelin
5acea87c3a help.h: fix coding style
We want a space after the `while` keyword.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-12-12 17:18:29 +09:00
Junio C Hamano
e5a329a279 run-command: report exec failure
In 321fd823 ("run-command: mark path lookup errors with ENOENT",
2018-10-24), we rewrote the logic to execute a command by looking
in the directories on $PATH; as a side effect, a request to run a
command that is not found on $PATH is noticed even before a child
process is forked to execute it.

We however stopped to report an exec failure in such a case by
mistake.  Add a logic to report the error unless silent-exec-failure
is requested, to match the original code.

Reported-by: John Passaro <john.a.passaro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-12-12 17:06:50 +09:00
Johannes Schindelin
9515583416 fixup! stash: convert apply to builtin
Pointed out by our cocci job.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-12-09 11:44:52 +01:00