gitweb.git
travis-ci: check that all build artifacts are .gitignore-dSZEDER Gábor Sun, 31 Dec 2017 16:02:06 +0000 (17:02 +0100)

travis-ci: check that all build artifacts are .gitignore-d

Every once in a while our explicit .gitignore files get out of sync
when our build process learns to create new artifacts, like test
helper executables, but the .gitignore files are not updated
accordingly.

Use Travis CI to help catch such issues earlier: check that there are
no untracked files at the end of any build jobs building Git (i.e. the
64 bit Clang and GCC Linux and OSX build jobs, plus the GETTEXT_POISON
and 32 bit Linux build jobs) or its documentation, and fail the build
job if there are any present.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: don't store P4 and Git LFS in the working... SZEDER Gábor Sun, 31 Dec 2017 16:02:05 +0000 (17:02 +0100)

travis-ci: don't store P4 and Git LFS in the working tree

The Clang and GCC 64 bit Linux build jobs download and store the P4
and Git LFS executables under the current directory, which is the
working tree that we are about to build and test. This means that Git
commands like 'status' or 'ls-files' would list these files as
untracked. The next commit is about to make sure that there are no
untracked files present after the build, and the downloaded
executables in the working tree are interfering with those upcoming
checks.

Therefore, let's download P4 and Git LFS in the home directory,
outside of the working tree.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: record and skip successfully built treesSZEDER Gábor Sun, 31 Dec 2017 10:12:05 +0000 (11:12 +0100)

travis-ci: record and skip successfully built trees

Travis CI dutifully builds and tests each new branch tip, even if its
tree has previously been successfully built and tested. This happens
often enough in contributors' workflows, when a work-in-progress
branch is rebased changing e.g. only commit messages or the order or
number of commits while leaving the resulting code intact, and is then
pushed to a Travis CI-enabled GitHub fork.

This is wasting Travis CI's resources and is sometimes scary-annoying
when the new tip commit with a tree identical to the previous,
successfully tested one is suddenly reported in red, because one of
the OSX build jobs happened to exceed the time limit yet again.

So extend our Travis CI build scripts to skip building commits whose
trees have previously been successfully built and tested. Use the
Travis CI cache feature to keep a record of the object names of trees
that tested successfully, in a plain and simple flat text file, one
line per tree object name. Append the current tree's object name at
the end of every successful build job to this file, along with a bit
of additional info about the build job (commit object name, Travis CI
job number and id). Limit the size of this file to 1000 records, to
prevent it from growing too large for git/git's forever living
integration branches. Check, using a simple grep invocation, in each
build job whether the current commit's tree is already in there, and
skip the build if it is. Include a message in the skipped build job's
trace log, containing the URL to the build job successfully testing
that tree for the first time and instructions on how to force a
re-build. Catch the case when a build job, which successfully built
and tested a particular tree for the first time, is restarted and omit
the URL of the previous build job's trace log, as in this case it's
the same build job and the trace log has just been overwritten.

Note: this won't kick in if two identical trees are on two different
branches, because Travis CI caches are not shared between build jobs
of different branches.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Reviewed-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: create the cache directory early in the... SZEDER Gábor Sun, 31 Dec 2017 10:12:04 +0000 (11:12 +0100)

travis-ci: create the cache directory early in the build process

It seems that Travis CI creates the cache directory for us anyway,
even when a previous cache doesn't exist for the current build job.
Alas, this behavior is not explicitly documented, therefore we don't
rely on it and create the cache directory ourselves in those build
jobs that read/write cached data (currently only the prove state).

In the following commit we'll start to cache additional data in every
build job, and will access the cache much earlier in the build
process.

Therefore move creating the cache directory to 'ci/lib-travisci.sh' to
make sure that it exists at the very beginning of every build job.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Reviewed-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: print the "tip of branch is exactly at tag... SZEDER Gábor Sun, 31 Dec 2017 10:12:03 +0000 (11:12 +0100)

travis-ci: print the "tip of branch is exactly at tag" message in color

To make this info message stand out from the regular build job trace
output.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Reviewed-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: only print test failures if there are test... SZEDER Gábor Wed, 27 Dec 2017 16:36:03 +0000 (17:36 +0100)

travis-ci: only print test failures if there are test results available

When a build job running the test suite fails, our
'ci/print-test-failures.sh' script scans all 't/test-results/*.exit'
files to find failed tests and prints their verbose output. However,
if a build job were to fail before it ever gets to run the test suite,
then there will be no files to match the above pattern and the shell
will take the pattern literally, resulting in errors like this in the
trace log:

cat: t/test-results/*.exit: No such file or directory
------------------------------------------------------------------------
t/test-results/*.out...
------------------------------------------------------------------------
cat: t/test-results/*.out: No such file or directory

Check upfront and proceed only if there are any such files present.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Reviewed-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: save prove state for the 32 bit Linux buildSZEDER Gábor Wed, 27 Dec 2017 16:36:02 +0000 (17:36 +0100)

travis-ci: save prove state for the 32 bit Linux build

This change follows suit of 6272ed319 (travis-ci: run previously
failed tests first, then slowest to fastest, 2016-01-26), which did
this for the Linux and OSX build jobs. Travis CI build jobs run the
tests parallel, which is sligtly faster when tests are run in slowest
to fastest order, shortening the overall runtime of this build job by
about a minute / 10%.

Note, that the 32 bit Linux build job runs the tests suite in a Docker
container and we have to share the Travis CI cache directory with the
container as a second volume. Otherwise we couldn't use a symlink
pointing to the prove state file in the cache directory, because
that's outside of the directory hierarchy accessible from within the
container.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Reviewed-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: don't install default addon packages for... SZEDER Gábor Wed, 27 Dec 2017 16:36:01 +0000 (17:36 +0100)

travis-ci: don't install default addon packages for the 32 bit Linux build

The 32 bit Linux build job compiles Git and runs the test suite in a
Docker container, while the additional packages (apache2, git-svn,
language-pack-is) are installed on the host, therefore don't have
any effect and are unnecessary.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Acked-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: fine tune the use of 'set -x' in 'ci/*'... SZEDER Gábor Wed, 27 Dec 2017 16:36:00 +0000 (17:36 +0100)

travis-ci: fine tune the use of 'set -x' in 'ci/*' scripts

The change in commit 4f2636667 (travis-ci: use 'set -x' in 'ci/*'
scripts for extra tracing output, 2017-12-12) left a couple of rough
edges:

- 'ci/run-linux32-build.sh' is executed in a Docker container and
therefore doesn't source 'ci/lib-travisci.sh', which would enable
tracing executed commands. Enable 'set -x' in this script, too.

- 'ci/print-test-failures.sh' iterates over all the files containing
the exit codes of all the executed test scripts. Since there are
over 800 such files, the loop produces way too much noise with
tracing executed commands enabled, so disable 'set -x' for this
script.

- 'ci/run-windows-build.sh' busily waits in a loop for the result of
the Windows build, producing too much noise with tracing executed
commands enabled as well. Disable 'set -x' for the duration of
that loop.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: use 'set -x' in 'ci/*' scripts for extra... SZEDER Gábor Mon, 11 Dec 2017 23:34:43 +0000 (00:34 +0100)

travis-ci: use 'set -x' in 'ci/*' scripts for extra tracing output

While the build logic was embedded in our '.travis.yml', Travis CI
used to produce a nice trace log including all commands executed in
those embedded scriptlets. Since 657343a60 (travis-ci: move Travis CI
code into dedicated scripts, 2017-09-10), however, we only see the
name of the dedicated scripts, but not what those scripts are actually
doing, resulting in a less useful trace log. A patch later in this
series will move setting environment variables from '.travis.yml' to
the 'ci/*' scripts, so not even those will be included in the trace
log.

Use 'set -x' in 'ci/lib-travisci.sh', which is sourced in most other
'ci/*' scripts, so we get trace log about the commands executed in all
of those scripts.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: set GIT_TEST_HTTPD in 'ci/lib-travisci.sh'SZEDER Gábor Mon, 11 Dec 2017 23:34:46 +0000 (00:34 +0100)

travis-ci: set GIT_TEST_HTTPD in 'ci/lib-travisci.sh'

Commit 657343a60 (travis-ci: move Travis CI code into dedicated
scripts, 2017-09-10) converted '.travis.yml's default 'before_install'
scriptlet to the 'ci/install-dependencies.sh' script, and while doing
so moved setting GIT_TEST_HTTPD=YesPlease for the 64-bit GCC and Clang
Linux build jobs to that script. This is wrong for two reasons:

- The purpose of that script is, as its name suggests, to install
dependencies, not to set any environment variables influencing
which tests should be run (though, arguably, this was already an
issue with the original 'before_install' scriptlet).

- Setting the variable has no effect anymore, because that script is
run in a separate shell process, and the variable won't be visible
in any of the other scripts, notably in 'ci/run-tests.sh'
responsible for, well, running the tests.

Luckily, this didn't have a negative effect on our Travis CI build
jobs, because GIT_TEST_HTTPD is a tri-state variable defaulting to
"auto" and a functioning web server was installed in those Linux build
jobs, so the httpd tests were run anyway.

Apparently the httpd tests run just fine without GIT_TEST_HTTPD being
set, therefore we could simply remove this environment variable.
However, if a bug were to creep in to change the Travis CI build
environment to run the tests as root or to not install Apache, then
the httpd tests would be skipped and the build job would still
succeed. We would only notice if someone actually were to look
through the build job's trace log; but who would look at the trace log
of a successful build job?!

Since httpd tests are important, we do want to run them and we want to
be loudly reminded if they can't be run. Therefore, move setting
GIT_TEST_HTTPD=YesPlease for the 64-bit GCC and Clang Linux build jobs
to 'ci/lib-travisci.sh' to ensure that the build job fails when the
httpd tests can't be run. (We could set it in 'ci/run-tests.sh' just
as well, but it's better to keep all environment variables in one
place in 'ci/lib-travisci.sh'.)

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: move setting environment variables to 'ci... SZEDER Gábor Mon, 11 Dec 2017 23:34:45 +0000 (00:34 +0100)

travis-ci: move setting environment variables to 'ci/lib-travisci.sh'

Our '.travis.yml's 'env.global' section sets a bunch of environment
variables for all build jobs, though none of them actually affects all
build jobs. It's convenient for us, and in most cases it works just
fine, because irrelevant environment variables are simply ignored.

However, $GIT_SKIP_TESTS is an exception: it tells the test harness to
skip the two test scripts that are prone to occasional failures on
OSX, but as it's set for all build jobs those tests are not run in any
of the build jobs that are capable to run them reliably, either.

Therefore $GIT_SKIP_TESTS should only be set in the OSX build jobs,
but those build jobs are included in the build matrix implicitly (i.e.
by combining the matrix keys 'os' and 'compiler'), and there is no way
to set an environment variable only for a subset of those implicit
build jobs. (Unless we were to add new scriptlets to '.travis.yml',
which is exactly the opposite direction that we took with commit
657343a60 (travis-ci: move Travis CI code into dedicated scripts,
2017-09-10)).

So move setting $GIT_SKIP_TESTS to 'ci/lib-travisci.sh', where it can
trivially be set only for the OSX build jobs.

Furthermore, move setting all other environment variables from
'.travis.yml' to 'ci/lib-travisci.sh', too, because a couple of
environment variables are already set there, and this way all
environment variables will be set in the same place. All the logic
controlling our builds is already in the 'ci/*' scripts anyway, so
there is really no good reason to keep the environment variables
separately.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: introduce a $jobname variable for 'ci/*... SZEDER Gábor Mon, 11 Dec 2017 23:34:44 +0000 (00:34 +0100)

travis-ci: introduce a $jobname variable for 'ci/*' scripts

A couple of 'ci/*' scripts are shared between different build jobs:
'ci/lib-travisci.sh', being a common library, is sourced from almost
every script, while 'ci/install-dependencies.sh', 'ci/run-build.sh'
and 'ci/run-tests.sh' are shared between the "regular" GCC and Clang
Linux and OSX build jobs, and the latter two scripts are used in the
GETTEXT_POISON Linux build job as well.

Our builds could benefit from these shared scripts being able to
easily tell which build job they are taking part in. Now, it's
already quite easy to tell apart Linux vs OSX and GCC vs Clang build
jobs, but it gets trickier with all the additional Linux-based build
jobs included explicitly in the build matrix.

Unfortunately, Travis CI doesn't provide much help in this regard.
The closest we've got is the $TRAVIS_JOB_NUMBER variable, the value of
which is two dot-separated integers, where the second integer
indicates a particular build job. While it would be possible to use
that second number to identify the build job in our shared scripts, it
doesn't seem like a good idea to rely on that:

- Though the build job numbering sequence seems to be stable so far,
Travis CI's documentation doesn't explicitly states that it is
indeed stable and will remain so in the future. And even if it
were stable,

- if we were to remove or insert a build job in the middle, then the
job numbers of all subsequent build jobs would change accordingly.

So roll our own means of simple build job identification and introduce
the $jobname environment variable in our builds, setting it in the
environments of the explicitly included jobs in '.travis.yml', while
constructing one in 'ci/lib-travisci.sh' as the combination of the OS
and compiler name for the GCC and Clang Linux and OSX build jobs. Use
$jobname instead of $TRAVIS_OS_NAME in scripts taking different
actions based on the OS and build job (when installing P4 and Git LFS
dependencies and including them in $PATH). The following two patches
will also rely on $jobname.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: don't build Git for the static analysis jobSZEDER Gábor Wed, 1 Nov 2017 11:56:44 +0000 (12:56 +0100)

travis-ci: don't build Git for the static analysis job

The static analysis job on Travis CI builds Git ever since it was
introduced in d8245bb3f (travis-ci: add static analysis build job to
run coccicheck, 2017-04-11). However, Coccinelle, the only static
analysis tool in use, only needs Git's source code to work and it
doesn't care about built Git binaries at all.

Spare some of Travis CI's resources and don't build Git for the static
analysis job unnecessarily.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: fix running P4 and Git LFS tests in Linux... SZEDER Gábor Wed, 1 Nov 2017 11:55:35 +0000 (12:55 +0100)

travis-ci: fix running P4 and Git LFS tests in Linux build jobs

Linux build jobs on Travis CI skip the P4 and Git LFS tests since
commit 657343a60 (travis-ci: move Travis CI code into dedicated
scripts, 2017-09-10), claiming there are no P4 or Git LFS installed.

The reason is that P4 and Git LFS binaries are not installed to a
directory in the default $PATH, but their directories are prepended to
$PATH. This worked just fine before said commit, because $PATH was
set in a scriptlet embedded in our '.travis.yml', thus its new value
was visible during the rest of the build job. However, after these
embedded scriptlets were moved into dedicated scripts executed in
separate shell processes, any variable set in one of those scripts is
only visible in that single script but not in any of the others. In
this case, 'ci/install-dependencies.sh' downloads P4 and Git LFS and
modifies $PATH, but to no effect, because 'ci/run-tests.sh' only sees
Travis CI's default $PATH.

Move adjusting $PATH to 'ci/lib-travisci.sh', which is sourced in all
other 'ci/' scripts, so all those scripts will see the updated $PATH
value.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: fix "skip_branch_tip_with_tag()" string... Lars Schneider Thu, 21 Sep 2017 20:48:30 +0000 (22:48 +0200)

travis-ci: fix "skip_branch_tip_with_tag()" string comparison

09f5e97 ("travis-ci: skip a branch build if equal tag is present",
2017-09-17) introduced the "skip_branch_tip_with_tag" function with
a broken string comparison. Fix it!

Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis: dedent a few scripts that are indented overly... Junio C Hamano Mon, 11 Sep 2017 01:18:29 +0000 (10:18 +0900)

travis: dedent a few scripts that are indented overly deeply

Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: skip a branch build if equal tag is presentLars Schneider Sun, 10 Sep 2017 14:44:29 +0000 (16:44 +0200)

travis-ci: skip a branch build if equal tag is present

If we push a branch and a tag pointing to the HEAD of this branch,
then Travis CI would run the build twice. This wastes resources and
slows the testing.

Add a function to detect this situation and skip the build the branch
if appropriate. Invoke this function on every build.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: move Travis CI code into dedicated scriptsLars Schneider Sun, 10 Sep 2017 14:44:28 +0000 (16:44 +0200)

travis-ci: move Travis CI code into dedicated scripts

Most of the Travis CI commands are in the '.travis.yml'. The yml format
does not support functions and therefore code duplication is necessary
to run commands across all builds.

To fix this, add a library for common CI functions. Move all Travis CI
code into dedicated scripts and make them call the library first.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Prepare for 2.14.2Junio C Hamano Wed, 23 Aug 2017 21:36:03 +0000 (14:36 -0700)

Prepare for 2.14.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jt/t1450-fsck-corrupt-packfile' into... Junio C Hamano Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)

Merge branch 'jt/t1450-fsck-corrupt-packfile' into maint

A test update.

* jt/t1450-fsck-corrupt-packfile:
tests: ensure fsck fails on corrupt packfiles

Merge branch 'jb/t8008-cleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)

Merge branch 'jb/t8008-cleanup' into maint

Code clean-up.

* jb/t8008-cleanup:
t8008: rely on rev-parse'd HEAD instead of sha1 value

Merge branch 'jt/subprocess-handshake' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)

Merge branch 'jt/subprocess-handshake' into maint

Code cleanup.

* jt/subprocess-handshake:
sub-process: refactor handshake to common function
Documentation: migrate sub-process docs to header
convert: add "status=delayed" to filter process protocol
convert: refactor capabilities negotiation
convert: move multiple file filter error handling to separate function
convert: put the flags field before the flag itself for consistent style
t0021: write "OUT <size>" only on success
t0021: make debug log file name configurable
t0021: keep filter log files on comparison

Merge branch 'dc/fmt-merge-msg-microcleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)

Merge branch 'dc/fmt-merge-msg-microcleanup' into maint

Code cleanup.

* dc/fmt-merge-msg-microcleanup:
fmt-merge-msg: fix coding style

Merge branch 'ah/doc-wserrorhighlight' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:51 +0000 (14:33 -0700)

Merge branch 'ah/doc-wserrorhighlight' into maint

Doc update.

* ah/doc-wserrorhighlight:
doc: add missing values "none" and "default" for diff.wsErrorHighlight

Merge branch 'cc/ref-is-hidden-microcleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:50 +0000 (14:33 -0700)

Merge branch 'cc/ref-is-hidden-microcleanup' into maint

Code cleanup.

* cc/ref-is-hidden-microcleanup:
refs: use skip_prefix() in ref_is_hidden()

Merge branch 'js/run-process-parallel-api-fix' into... Junio C Hamano Wed, 23 Aug 2017 21:33:49 +0000 (14:33 -0700)

Merge branch 'js/run-process-parallel-api-fix' into maint

API fix.

* js/run-process-parallel-api-fix:
run_processes_parallel: change confusing task_cb convention

Merge branch 'rs/pack-objects-pbase-cleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:48 +0000 (14:33 -0700)

Merge branch 'rs/pack-objects-pbase-cleanup' into maint

Code clean-up.

* rs/pack-objects-pbase-cleanup:
pack-objects: remove unnecessary NULL check

Merge branch 'jt/fsck-code-cleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:48 +0000 (14:33 -0700)

Merge branch 'jt/fsck-code-cleanup' into maint

Code clean-up.

* jt/fsck-code-cleanup:
fsck: cleanup unused variable
object: remove "used" field from struct object
fsck: remove redundant parse_tree() invocation

Merge branch 'rs/stat-data-unaligned-reads-fix' into... Junio C Hamano Wed, 23 Aug 2017 21:33:47 +0000 (14:33 -0700)

Merge branch 'rs/stat-data-unaligned-reads-fix' into maint

Code clean-up.

* rs/stat-data-unaligned-reads-fix:
dir: support platforms that require aligned reads

Merge branch 'rs/move-array' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:46 +0000 (14:33 -0700)

Merge branch 'rs/move-array' into maint

Code clean-up.

* rs/move-array:
ls-files: don't try to prune an empty index
apply: use COPY_ARRAY and MOVE_ARRAY in update_image()
use MOVE_ARRAY
add MOVE_ARRAY

Merge branch 'rs/bswap-ubsan-fix' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:46 +0000 (14:33 -0700)

Merge branch 'rs/bswap-ubsan-fix' into maint

Code clean-up.

* rs/bswap-ubsan-fix:
bswap: convert get_be16, get_be32 and put_be32 to inline functions
bswap: convert to unsigned before shifting in get_be32

Merge branch 'dl/credential-cache-socket-in-xdg-cache... Junio C Hamano Wed, 23 Aug 2017 21:33:45 +0000 (14:33 -0700)

Merge branch 'dl/credential-cache-socket-in-xdg-cache' into maint

A recently added test for the "credential-cache" helper revealed
that EOF detection done around the time the connection to the cache
daemon is torn down were flaky. This was fixed by reacting to
ECONNRESET and behaving as if we got an EOF.

* dl/credential-cache-socket-in-xdg-cache:
credential-cache: interpret an ECONNRESET as an EOF

Merge branch 'hb/gitweb-project-list' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:44 +0000 (14:33 -0700)

Merge branch 'hb/gitweb-project-list' into maint

When a directory is not readable, "gitweb" fails to build the
project list. Work this around by skipping such a directory.

It might end up hiding a problem under the rug and a better
solution might be to loudly complain to the administrator pointing
out the problematic directory, but this will at least make it
"work".

* hb/gitweb-project-list:
gitweb: skip unreadable subdirectories

Merge branch 'ks/commit-abort-on-empty-message-fix... Junio C Hamano Wed, 23 Aug 2017 21:33:44 +0000 (14:33 -0700)

Merge branch 'ks/commit-abort-on-empty-message-fix' into maint

"git commit" when seeing an totally empty message said "you did not
edit the message", which is clearly wrong. The message has been
corrected.

* ks/commit-abort-on-empty-message-fix:
commit: check for empty message before the check for untouched template

Merge branch 'jk/reflog-walk' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:43 +0000 (14:33 -0700)

Merge branch 'jk/reflog-walk' into maint

Numerous bugs in walking of reflogs via "log -g" and friends have
been fixed.

* jk/reflog-walk:
reflog-walk: apply --since/--until to reflog dates
reflog-walk: stop using fake parents
rev-list: check reflog_info before showing usage
get_revision_1(): replace do-while with an early return
log: do not free parents when walking reflog
log: clarify comment about reflog cycles
revision: disallow reflog walking with revs->limited
t1414: document some reflog-walk oddities

Merge branch 'jc/http-sslkey-and-ssl-cert-are-paths... Junio C Hamano Wed, 23 Aug 2017 21:33:43 +0000 (14:33 -0700)

Merge branch 'jc/http-sslkey-and-ssl-cert-are-paths' into maint

The http.{sslkey,sslCert} configuration variables are to be
interpreted as a pathname that honors "~[username]/" prefix, but
weren't, which has been fixed.

* jc/http-sslkey-and-ssl-cert-are-paths:
http.c: http.sslcert and http.sslkey are both pathnames

Merge branch 'jk/ref-filter-colors' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:42 +0000 (14:33 -0700)

Merge branch 'jk/ref-filter-colors' into maint

"%C(color name)" in the pretty print format always produced ANSI
color escape codes, which was an early design mistake. They now
honor the configuration (e.g. "color.ui = never") and also tty-ness
of the output medium.

* jk/ref-filter-colors:
ref-filter: consult want_color() before emitting colors
pretty: respect color settings for %C placeholders
rev-list: pass diffopt->use_colors through to pretty-print
for-each-ref: load config earlier
color: check color.ui in git_default_config()
ref-filter: pass ref_format struct to atom parsers
ref-filter: factor out the parsing of sorting atoms
ref-filter: make parse_ref_filter_atom a private function
ref-filter: provide a function for parsing sort options
ref-filter: move need_color_reset_at_eol into ref_format
ref-filter: abstract ref format into its own struct
ref-filter: simplify automatic color reset
t: use test_decode_color rather than literal ANSI codes
docs/for-each-ref: update pointer to color syntax
check return value of verify_ref_format()

Merge branch 'js/git-gui-msgfmt-on-windows' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:42 +0000 (14:33 -0700)

Merge branch 'js/git-gui-msgfmt-on-windows' into maint

Because recent Git for Windows do come with a real msgfmt, the
build procedure for git-gui has been updated to use it instead of a
hand-rolled substitute.

* js/git-gui-msgfmt-on-windows:
git-gui (MinGW): make use of MSys2's msgfmt
git gui: allow for a long recentrepo list
git gui: de-dup selected repo from recentrepo history
git gui: cope with duplicates in _get_recentrepo
git-gui: remove duplicate entries from .gitconfig's gui.recentrepo

Git 2.14.1 v2.14.1Junio C Hamano Fri, 4 Aug 2017 19:41:48 +0000 (12:41 -0700)

Git 2.14.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge tag 'v2.13.5' into maintJunio C Hamano Fri, 4 Aug 2017 19:40:37 +0000 (12:40 -0700)

Merge tag 'v2.13.5' into maint

Git 2.14 v2.14.0Junio C Hamano Fri, 4 Aug 2017 16:31:12 +0000 (09:31 -0700)

Git 2.14

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ah/patch-id-doc'Junio C Hamano Fri, 4 Aug 2017 16:29:15 +0000 (09:29 -0700)

Merge branch 'ah/patch-id-doc'

Docfix.

* ah/patch-id-doc:
doc: remove unsupported parameter from patch-id

Merge branch 'as/diff-options-grammofix'Junio C Hamano Fri, 4 Aug 2017 16:29:14 +0000 (09:29 -0700)

Merge branch 'as/diff-options-grammofix'

A grammofix.

* as/diff-options-grammofix:
diff-options doc: grammar fix

Merge tag 'l10n-2.14.0-rnd2' of git://github.com/git... Junio C Hamano Wed, 2 Aug 2017 17:52:33 +0000 (10:52 -0700)

Merge tag 'l10n-2.14.0-rnd2' of git://github.com/git-l10n/git-po

l10n for Git 2.14.0 round 2

* tag 'l10n-2.14.0-rnd2' of git://github.com/git-l10n/git-po:
l10n: zh_CN: review for git v2.14.0 l10n
l10n: ko.po: Update Korean translation
l10n: zh_CN: for git v2.14.0 l10n round 2
l10n: de.po: various fixes in German translation
l10n: ru.po: update Russian translation
l10n: fr.po v2.14.0 rnd 2
l10n: fr.po Fix some french typos
l10n: fr.po Fix typo
l10n: fr.po Fix some translations
l10n: de.po: update German translation
l10n: vi.po (3213t): Updated 9 new strings
l10n: Update Catalan translation
l10n: bg.po: Updated Bulgarian translation (3213t)

l10n: zh_CN: review for git v2.14.0 l10nJiang Xin Wed, 2 Aug 2017 00:02:37 +0000 (08:02 +0800)

l10n: zh_CN: review for git v2.14.0 l10n

Reviewed-by: 依云 <lilydjwg@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

Git 2.13.5 v2.13.5Junio C Hamano Tue, 1 Aug 2017 19:30:00 +0000 (12:30 -0700)

Git 2.13.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge tag 'v2.12.4' into maintJunio C Hamano Tue, 1 Aug 2017 19:27:31 +0000 (12:27 -0700)

Merge tag 'v2.12.4' into maint

Sync with v2.13.4Junio C Hamano Tue, 1 Aug 2017 18:46:51 +0000 (11:46 -0700)

Sync with v2.13.4

Git 2.13.4 v2.13.4Junio C Hamano Tue, 1 Aug 2017 18:45:17 +0000 (11:45 -0700)

Git 2.13.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: ko.po: Update Korean translationChangwoo Ryu Tue, 1 Aug 2017 03:32:00 +0000 (12:32 +0900)

l10n: ko.po: Update Korean translation

Signed-off-by: Changwoo Ryu <cwryu@debian.org>

l10n: zh_CN: for git v2.14.0 l10n round 2Jiang Xin Sun, 11 Jun 2017 03:28:31 +0000 (11:28 +0800)

l10n: zh_CN: for git v2.14.0 l10n round 2

Translate new l10n messages for git 2.14.0, and update translations on
"stash".

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

Sync with maintJunio C Hamano Mon, 31 Jul 2017 20:52:53 +0000 (13:52 -0700)

Sync with maint

* maint:
Preparation for 2.13.4 continues

Preparation for 2.13.4 continuesJunio C Hamano Mon, 31 Jul 2017 20:52:40 +0000 (13:52 -0700)

Preparation for 2.13.4 continues

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ks/doc-fixes' into maintJunio C Hamano Mon, 31 Jul 2017 20:51:06 +0000 (13:51 -0700)

Merge branch 'ks/doc-fixes' into maint

Doc clean-up.

* ks/doc-fixes:
doc: reformat the paragraph containing the 'cut-line'
doc: camelCase the i18n config variables to improve readability

Merge branch 'jk/test-copy-bytes-fix' into maintJunio C Hamano Mon, 31 Jul 2017 20:51:05 +0000 (13:51 -0700)

Merge branch 'jk/test-copy-bytes-fix' into maint

A test fix.

* jk/test-copy-bytes-fix:
t: handle EOF in test_copy_bytes()

Merge branch 'pw/unquote-path-in-git-pm' into maintJunio C Hamano Mon, 31 Jul 2017 20:51:05 +0000 (13:51 -0700)

Merge branch 'pw/unquote-path-in-git-pm' into maint

Code refactoring.

* pw/unquote-path-in-git-pm:
t9700: add tests for Git::unquote_path()
Git::unquote_path(): throw an exception on bad path
Git::unquote_path(): handle '\a'
add -i: move unquote_path() to Git.pm

Merge branch 'jk/gc-pre-detach-under-hook' into maintJunio C Hamano Mon, 31 Jul 2017 20:51:05 +0000 (13:51 -0700)

Merge branch 'jk/gc-pre-detach-under-hook' into maint

We run an early part of "git gc" that deals with refs before
daemonising (and not under lock) even when running a background
auto-gc, which caused multiple gc processes attempting to run the
early part at the same time. This is now prevented by running the
early part also under the GC lock.

* jk/gc-pre-detach-under-hook:
gc: run pre-detach operations under lock

Merge branch 'jn/hooks-pre-rebase-sample-fix' into... Junio C Hamano Mon, 31 Jul 2017 20:51:05 +0000 (13:51 -0700)

Merge branch 'jn/hooks-pre-rebase-sample-fix' into maint

Code clean-up, that makes us in sync with Debian by one patch.

* jn/hooks-pre-rebase-sample-fix:
pre-rebase hook: capture documentation in a <<here document

Merge branch 'rs/progress-overall-throughput-at-the... Junio C Hamano Mon, 31 Jul 2017 20:51:04 +0000 (13:51 -0700)

Merge branch 'rs/progress-overall-throughput-at-the-end' into maint

The progress meter did not give a useful output when we haven't had
0.5 seconds to measure the throughput during the interval. Instead
show the overall throughput rate at the end, which is a much more
useful number.

* rs/progress-overall-throughput-at-the-end:
progress: show overall rate in last update

Merge branch 'tb/push-to-cygwin-unc-path' into maintJunio C Hamano Mon, 31 Jul 2017 20:51:04 +0000 (13:51 -0700)

Merge branch 'tb/push-to-cygwin-unc-path' into maint

On Cygwin, similar to Windows, "git push //server/share/repository"
ought to mean a repository on a network share that can be accessed
locally, but this did not work correctly due to stripping the double
slashes at the beginning.

This may need to be heavily tested before it gets unleashed to the
wild, as the change is at a fairly low-level code and would affect
not just the code to decide if the push destination is local. There
may be unexpected fallouts in the path normalization.

* tb/push-to-cygwin-unc-path:
cygwin: allow pushing to UNC paths

Merge branch 'rs/apply-avoid-over-reading' into maintJunio C Hamano Mon, 31 Jul 2017 20:51:04 +0000 (13:51 -0700)

Merge branch 'rs/apply-avoid-over-reading' into maint

Code cleanup.

* rs/apply-avoid-over-reading:
apply: use strcmp(3) for comparing strings in gitdiff_verify_name()
apply: use starts_with() in gitdiff_verify_name()

Merge branch 'js/blame-lib'Junio C Hamano Mon, 31 Jul 2017 20:05:15 +0000 (13:05 -0700)

Merge branch 'js/blame-lib'

A hotfix to a topic already in 'master'.

* js/blame-lib:
blame: fix memory corruption scrambling revision name in error message

diff-options doc: grammar fixAnthony Sottile Mon, 31 Jul 2017 14:00:31 +0000 (07:00 -0700)

diff-options doc: grammar fix

Signed-off-by: Anthony Sottile <asottile@umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.12.4 v2.12.4Junio C Hamano Sun, 30 Jul 2017 22:06:06 +0000 (15:06 -0700)

Git 2.12.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge tag 'v2.11.3' into maint-2.12Junio C Hamano Sun, 30 Jul 2017 22:04:22 +0000 (15:04 -0700)

Merge tag 'v2.11.3' into maint-2.12

Git 2.11.3

Merge branch 'jk/lib-proto-disable-cleanup' into maint... Junio C Hamano Sun, 30 Jul 2017 22:03:21 +0000 (15:03 -0700)

Merge branch 'jk/lib-proto-disable-cleanup' into maint-2.12

Git 2.11.3 v2.11.3Junio C Hamano Sun, 30 Jul 2017 22:02:37 +0000 (15:02 -0700)

Git 2.11.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge tag 'v2.10.4' into maint-2.11Junio C Hamano Sun, 30 Jul 2017 22:01:31 +0000 (15:01 -0700)

Merge tag 'v2.10.4' into maint-2.11

Git 2.10.4

Git 2.10.4 v2.10.4Junio C Hamano Sun, 30 Jul 2017 22:00:04 +0000 (15:00 -0700)

Git 2.10.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge tag 'v2.9.5' into maint-2.10Junio C Hamano Sun, 30 Jul 2017 21:57:33 +0000 (14:57 -0700)

Merge tag 'v2.9.5' into maint-2.10

Git 2.9.5

Git 2.9.5 v2.9.5Junio C Hamano Sun, 30 Jul 2017 21:53:25 +0000 (14:53 -0700)

Git 2.9.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge tag 'v2.8.6' into maint-2.9Junio C Hamano Sun, 30 Jul 2017 21:52:14 +0000 (14:52 -0700)

Merge tag 'v2.8.6' into maint-2.9

Git 2.8.6

Git 2.8.6 v2.8.6Junio C Hamano Sun, 30 Jul 2017 21:49:08 +0000 (14:49 -0700)

Git 2.8.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge tag 'v2.7.6' into maint-2.8Junio C Hamano Sun, 30 Jul 2017 21:46:43 +0000 (14:46 -0700)

Merge tag 'v2.7.6' into maint-2.8

Git 2.7.6

Git 2.7.6 v2.7.6Junio C Hamano Sun, 30 Jul 2017 21:45:13 +0000 (14:45 -0700)

Git 2.7.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: de.po: various fixes in German translationHartmut Henkel Thu, 27 Jul 2017 17:24:09 +0000 (19:24 +0200)

l10n: de.po: various fixes in German translation

Signed-off-by: Hartmut Henkel <henkel@vh-s.de>
Helped-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Matthias Rüster <matthias.ruester@gmail.com>

Merge branch 'russian-l10n' of https://github.com/DJm00... Jiang Xin Sun, 30 Jul 2017 14:47:47 +0000 (22:47 +0800)

Merge branch 'russian-l10n' of https://github.com/DJm00n/git-po-ru

* 'russian-l10n' of https://github.com/DJm00n/git-po-ru:
l10n: ru.po: update Russian translation

l10n: ru.po: update Russian translationDimitriy Ryazantcev Sun, 30 Jul 2017 09:35:40 +0000 (12:35 +0300)

l10n: ru.po: update Russian translation

Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>

Merge branch 'jk/ssh-funny-url' into maint-2.7Junio C Hamano Fri, 28 Jul 2017 23:11:54 +0000 (16:11 -0700)

Merge branch 'jk/ssh-funny-url' into maint-2.7

connect: reject paths that look like command line optionsJeff King Fri, 28 Jul 2017 19:28:55 +0000 (15:28 -0400)

connect: reject paths that look like command line options

If we get a repo path like "-repo.git", we may try to invoke
"git-upload-pack -repo.git". This is going to fail, since
upload-pack will interpret it as a set of bogus options. But
let's reject this before we even run the sub-program, since
we would not want to allow any mischief with repo names that
actually are real command-line options.

You can still ask for such a path via git-daemon, but there's no
security problem there, because git-daemon enters the repo itself
and then passes "." on the command line.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

connect: reject dashed arguments for proxy commandsJeff King Fri, 28 Jul 2017 19:26:50 +0000 (15:26 -0400)

connect: reject dashed arguments for proxy commands

If you have a GIT_PROXY_COMMAND configured, we will run it
with the host/port on the command-line. If a URL contains a
mischievous host like "--foo", we don't know how the proxy
command may handle it. It's likely to break, but it may also
do something dangerous and unwanted (technically it could
even do something useful, but that seems unlikely).

We should err on the side of caution and reject this before
we even run the command.

The hostname check matches the one we do in a similar
circumstance for ssh. The port check is not present for ssh,
but there it's not necessary because the syntax is "-p
<port>", and there's no ambiguity on the parsing side.

It's not clear whether you can actually get a negative port
to the proxy here or not. Doing:

git fetch git://remote:-1234/repo.git

keeps the "-1234" as part of the hostname, with the default
port of 9418. But it's a good idea to keep this check close
to the point of running the command to make it clear that
there's no way to circumvent it (and at worst it serves as a
belt-and-suspenders check).

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

connect: factor out "looks like command line option... Jeff King Fri, 28 Jul 2017 19:25:45 +0000 (15:25 -0400)

connect: factor out "looks like command line option" check

We reject hostnames that start with a dash because they may
be confused for command-line options. Let's factor out that
notion into a helper function, as we'll use it in more
places. And while it's simple now, it's not clear if some
systems might need more complex logic to handle all cases.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5813: add test for hostname starting with dashJeff King Fri, 28 Jul 2017 19:23:32 +0000 (15:23 -0400)

t5813: add test for hostname starting with dash

Per the explanation in the previous patch, this should be
(and is) rejected.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

connect: reject ssh hostname that begins with a dashJunio C Hamano Wed, 26 Jul 2017 17:24:20 +0000 (10:24 -0700)

connect: reject ssh hostname that begins with a dash

When commands like "git fetch" talk with ssh://$rest_of_URL/, the
code splits $rest_of_URL into components like host, port, etc., and
then spawns the underlying "ssh" program by formulating argv[] array
that has:

- the path to ssh command taken from GIT_SSH_COMMAND, etc.

- dashed options like '-batch' (for Tortoise), '-p <port>' as
needed.

- ssh_host, which is supposed to be the hostname parsed out of
$rest_of_URL.

- then the command to be run on the other side, e.g. git
upload-pack.

If the ssh_host ends up getting '-<anything>', the argv[] that is
used to spawn the command becomes something like:

{ "ssh", "-p", "22", "-<anything>", "command", "to", "run", NULL }

which obviously is bogus, but depending on the actual value of
"<anything>", will make "ssh" parse and use it as an option.

Prevent this by forbidding ssh_host that begins with a "-".

Noticed-by: Joern Schneeweisz of Recurity Labs
Reported-by: Brian at GitLab
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/lib-proto-disable: restore protocol.allow after confi... Jeff King Fri, 28 Jul 2017 21:47:48 +0000 (17:47 -0400)

t/lib-proto-disable: restore protocol.allow after config tests

The tests for protocol.allow actually set that variable in
the on-disk config, run a series of tests, and then never
clean up after themselves. This means that whatever tests we
run after have protocol.allow=never, which may influence
their results.

In most cases we either exit after running these tests, or
do another round of test_proto(). In the latter case, this happens to
work because:

1. Tests of the GIT_ALLOW_PROTOCOL environment variable
override the config.

2. Tests of the specific config "protocol.foo.allow"
override the protocol.allow config.

3. The next round of protocol.allow tests start off by
setting the config to a known value.

However, it's a land-mine waiting to trap somebody adding
new tests to one of the t581x test scripts. Let's make sure
we clean up after ourselves.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: ensure fsck fails on corrupt packfilesJonathan Tan Fri, 28 Jul 2017 20:08:02 +0000 (13:08 -0700)

tests: ensure fsck fails on corrupt packfiles

t1450-fsck.sh does not have a test that checks fsck's behavior when a
packfile is invalid. It does have a test for when an object in a
packfile is invalid, but in that test, the packfile itself is valid.

Add such a test.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: remove unsupported parameter from patch-idAndreas Heiduk Thu, 27 Jul 2017 22:46:16 +0000 (00:46 +0200)

doc: remove unsupported parameter from patch-id

The patch is read from standard input and not from a parameter.

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

credential-cache: interpret an ECONNRESET as an EOFRamsay Jones Thu, 27 Jul 2017 01:08:40 +0000 (02:08 +0100)

credential-cache: interpret an ECONNRESET as an EOF

Since commit 612c49e94d ("credential-cache: add tests for XDG
functionality", 17-03-2017), the cygwin build has been failing all the
new tests added by that commit. In particular, the 'git credential-cache
exit' command, as part of the test cleanup code, has been die-ing with
the message:

fatal: read error from cache daemon: Connection reset by peer

As this git command is part of an && chain in a 'test_when_finished'
call, the remaining test cleanup is not happening, so practically all
remaining tests fail due to the unexpected presence of various socket
files and directories.

A simple means of getting the tests to pass, is to simply ignore the
failure of 'git credential-cache exit' command and make sure all test
cleanup is done. For example, the diff for test #12 would look like:

diff --git a/t/t0301-credential-cache.sh b/t/t0301-credential-cache.sh
index fd92533ac..87e5001bb 100755
--- a/t/t0301-credential-cache.sh
+++ b/t/t0301-credential-cache.sh
@@ -17,7 +17,7 @@ helper_test cache

test_expect_success 'socket defaults to ~/.cache/git/credential/socket' '
test_when_finished "
- git credential-cache exit &&
+ (git credential-cache exit || :) &&
rmdir -p .cache/git/credential/
" &&
test_path_is_missing "$HOME/.git-credential-cache" &&

... and so on for all remaining tests. While this does indeed make all
tests pass, it is not really a solution.

As an aside, while looking to debug this issue, I added the '--debug'
option to the invocation of the 'git-credential-cache--daemon' child
process (see the spawn_daemon() function). This not only fixed the tests,
but also stopped git-credential-cache exiting with a failure. Since the
only effect of passing '--debug' was to suppress the redirection of stderr
to the bit-bucket (/dev/null), I have no idea why this seems to fix the
protocol interaction between git and git-credential-cache--daemon. (I
did think that maybe it was a timing issue, so I tried sleeping before
reading from the daemon on Linux, but that only slowed down the tests!)

All descriptions of the "Connection reset by peer" error, that I could
find, say that the peer had destroyed the connection before the client
attempted to perform I/O on the connection. Since the daemon does not
respond to an "exit" message from the client, it just closes the socket
and deletes the socket file (via the atexit handler), it seems that the
expected result is for the client to receive an EOF. Indeed, this is
exactly what seems to be happening on Linux. Also a comment in
credential-cache--daemon.c reads:

else if (!strcmp(action.buf, "exit")) {
/*
* It's important that we clean up our socket first, and then
* signal the client only once we have finished the cleanup.
* Calling exit() directly does this, because we clean up in
* our atexit() handler, and then signal the client when our
* process actually ends, which closes the socket and gives
* them EOF.
*/
exit(0);
}

On cygwin this is not the case, at least when not passing --debug to the
daemon, and the read following the "exit" gets an error with errno set
to ECONNRESET.

In order to suppress the fatal exit in this case, check the read error
for an ECONNRESET and return as if no data was read from the daemon.
This effectively converts an ECONNRESET into an EOF.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'master' of https://github.com/ralfth... Jiang Xin Thu, 27 Jul 2017 15:12:11 +0000 (23:12 +0800)

Merge branch 'master' of https://github.com/ralfth/git-po-de

* 'master' of https://github.com/ralfth/git-po-de:
l10n: de.po: update German translation

Merge branch 'fr_l10n_v2.14.0rnd2' of git://github... Jiang Xin Thu, 27 Jul 2017 15:10:13 +0000 (23:10 +0800)

Merge branch 'fr_l10n_v2.14.0rnd2' of git://github.com/jnavila/git

* 'fr_l10n_v2.14.0rnd2' of git://github.com/jnavila/git:
l10n: fr.po v2.14.0 rnd 2
l10n: fr.po Fix some french typos
l10n: fr.po Fix typo
l10n: fr.po Fix some translations

l10n: fr.po v2.14.0 rnd 2Jean-Noel Avila Wed, 26 Jul 2017 13:48:29 +0000 (15:48 +0200)

l10n: fr.po v2.14.0 rnd 2

Signed-off-by: Jean-Noel Avila <jean-noel.avila@scantech.fr>

l10n: fr.po Fix some french typosSylvestre Ledru Thu, 22 Jun 2017 09:22:47 +0000 (11:22 +0200)

l10n: fr.po Fix some french typos

Signed-off-by: Sylvestre Ledru <sylvestre@debian.org>

l10n: fr.po Fix typoLouis Thu, 6 Jul 2017 20:21:14 +0000 (22:21 +0200)

l10n: fr.po Fix typo

Signed-off-by: Louis <spalax@gresille.org>

l10n: fr.po Fix some translationsHugues Peccatte Wed, 17 May 2017 20:26:19 +0000 (22:26 +0200)

l10n: fr.po Fix some translations

Signed-off-by: Hugues Peccatte <hugues.peccatte@aareon.fr>
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>

t8008: rely on rev-parse'd HEAD instead of sha1 valueStefan Beller Wed, 26 Jul 2017 19:06:31 +0000 (12:06 -0700)

t8008: rely on rev-parse'd HEAD instead of sha1 value

Remove hard coded sha1 values, obtain the values using
'git rev-parse HEAD' which should be future proof regardless
of the hash function used.

Additionally future-proof the test by hard coding the
abbreviation length of the hash.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sub-process: refactor handshake to common functionJonathan Tan Wed, 26 Jul 2017 18:17:29 +0000 (11:17 -0700)

sub-process: refactor handshake to common function

Refactor, into a common function, the version and capability negotiation
done when invoking a long-running process as a clean or smudge filter.
This will be useful for other Git code that needs to interact similarly
with a long-running process.

As you can see in the change to t0021, this commit changes the error
message reported when the long-running process does not introduce itself
with the expected "server"-terminated line. Originally, the error
message reports that the filter "does not support filter protocol
version 2", differentiating between the old single-file filter protocol
and the new multi-file filter protocol - I have updated it to something
more generic and useful.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: migrate sub-process docs to headerJonathan Tan Wed, 26 Jul 2017 18:17:28 +0000 (11:17 -0700)

Documentation: migrate sub-process docs to header

Move the documentation for the sub-process API from a separate txt file
to its header file.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ls/filter-process-delayed' into jt/subpro... Junio C Hamano Wed, 26 Jul 2017 19:56:19 +0000 (12:56 -0700)

Merge branch 'ls/filter-process-delayed' into jt/subprocess-handshake

* ls/filter-process-delayed:
convert: add "status=delayed" to filter process protocol
convert: refactor capabilities negotiation
convert: move multiple file filter error handling to separate function
convert: put the flags field before the flag itself for consistent style
t0021: write "OUT <size>" only on success
t0021: make debug log file name configurable
t0021: keep filter log files on comparison

fsck: cleanup unused variableJonathan Tan Wed, 26 Jul 2017 01:34:56 +0000 (18:34 -0700)

fsck: cleanup unused variable

Remove the unused variable "heads" from cmd_fsck().

This variable was made unused in commit c3271a0 ("fsck: do not fallback
"git fsck <bogus>" to "git fsck"", 2017-01-17).

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>