git
4 years agoci: also build and test with MS Visual Studio on Azure Pipelines
Johannes Schindelin [Fri, 4 Oct 2019 15:09:36 +0000 (08:09 -0700)] 
ci: also build and test with MS Visual Studio on Azure Pipelines

... because we can, now. Technically, we actually build using `MSBuild`,
which is however pretty close to building interactively in Visual
Studio.

As there is no convenient way to run Git's test suite in Visual Studio,
we unpack a Portable Git to run it, using the just-added test helper to
allow running test scripts in parallel.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoci: really use shallow clones on Azure Pipelines
Johannes Schindelin [Fri, 4 Oct 2019 15:09:35 +0000 (08:09 -0700)] 
ci: really use shallow clones on Azure Pipelines

This was a left-over from the previous YAML schema, and it no longer
works. The problem was noticed while editing `azure-pipelines.yml` in VS
Code with the very helpful "Azure Pipelines" extension (syntax
highlighting and intellisense for `azure-pipelines.yml`...).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agotests: let --immediate and --write-junit-xml play well together
Johannes Schindelin [Fri, 4 Oct 2019 15:09:34 +0000 (08:09 -0700)] 
tests: let --immediate and --write-junit-xml play well together

When the `--immediate` option is in effect, any test failure will
immediately exit the test script. Together with `--write-junit-xml`, we
will want the JUnit-style `.xml` file to be finalized (and not leave the
XML incomplete). Let's make it so.

This comes in particularly handy when trying to debug via Azure
Pipelines, where the JUnit-style XML is consumed to present the test
results in an informative and helpful way.

While at it, also handle the `error()` code path.

The only remaining code path that sets `GIT_EXIT_OK` happens whenever
the trash directory could not be set up, i.e. long before the JUnit XML
was written, therefore we should _not_ try to finalize that XML in that
case.

It is tempting to change the `immediate` code path to just hand off to
`error`, simplifying the code in the process. That would, however,
result in a change of behavior (an additional error message) in the test
suite, which is outside of the purview of the current patch series: its
goal is to allow building Git with Visual Studio and testing it with a
portable version of Git for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agotest-tool run-command: learn to run (parts of) the testsuite
Johannes Schindelin [Fri, 4 Oct 2019 15:09:33 +0000 (08:09 -0700)] 
test-tool run-command: learn to run (parts of) the testsuite

Git for Windows jumps through hoops to provide a development environment
that allows to build Git and to run its test suite. To that end, an
entire MSYS2 system, including GNU make and GCC is offered as "the Git
for Windows SDK". It does come at a price: an initial download of said
SDK weighs in with several hundreds of megabytes, and the unpacked SDK
occupies ~2GB of disk space.

A much more native development environment on Windows is Visual Studio.
To help contributors use that environment, we already have a Makefile
target `vcxproj` that generates a commit with project files (and other
generated files), and Git for Windows' `vs/master` branch is
continuously re-generated using that target.

The idea is to allow building Git in Visual Studio, and to run
individual tests using a Portable Git.

The one missing thing is a way to run the entire test suite: neither
`make` nor `prove` are required to run Git, therefore Git for Windows
does not support those commands in the Portable Git.

To help with that, add a simple test helper that exercises the
`run_processes_parallel()` function to allow for running test scripts in
parallel (which is really necessary, especially on Windows, as Git's
test suite takes such a long time to run).

This will also come in handy for the upcoming change to our Azure
Pipeline: we will use this helper in a Portable Git to test the Visual
Studio build of Git.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agovcxproj: include more generated files
Johannes Schindelin [Fri, 4 Oct 2019 15:09:32 +0000 (08:09 -0700)] 
vcxproj: include more generated files

In the CI builds, we bundle all generated files into a so-called
artifacts `.tar` file, so that the test phase can fan out into multiple
parallel builds.

This patch makes sure that all files are included in the `vcxproj`
target which are needed for that artifacts `.tar` file.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agovcxproj: only copy `git-remote-http.exe` once it was built
Johannes Schindelin [Fri, 4 Oct 2019 15:09:31 +0000 (08:09 -0700)] 
vcxproj: only copy `git-remote-http.exe` once it was built

In b18ae14a8f6 (vcxproj: also link-or-copy builtins, 2019-07-29), we
started to copy or hard-link the built-ins as a post-build step of the
`git` project.

At the same time, we tried to copy or hard-link `git-remote-http.exe`,
but it is quite possible that it was not built at that time.

Let's move that latter task into a post-install step of the
`git-remote-http` project instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomsvc: work around a bug in GetEnvironmentVariable()
Johannes Schindelin [Fri, 4 Oct 2019 15:09:30 +0000 (08:09 -0700)] 
msvc: work around a bug in GetEnvironmentVariable()

The return value of that function is 0 both for variables that are
unset, as well as for variables whose values are empty. To discern those
two cases, one has to call `GetLastError()`, whose return value is
`ERROR_ENVVAR_NOT_FOUND` and `ERROR_SUCCESS`, respectively.

Except that it is not actually set to `ERROR_SUCCESS` in the latter
case, apparently, but the last error value seems to be simply unchanged.

To work around this, let's just re-set the last error value just before
inspecting the environment variable.

This fixes a problem that triggers failures in t3301-notes.sh (where we
try to override config settings by passing empty values for certain
environment variables).

This problem is hidden in the MINGW build by the fact that older
MSVC runtimes (such as the one used by MINGW builds) have a `calloc()`
that re-sets the last error value in case of success, while newer
runtimes set the error value only if `NULL` is returned by that
function.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomsvc: handle DEVELOPER=1
Johannes Schindelin [Fri, 4 Oct 2019 15:09:30 +0000 (08:09 -0700)] 
msvc: handle DEVELOPER=1

We frequently build Git using the `DEVELOPER=1` make setting as a
shortcut to enable all kinds of more stringent compiler warnings.

Those compiler warnings are relatively specific to GCC, though, so let's
try our best to translate them to the equivalent options to pass to MS
Visual C++'s `cl.exe`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomsvc: ignore some libraries when linking
Johannes Schindelin [Fri, 4 Oct 2019 15:09:29 +0000 (08:09 -0700)] 
msvc: ignore some libraries when linking

To build with MSVC, we "translate" GCC options to MSVC options, and part
of those options refer to the libraries to link into the final
executable. Currently, this part looks somewhat like this on Windows:

-lcurl -lnghttp2 -lidn2 -lssl -lcrypto -lssl -lcrypto -lgdi32
-lcrypt32 -lwldap32 -lz -lws2_32 -lexpat

Some of those are direct dependencies (such as curl and ssl) and others
are indirect (nghttp2 and idn2, for example, are dependencies of curl,
but need to be linked in for reasons).

We already handle the direct dependencies, e.g. `-liconv` is already
handled as adding `libiconv.lib` to the list of libraries to link
against.

Let's just ignore the remaining `-l*` options so that MSVC does not have
to warn us that it ignored e.g. the `/lnghttp2` option. We do that by
extending the clause that already "eats" the `-R*` options to also eat
the `-l*` options.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocompat/win32/path-utils.h: add #include guards
Johannes Schindelin [Fri, 4 Oct 2019 15:09:28 +0000 (08:09 -0700)] 
compat/win32/path-utils.h: add #include guards

This adds the common guards that allow headers to be #include'd multiple
times.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agowinansi: use FLEX_ARRAY to avoid compiler warning
Johannes Schindelin [Fri, 4 Oct 2019 15:09:27 +0000 (08:09 -0700)] 
winansi: use FLEX_ARRAY to avoid compiler warning

MSVC would complain thusly:

    C4200: nonstandard extension used: zero-sized array in struct/union

Let's just use the `FLEX_ARRAY` constant that we introduced for exactly
this type of scenario.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomsvc: avoid using minus operator on unsigned types
Johannes Schindelin [Fri, 4 Oct 2019 15:09:26 +0000 (08:09 -0700)] 
msvc: avoid using minus operator on unsigned types

MSVC complains about this with `-Wall`, which can be taken as a sign
that this is indeed a real bug. The symptom is:

C4146: unary minus operator applied to unsigned type, result
still unsigned

Let's avoid this warning in the minimal way, e.g. writing `-1 -
<unsigned value>` instead of `-<unsigned value> - 1`.

Note that the change in the `estimate_cache_size()` function is
needed because MSVC considers the "return type" of the `sizeof()`
operator to be `size_t`, i.e. unsigned, and therefore it cannot be
negated using the unary minus operator.

Even worse, that arithmetic is doing extra work, in vain. We want to
calculate the entry extra cache size as the difference between the
size of the `cache_entry` structure minus the size of the
`ondisk_cache_entry` structure, padded to the appropriate alignment
boundary.

To that end, we start by assigning that difference to the `per_entry`
variable, and then abuse the `len` parameter of the
`align_padding_size()` macro to take the negative size of the ondisk
entry size. Essentially, we try to avoid passing the already calculated
difference to that macro by passing the operands of that difference
instead, when the macro expects operands of an addition:

#define align_padding_size(size, len) \
((size + (len) + 8) & ~7) - (size + len)

Currently, we pass A and -B to that macro instead of passing A - B and
0, where A - B is already stored in the `per_entry` variable, ready to
be used.

This is neither necessary, nor intuitive. Let's fix this, and have code
that is both easier to read and that also does not trigger MSVC's
warning.

While at it, we take care of reporting overflows (which are unlikely,
but hey, defensive programming is good!).

We _also_ take pains of casting the unsigned value to signed: otherwise,
the signed operand (i.e. the `-1`) would be cast to unsigned before
doing the arithmetic.

Helped-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopush: do not pretend to return `int` from `die_push_simple()`
Johannes Schindelin [Mon, 30 Sep 2019 09:55:31 +0000 (02:55 -0700)] 
push: do not pretend to return `int` from `die_push_simple()`

This function is marked as `NORETURN`, and it indeed does not want to
return anything. So let's not declare it with the return type `int`.
This fixes the following warning when building with MSVC:

C4646: function declared with 'noreturn' has non-void return type

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years ago.gitignore: stop ignoring `.manifest` files
Johannes Schindelin [Thu, 5 Sep 2019 11:16:33 +0000 (04:16 -0700)] 
.gitignore: stop ignoring `.manifest` files

On Windows, it is possible to embed additional metadata into an
executable by linking in a "manifest", i.e. an XML document that
describes capabilities and requirements (such as minimum or maximum
Windows version). These XML documents are expected to be stored in
`.manifest` files.

At least _some_ Visual Studio versions auto-generate `.manifest` files
when none is specified explicitly, therefore we used to ask Git to
ignore them.

However, we do have a beautiful `.manifest` file now:
`compat/win32/git.manifest`, so neither does Visual Studio auto-generate
a manifest for us, nor do we want Git to ignore the `.manifest` files
anymore.

Further reading on auto-generated `.manifest` files:
https://docs.microsoft.com/en-us/cpp/build/manifest-generation-in-visual-studio

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agogit: avoid calling aliased builtins via their dashed form
Johannes Schindelin [Mon, 29 Jul 2019 20:08:16 +0000 (13:08 -0700)] 
git: avoid calling aliased builtins via their dashed form

This is one of the few places where Git violates its own deprecation of
the dashed form. It is not necessary, either.

As of 595d59e2b53 (git.c: ignore pager.* when launching builtin as
dashed external, 2017-08-02), Git wants to ignore the pager.* config
setting when expanding aliases. So let's strip out the
check_pager_config(<command-name>) call from the copy-edited code.

This code actually made it into upstream git.git already, but it was
disabled in `#if 0 ... #endif` guards so far.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agobin-wrappers: append `.exe` to target paths if necessary
Johannes Schindelin [Mon, 29 Jul 2019 20:08:16 +0000 (13:08 -0700)] 
bin-wrappers: append `.exe` to target paths if necessary

When compiling with Visual Studio, the projects' names are identical to
the executables modulo the extensions. Read: there will exist both a
directory called `git` as well as an executable called `git.exe` in the
end. Which means that the bin-wrappers *need* to target the `.exe` files
lest they try to execute directories.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years ago.gitignore: ignore Visual Studio's temporary/generated files
Johannes Schindelin [Mon, 29 Jul 2019 20:08:15 +0000 (13:08 -0700)] 
.gitignore: ignore Visual Studio's temporary/generated files

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years ago.gitignore: touch up the entries regarding Visual Studio
Philip Oakley [Mon, 29 Jul 2019 20:08:14 +0000 (13:08 -0700)] 
.gitignore: touch up the entries regarding Visual Studio

Add the Microsoft .manifest pattern, and do not anchor the 'Debug'
and 'Release' entries at the top-level directory, to allow for
multiple projects (one per target).

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agovcxproj: also link-or-copy builtins
Johannes Schindelin [Mon, 29 Jul 2019 20:08:13 +0000 (13:08 -0700)] 
vcxproj: also link-or-copy builtins

The default location for `.exe` files linked by Visual Studio depends on
the mode (debug vs release) and the architecture. Meaning: after a full
build, there is a `git.exe` in the top-level directory, but none of the
built-ins are linked..

When running a test script in Git Bash, it therefore would pick up the
wrong, say, `git-receive-pack.exe`: the one installed at the same time
as the Git Bash.

Absolutely not what we want. We want to have confidence that our test
covers the MSVC-built Git executables, and not some random stuff.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomsvc: add a Makefile target to pre-generate the Visual Studio solution
Johannes Schindelin [Mon, 29 Jul 2019 20:08:12 +0000 (13:08 -0700)] 
msvc: add a Makefile target to pre-generate the Visual Studio solution

The entire idea of generating the VS solution makes only sense if we
generate it via Continuous Integration; otherwise potential users would
still have to download the entire Git for Windows SDK.

If we pre-generate the Visual Studio solution, Git can be built entirely
within Visual Studio, and the test scripts can be run in a regular Git
for Windows (e.g. the Portable Git flavor, which does not include a full
GCC toolchain and therefore weighs only about a tenth of Git for
Windows' SDK).

So let's just add a target in the Makefile that can be used to generate
said solution; The generated files will then be committed so that they
can be pushed to a branch ready to check out by Visual Studio users.

To make things even more useful, we also generate and commit other files
that are required to run the test suite, such as templates and
bin-wrappers: with this, developers can run the test suite in a regular
Git Bash after building the solution in Visual Studio.

Note: for this build target, we do not actually need to initialize the
`vcpkg` system, so we don't.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: add a backend for modern Visual Studio versions
Johannes Schindelin [Mon, 29 Jul 2019 20:08:12 +0000 (13:08 -0700)] 
contrib/buildsystems: add a backend for modern Visual Studio versions

Based on the previous patches in this patch series that fixed the
generator for `.vcproj` files (which were used by Visual Studio prior to
2015 to define projects), this patch offers to generate project
definitions for neweer versions of Visual Studio (which use `.vcxproj`
files).

To that end, this patch copy-edits the generator of the `.vcproj`.

In addition, we now use the `vcpkg` system which allows us to build
Git's dependencies (e.g. curl, libexpat) conveniently. The support
scripts were introduced in the `jh/msvc` patch series, and with this
patch we initialize the `vcpkg` conditionally, in the `libgit` project's
`PreBuildEvent`. To allow for parallel building of the projects, we
therefore put `libgit` at the bottom of the project hierarchy.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: handle options starting with a slash
Johannes Schindelin [Mon, 29 Jul 2019 20:08:11 +0000 (13:08 -0700)] 
contrib/buildsystems: handle options starting with a slash

With the recent changes to allow building with MSVC=1, we now pass the
/OPT:REF option to the compiler. This confuses the parser that wants to
turn the output of a dry run into project definitions for QMake and Visual
Studio:

Unhandled link option @ line 213: /OPT:REF at [...]

Let's just extend the code that passes through options that start with a
dash, so that it passes through options that start with a slash, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: also handle -lexpat
Johannes Schindelin [Mon, 29 Jul 2019 20:08:10 +0000 (13:08 -0700)] 
contrib/buildsystems: also handle -lexpat

This is a dependency required for the non-smart HTTP backend.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: handle libiconv, too
Johannes Schindelin [Mon, 29 Jul 2019 20:08:10 +0000 (13:08 -0700)] 
contrib/buildsystems: handle libiconv, too

Git's test suite shows tons of breakages unless Git is compiled
*without* NO_ICONV. That means, in turn, that we need to generate
build definitions *with* libiconv, which in turn implies that we
have to handle the -liconv option properly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: handle the curl library option
Philip Oakley [Mon, 29 Jul 2019 20:08:09 +0000 (13:08 -0700)] 
contrib/buildsystems: handle the curl library option

Upon seeing the '-lcurl' option, point to the libcurl.lib.

While there, fix the elsif indentation.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: error out on unknown option
Johannes Schindelin [Mon, 29 Jul 2019 20:08:08 +0000 (13:08 -0700)] 
contrib/buildsystems: error out on unknown option

One time too many did this developer call the `generate` script passing
a `--make-out=<PATH>` option that was happily ignored (because there
should be a space, not an equal sign, between `--make-out` and the
path).

And one time too many, this script not only ignored it but did not even
complain. Let's fix that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: optionally capture the dry-run in a file
Philip Oakley [Mon, 29 Jul 2019 20:08:07 +0000 (13:08 -0700)] 
contrib/buildsystems: optionally capture the dry-run in a file

Add an option for capturing the output of the make dry-run used in
determining the msvc-build structure for easy debugging.

You can use the output of `--make-out <path>` in subsequent runs via the
`--in <path>` option.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: redirect errors of the dry run into a log file
Philip Oakley [Mon, 29 Jul 2019 20:08:07 +0000 (13:08 -0700)] 
contrib/buildsystems: redirect errors of the dry run into a log file

Rather than swallowing the errors, it is better to have them in a file.

To make it obvious what this is about, use the file name
'msvc-build-makedryerrors.txt'.

Further, if the output is empty, simply delete that file. As we target
Git for Windows' SDK (which, unlike its predecessor msysGit, offers Perl
versions newer than 5.8), we can use the quite readable syntax `if -f -z
$ErrsFile` (available in Perl >=5.10).

Note that the file will contain the new values of the GIT_VERSION and
GITGUI_VERSION if they were generated by the make file. They are omitted
if the release is tagged and indentically defined in their respective
GIT_VERSION_GEN file DEF_VER variables.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: ignore gettext stuff
Philip Oakley [Mon, 29 Jul 2019 20:08:06 +0000 (13:08 -0700)] 
contrib/buildsystems: ignore gettext stuff

Git's build contains steps to handle internationalization. This caused
hiccups in the parser used to generate QMake/Visual Studio project files.

As those steps are irrelevant in this context, let's just ignore them.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: handle quoted spaces in filenames
Philip Oakley [Mon, 29 Jul 2019 20:08:05 +0000 (13:08 -0700)] 
contrib/buildsystems: handle quoted spaces in filenames

The engine.pl script expects file names not to contain spaces. However,
paths with spaces are quite prevalent on Windows. Use shellwords() rather
than split() to parse them correctly.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: fix misleading error message
Philip Oakley [Mon, 29 Jul 2019 20:08:05 +0000 (13:08 -0700)] 
contrib/buildsystems: fix misleading error message

The error message talked about a "lib option", but it clearly referred
to a link option.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: ignore irrelevant files in Generators/
Johannes Schindelin [Mon, 29 Jul 2019 20:08:04 +0000 (13:08 -0700)] 
contrib/buildsystems: ignore irrelevant files in Generators/

The Generators/ directory can contain spurious files such as editors'
backup files. Even worse, there could be .swp files which are not even
valid Perl scripts.

Let's just ignore anything but .pm files in said directory.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: ignore invalidcontinue.obj
Philip Oakley [Mon, 29 Jul 2019 20:08:03 +0000 (13:08 -0700)] 
contrib/buildsystems: ignore invalidcontinue.obj

Since 4b623d8 (MSVC: link in invalidcontinue.obj for better POSIX
compatibility, 2014-03-29), invalidcontinue.obj is linked in the MSVC
build, but it was not parsed correctly by the buildsystem. Ignore it, as
it is known to Visual Studio and will be handled elsewhere.

Also only substitute filenames ending with .o when generating the
source .c filename, otherwise we would start to expect .cbj files to
generate .obj files (which are not generated by our build)...

In the future there may be source files that produce .obj files
so keep the two issues (.obj files with & without source files)
separate.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Duncan Smart <duncan.smart@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoVcproj.pm: urlencode '<' and '>' when generating VC projects
Johannes Schindelin [Mon, 29 Jul 2019 20:08:03 +0000 (13:08 -0700)] 
Vcproj.pm: urlencode '<' and '>' when generating VC projects

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoVcproj.pm: do not configure VCWebServiceProxyGeneratorTool
Johannes Schindelin [Mon, 29 Jul 2019 20:08:02 +0000 (13:08 -0700)] 
Vcproj.pm: do not configure VCWebServiceProxyGeneratorTool

It is not necessary, and Visual Studio 2015 no longer supports it, anyway.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoVcproj.pm: list git.exe first to be startup project
Philip Oakley [Mon, 29 Jul 2019 20:08:01 +0000 (13:08 -0700)] 
Vcproj.pm: list git.exe first to be startup project

Visual Studio takes the first listed application/library as the default
startup project [1].

Detect the 'git' project and place it at the head of the project list,
rather than at the tail.

Export the apps list before libs list for both the projects and global
structures of the .sln file.

[1] http://stackoverflow.com/questions/1238553/
vs2008-where-is-the-startup-project-setting-stored-for-a-solution
    "In the solution file, there are a list of pseudo-XML "Project"
    entries. It turns out that whatever is the first one ends up as
    the Startup Project, unless it’s overridden in the suo file. Argh.
    I just rearranged the order in the file and it’s good."

    "just moving the pseudo-xml isn't enough. You also have to move the
    group of entries in the "GlobalSection(ProjectConfigurationPlatforms)
    = postSolution" group that has the GUID of the project you moved to
    the top. So there are two places to move lines."

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoVcproj.pm: auto-generate GUIDs
Johannes Schindelin [Mon, 29 Jul 2019 20:08:01 +0000 (13:08 -0700)] 
Vcproj.pm: auto-generate GUIDs

We ran out GUIDs. Again. But there is no need to: we can generate them
semi-randomly from the target file name of the project.

Note: the Vcproj generator is probably only interesting for historical
reasons; nevertheless, the upcoming Vcxproj generator (to support modern
Visual Studio versions) is based on the Vcproj generator and it is
better to fix this here first.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoThe fifth batch
Junio C Hamano [Thu, 11 Jul 2019 22:17:22 +0000 (15:17 -0700)] 
The fifth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'js/mingw-use-utf8'
Junio C Hamano [Thu, 11 Jul 2019 22:16:49 +0000 (15:16 -0700)] 
Merge branch 'js/mingw-use-utf8'

Windows update.

* js/mingw-use-utf8:
  mingw: fix possible buffer overrun when calling `GetUserNameW()`
  mingw: use Unicode functions explicitly
  mingw: get pw_name in UTF-8 format

4 years agoMerge branch 'sg/ci-brew-gcc-workaround'
Junio C Hamano [Thu, 11 Jul 2019 22:16:49 +0000 (15:16 -0700)] 
Merge branch 'sg/ci-brew-gcc-workaround'

Dev support update.

* sg/ci-brew-gcc-workaround:
  ci/lib.sh: update a comment about installed P4 and Git-LFS versions
  ci: disable Homebrew's auto cleanup
  ci: don't update Homebrew

4 years agoMerge branch 'kb/windows-force-utf8'
Junio C Hamano [Thu, 11 Jul 2019 22:16:49 +0000 (15:16 -0700)] 
Merge branch 'kb/windows-force-utf8'

Windows update.

* kb/windows-force-utf8:
  gettext: always use UTF-8 on native Windows

4 years agoMerge branch 'dr/progress-i18n'
Junio C Hamano [Thu, 11 Jul 2019 22:16:49 +0000 (15:16 -0700)] 
Merge branch 'dr/progress-i18n'

Progress messages have been made localizable.

* dr/progress-i18n:
  l10n: localizable upload progress messages

4 years agoMerge branch 'qn/clone-doc-use-long-form'
Junio C Hamano [Thu, 11 Jul 2019 22:16:48 +0000 (15:16 -0700)] 
Merge branch 'qn/clone-doc-use-long-form'

The "git clone" documentation refers to command line options in its
description in the short form; they have been replaced with long
forms to make them more recognisable.

* qn/clone-doc-use-long-form:
  docs: git-clone: list short form of options first
  docs: git-clone: refer to long form of options

4 years agoMerge branch 'js/rebase-reschedule-applies-only-to-interactive'
Junio C Hamano [Thu, 11 Jul 2019 22:16:48 +0000 (15:16 -0700)] 
Merge branch 'js/rebase-reschedule-applies-only-to-interactive'

The configuration variable rebase.rescheduleFailedExec should be
effective only while running an interactive rebase and should not
affect anything when running an non-interactive one, which was not
the case.  This has been corrected.

* js/rebase-reschedule-applies-only-to-interactive:
  rebase --am: ignore rebase.rescheduleFailedExec

4 years agoMerge branch 'sg/git-C-empty-doc'
Junio C Hamano [Thu, 11 Jul 2019 22:16:48 +0000 (15:16 -0700)] 
Merge branch 'sg/git-C-empty-doc'

Doc update.

* sg/git-C-empty-doc:
  Document that 'git -C ""' works and doesn't change directory

4 years agoMerge branch 'jt/t5551-test-chunked'
Junio C Hamano [Thu, 11 Jul 2019 22:16:47 +0000 (15:16 -0700)] 
Merge branch 'jt/t5551-test-chunked'

Update smart-http test.

* jt/t5551-test-chunked:
  t5551: test usage of chunked encoding explicitly

4 years agoMerge branch 'js/mingw-gcc-stack-protect'
Junio C Hamano [Thu, 11 Jul 2019 22:16:47 +0000 (15:16 -0700)] 
Merge branch 'js/mingw-gcc-stack-protect'

Windows update.

* js/mingw-gcc-stack-protect:
  mingw: enable stack smashing protector

4 years agoMerge branch 'cb/windows-manifest'
Junio C Hamano [Thu, 11 Jul 2019 22:16:47 +0000 (15:16 -0700)] 
Merge branch 'cb/windows-manifest'

Windows update.

* cb/windows-manifest:
  mingw: embed a manifest to trick UAC into Doing The Right Thing

4 years agoThe fourth batch
Junio C Hamano [Tue, 9 Jul 2019 22:48:36 +0000 (15:48 -0700)] 
The fourth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'ds/fetch-disable-force-notice'
Junio C Hamano [Tue, 9 Jul 2019 22:25:46 +0000 (15:25 -0700)] 
Merge branch 'ds/fetch-disable-force-notice'

"git fetch" and "git pull" reports when a fetch results in
non-fast-forward updates to let the user notice unusual situation.
The commands learned "--no-shown-forced-updates" option to disable
this safety feature.

* ds/fetch-disable-force-notice:
  pull: add --[no-]show-forced-updates passthrough
  fetch: warn about forced updates in branch listing
  fetch: add --[no-]show-forced-updates argument

4 years agoMerge branch 'jh/status-aheadbehind'
Junio C Hamano [Tue, 9 Jul 2019 22:25:46 +0000 (15:25 -0700)] 
Merge branch 'jh/status-aheadbehind'

"git status" can be told a non-standard default value for the
"--[no-]ahead-behind" option with a new configuration variable
status.aheadBehind.

* jh/status-aheadbehind:
  status: ignore status.aheadbehind in porcelain formats
  status: warn when a/b calculation takes too long
  status: add status.aheadbehind setting

4 years agoMerge branch 'sg/t5551-fetch-smart-error-is-translated'
Junio C Hamano [Tue, 9 Jul 2019 22:25:46 +0000 (15:25 -0700)] 
Merge branch 'sg/t5551-fetch-smart-error-is-translated'

Test update.

* sg/t5551-fetch-smart-error-is-translated:
  t5551: use 'test_i18ngrep' to check translated output

4 years agoMerge branch 'ms/submodule-foreach-fix'
Junio C Hamano [Tue, 9 Jul 2019 22:25:46 +0000 (15:25 -0700)] 
Merge branch 'ms/submodule-foreach-fix'

"git submodule foreach" did not protect command line options passed
to the command to be run in each submodule correctly, when the
"--recursive" option was in use.

* ms/submodule-foreach-fix:
  submodule foreach: fix recursion of options

4 years agoMerge branch 'jh/msvc'
Junio C Hamano [Tue, 9 Jul 2019 22:25:45 +0000 (15:25 -0700)] 
Merge branch 'jh/msvc'

Support to build with MSVC has been updated.

* jh/msvc:
  msvc: ignore .dll and incremental compile output
  msvc: avoid debug assertion windows in Debug Mode
  msvc: do not pretend to support all signals
  msvc: add pragmas for common warnings
  msvc: add a compile-time flag to allow detailed heap debugging
  msvc: support building Git using MS Visual C++
  msvc: update Makefile to allow for spaces in the compiler path
  msvc: fix detect_msys_tty()
  msvc: define ftello()
  msvc: do not re-declare the timespec struct
  msvc: mark a variable as non-const
  msvc: define O_ACCMODE
  msvc: include sigset_t definition
  msvc: fix dependencies of compat/msvc.c
  mingw: replace mingw_startup() hack
  obstack: fix compiler warning
  cache-tree/blame: avoid reusing the DEBUG constant
  t0001 (mingw): do not expect a specific order of stdout/stderr
  Mark .bat files as requiring CR/LF endings
  mingw: fix a typo in the msysGit-specific section

4 years agoMerge branch 'sg/rebase-progress'
Junio C Hamano [Tue, 9 Jul 2019 22:25:45 +0000 (15:25 -0700)] 
Merge branch 'sg/rebase-progress'

Use "Erase in Line" CSI sequence that is already used in the editor
support to clear cruft in the progress output.

* sg/rebase-progress:
  progress: use term_clear_line()
  rebase: fix garbled progress display with '-x'
  pager: add a helper function to clear the last line in the terminal
  t3404: make the 'rebase.missingCommitsCheck=ignore' test more focused
  t3404: modernize here doc style

4 years agoMerge branch 'jw/gitweb-sample-update'
Junio C Hamano [Tue, 9 Jul 2019 22:25:45 +0000 (15:25 -0700)] 
Merge branch 'jw/gitweb-sample-update'

Doc update.

* jw/gitweb-sample-update:
  doc: don't use git.kernel.org as example gitweb URL

4 years agoMerge branch 'js/t0001-case-insensitive'
Junio C Hamano [Tue, 9 Jul 2019 22:25:44 +0000 (15:25 -0700)] 
Merge branch 'js/t0001-case-insensitive'

Test update.

* js/t0001-case-insensitive:
  t0001: fix on case-insensitive filesystems

4 years agoMerge branch 'cc/first-contrib-tutorial'
Junio C Hamano [Tue, 9 Jul 2019 22:25:44 +0000 (15:25 -0700)] 
Merge branch 'cc/first-contrib-tutorial'

Update docs used in a tutorial.

* cc/first-contrib-tutorial:
  doc: improve usage string in MyFirstContribution

4 years agoMerge branch 'ab/fail-prereqs-in-test'
Junio C Hamano [Tue, 9 Jul 2019 22:25:44 +0000 (15:25 -0700)] 
Merge branch 'ab/fail-prereqs-in-test'

Test updates.

* ab/fail-prereqs-in-test:
  tests: mark two failing tests under FAIL_PREREQS

4 years agoMerge branch 'nd/switch-and-restore'
Junio C Hamano [Tue, 9 Jul 2019 22:25:44 +0000 (15:25 -0700)] 
Merge branch 'nd/switch-and-restore'

Two new commands "git switch" and "git restore" are introduced to
split "checking out a branch to work on advancing its history" and
"checking out paths out of the index and/or a tree-ish to work on
advancing the current history" out of the single "git checkout"
command.

* nd/switch-and-restore: (46 commits)
  completion: disable dwim on "git switch -d"
  switch: allow to switch in the middle of bisect
  t2027: use test_must_be_empty
  Declare both git-switch and git-restore experimental
  help: move git-diff and git-reset to different groups
  doc: promote "git restore"
  user-manual.txt: prefer 'merge --abort' over 'reset --hard'
  completion: support restore
  t: add tests for restore
  restore: support --patch
  restore: replace --force with --ignore-unmerged
  restore: default to --source=HEAD when only --staged is specified
  restore: reject invalid combinations with --staged
  restore: add --worktree and --staged
  checkout: factor out worktree checkout code
  restore: disable overlay mode by default
  restore: make pathspec mandatory
  restore: take tree-ish from --source option instead
  checkout: split part of it to new command 'restore'
  doc: promote "git switch"
  ...

4 years agoMerge branch 'nd/fetch-capability-tweak'
Junio C Hamano [Tue, 9 Jul 2019 22:25:43 +0000 (15:25 -0700)] 
Merge branch 'nd/fetch-capability-tweak'

Protocol capabilities that go over wire should never be translated,
but it was incorrectly marked for translation, which has been
corrected.  The output of protocol capabilities for debugging has
been tweaked a bit.

* nd/fetch-capability-tweak:
  fetch-pack: print server version at the top in -v -v
  fetch-pack: print all relevant supported capabilities with -v -v
  fetch-pack: move capability names out of i18n strings

4 years agoMerge branch 'jk/oidhash'
Junio C Hamano [Tue, 9 Jul 2019 22:25:43 +0000 (15:25 -0700)] 
Merge branch 'jk/oidhash'

Code clean-up to remove hardcoded SHA-1 hash from many places.

* jk/oidhash:
  hashmap: convert sha1hash() to oidhash()
  hash.h: move object_id definition from cache.h
  khash: rename oid helper functions
  khash: drop sha1-specific map types
  pack-bitmap: convert khash_sha1 maps into kh_oid_map
  delta-islands: convert island_marks khash to use oids
  khash: rename kh_oid_t to kh_oid_set
  khash: drop broken oid_map typedef
  object: convert create_object() to use object_id
  object: convert internal hash_obj() to object_id
  object: convert lookup_object() to use object_id
  object: convert lookup_unknown_object() to use object_id
  pack-objects: convert locate_object_entry_hash() to object_id
  pack-objects: convert packlist_find() to use object_id
  pack-bitmap-write: convert some helpers to use object_id
  upload-pack: rename a "sha1" variable to "oid"
  describe: fix accidental oid/hash type-punning

4 years agoMerge branch 'jk/delta-islands-progress-fix'
Junio C Hamano [Tue, 9 Jul 2019 22:25:43 +0000 (15:25 -0700)] 
Merge branch 'jk/delta-islands-progress-fix'

The codepath to compute delta islands used to spew progress output
without giving the callers any way to squelch it, which has been
fixed.

* jk/delta-islands-progress-fix:
  delta-islands: respect progress flag

4 years agoMerge branch 'md/sort-detached-head-first'
Junio C Hamano [Tue, 9 Jul 2019 22:25:42 +0000 (15:25 -0700)] 
Merge branch 'md/sort-detached-head-first'

"git branch --list" learned to always output the detached HEAD as
the first item (when the HEAD is detached, of course), regardless
of the locale.

* md/sort-detached-head-first:
  ref-filter: sort detached HEAD lines firstly

4 years agoMerge branch 'nd/fetch-multi-gc-once'
Junio C Hamano [Tue, 9 Jul 2019 22:25:42 +0000 (15:25 -0700)] 
Merge branch 'nd/fetch-multi-gc-once'

"git fetch" that grabs from a group of remotes learned to run the
auto-gc only once at the very end.

* nd/fetch-multi-gc-once:
  fetch: only run 'gc' once when fetching multiple remotes

4 years agoMerge branch 'es/rev-list-no-object-names'
Junio C Hamano [Tue, 9 Jul 2019 22:25:42 +0000 (15:25 -0700)] 
Merge branch 'es/rev-list-no-object-names'

"git rev-list --objects" learned with "--no-object-names" option to
squelch the path to the object that is used as a grouping hint for
pack-objects.

* es/rev-list-no-object-names:
  rev-list: teach --no-object-names to enable piping

4 years agoMerge branch 'rs/config-unit-parsing'
Junio C Hamano [Tue, 9 Jul 2019 22:25:41 +0000 (15:25 -0700)] 
Merge branch 'rs/config-unit-parsing'

The code to parse scaled numbers out of configuration files has
been made more robust and also easier to follow.

* rs/config-unit-parsing:
  config: simplify parsing of unit factors
  config: don't multiply in parse_unit_factor()
  config: use unsigned_mult_overflows to check for overflows

4 years agoMerge branch 'js/gcc-8-and-9'
Junio C Hamano [Tue, 9 Jul 2019 22:25:41 +0000 (15:25 -0700)] 
Merge branch 'js/gcc-8-and-9'

Code clean-up for new compilers.

* js/gcc-8-and-9:
  config: avoid calling `labs()` on too-large data type
  winansi: simplify loading the GetCurrentConsoleFontEx() function
  kwset: allow building with GCC 8
  poll (mingw): allow compiling with GCC 8 and DEVELOPER=1

4 years agoMerge branch 'dl/includeif-onbranch'
Junio C Hamano [Tue, 9 Jul 2019 22:25:41 +0000 (15:25 -0700)] 
Merge branch 'dl/includeif-onbranch'

The conditional inclusion mechanism learned to base the choice on
the branch the HEAD currently is on.

* dl/includeif-onbranch:
  config: learn the "onbranch:" includeIf condition

4 years agoMerge branch 'pw/rebase-abort-clean-rewritten'
Junio C Hamano [Tue, 9 Jul 2019 22:25:41 +0000 (15:25 -0700)] 
Merge branch 'pw/rebase-abort-clean-rewritten'

"git rebase --abort" used to leave refs/rewritten/ when concluding
"git rebase -r", which has been corrected.

* pw/rebase-abort-clean-rewritten:
  rebase --abort/--quit: cleanup refs/rewritten
  sequencer: return errors from sequencer_remove_state()
  rebase: warn if state directory cannot be removed
  rebase: fix a memory leak

4 years agoMerge branch 'am/p4-branches-excludes'
Junio C Hamano [Tue, 9 Jul 2019 22:25:40 +0000 (15:25 -0700)] 
Merge branch 'am/p4-branches-excludes'

"git p4" update.

* am/p4-branches-excludes:
  git-p4: respect excluded paths when detecting branches
  git-p4: add failing test for "git-p4: respect excluded paths when detecting branches"
  git-p4: don't exclude other files with same prefix
  git-p4: add failing test for "don't exclude other files with same prefix"
  git-p4: don't groom exclude path list on every commit
  git-p4: match branches case insensitively if configured
  git-p4: add failing test for "git-p4: match branches case insensitively if configured"
  git-p4: detect/prevent infinite loop in gitCommitByP4Change()

4 years agoMerge branch 'tg/stash-ref-by-index-fix'
Junio C Hamano [Tue, 9 Jul 2019 22:25:40 +0000 (15:25 -0700)] 
Merge branch 'tg/stash-ref-by-index-fix'

"git stash show 23" used to work, but no more after getting
rewritten in C; this regression has been corrected.

* tg/stash-ref-by-index-fix:
  stash: fix show referencing stash index

4 years agoMerge branch 'cb/mkstemps-uint-type-fix'
Junio C Hamano [Tue, 9 Jul 2019 22:25:40 +0000 (15:25 -0700)] 
Merge branch 'cb/mkstemps-uint-type-fix'

Variable type fix.

* cb/mkstemps-uint-type-fix:
  wrapper: avoid undefined behaviour in macOS

4 years agoMerge branch 'jk/trailers-use-config'
Junio C Hamano [Tue, 9 Jul 2019 22:25:40 +0000 (15:25 -0700)] 
Merge branch 'jk/trailers-use-config'

"git interpret-trailers" always treated '#' as the comment
character, regardless of core.commentChar setting, which has been
corrected.

* jk/trailers-use-config:
  interpret-trailers: load default config

4 years agoMerge branch 'js/t3404-typofix'
Junio C Hamano [Tue, 9 Jul 2019 22:25:39 +0000 (15:25 -0700)] 
Merge branch 'js/t3404-typofix'

Typofix.

* js/t3404-typofix:
  t3404: fix a typo

4 years agoMerge branch 'pw/doc-synopsis-markup-opmode-options'
Junio C Hamano [Tue, 9 Jul 2019 22:25:38 +0000 (15:25 -0700)] 
Merge branch 'pw/doc-synopsis-markup-opmode-options'

Docfix.

* pw/doc-synopsis-markup-opmode-options:
  show --continue/skip etc. consistently in synopsis

4 years agoMerge branch 'rs/copy-array'
Junio C Hamano [Tue, 9 Jul 2019 22:25:38 +0000 (15:25 -0700)] 
Merge branch 'rs/copy-array'

Code clean-up.

* rs/copy-array:
  use COPY_ARRAY for copying arrays
  coccinelle: use COPY_ARRAY for copying arrays

4 years agoMerge branch 'cb/fsmonitor-intfix'
Junio C Hamano [Tue, 9 Jul 2019 22:25:38 +0000 (15:25 -0700)] 
Merge branch 'cb/fsmonitor-intfix'

Variable type fix.

* cb/fsmonitor-intfix:
  fsmonitor: avoid signed integer overflow / infinite loop

4 years agoMerge branch 'rs/avoid-overflow-in-midpoint-computation'
Junio C Hamano [Tue, 9 Jul 2019 22:25:37 +0000 (15:25 -0700)] 
Merge branch 'rs/avoid-overflow-in-midpoint-computation'

Code clean-up to avoid signed integer overlaps during binary search.

* rs/avoid-overflow-in-midpoint-computation:
  cleanup: fix possible overflow errors in binary search, part 2

4 years agoMerge branch 'pw/add-p-recount'
Junio C Hamano [Tue, 9 Jul 2019 22:25:37 +0000 (15:25 -0700)] 
Merge branch 'pw/add-p-recount'

"git checkout -p" needs to selectively apply a patch in reverse,
which did not work well.

* pw/add-p-recount:
  add -p: fix checkout -p with pathological context

4 years agoMerge branch 'ds/close-object-store'
Junio C Hamano [Tue, 9 Jul 2019 22:25:37 +0000 (15:25 -0700)] 
Merge branch 'ds/close-object-store'

The commit-graph file is now part of the "files that the runtime
may keep open file descriptors on, all of which would need to be
closed when done with the object store", and the file descriptor to
an existing commit-graph file now is closed before "gc" finalizes a
new instance to replace it.

* ds/close-object-store:
  packfile: rename close_all_packs to close_object_store
  packfile: close commit-graph in close_all_packs
  commit-graph: use raw_object_store when closing

4 years agoMerge branch 'ds/commit-graph-write-refactor'
Junio C Hamano [Tue, 9 Jul 2019 22:25:36 +0000 (15:25 -0700)] 
Merge branch 'ds/commit-graph-write-refactor'

Renamed from commit-graph-format-v2 and changed scope.

* ds/commit-graph-write-refactor:
  commit-graph: extract write_commit_graph_file()
  commit-graph: extract copy_oids_to_commits()
  commit-graph: extract count_distinct_commits()
  commit-graph: extract fill_oids_from_all_packs()
  commit-graph: extract fill_oids_from_commit_hex()
  commit-graph: extract fill_oids_from_packs()
  commit-graph: create write_commit_graph_context
  commit-graph: remove Future Work section
  commit-graph: collapse parameters into flags
  commit-graph: return with errors during write
  commit-graph: fix the_repository reference

4 years agoMerge branch 'sg/trace2-rename'
Junio C Hamano [Tue, 9 Jul 2019 22:25:36 +0000 (15:25 -0700)] 
Merge branch 'sg/trace2-rename'

Dev support update to help tracing out tests.

* sg/trace2-rename:
  trace2: correct typo in technical documentation
  Revert "test-lib: whitelist GIT_TR2_* in the environment"

4 years agoMerge branch 'nd/completion-no-cache-failure'
Junio C Hamano [Tue, 9 Jul 2019 22:25:35 +0000 (15:25 -0700)] 
Merge branch 'nd/completion-no-cache-failure'

An incorrect list of options was cached after command line
completion failed (e.g. trying to complete a command that requires
a repository outside one), which has been corrected.

* nd/completion-no-cache-failure:
  completion: do not cache if --git-completion-helper fails

4 years agoMerge branch 'js/mergetool-optim'
Junio C Hamano [Tue, 9 Jul 2019 22:25:35 +0000 (15:25 -0700)] 
Merge branch 'js/mergetool-optim'

"git mergetool" and its tests now spawn fewer subprocesses.

* js/mergetool-optim:
  mergetool: use shell variable magic instead of `awk`
  mergetool: dissect strings with shell variable magic instead of `expr`
  t7610-mergetool: use test_cmp instead of test $(cat file) = $txt
  t7610-mergetool: do not place pipelines headed by `yes` in subshells

4 years agoMerge branch 'mo/hpux-dynpath'
Junio C Hamano [Tue, 9 Jul 2019 22:25:35 +0000 (15:25 -0700)] 
Merge branch 'mo/hpux-dynpath'

Auto-detect how to tell HP-UX aCC where to use dynamically linked
libraries from at runtime.

* mo/hpux-dynpath:
  configure: Detect linking style for HP aCC on HP-UX

4 years agoMerge branch 'dl/config-alias-doc'
Junio C Hamano [Tue, 9 Jul 2019 22:25:35 +0000 (15:25 -0700)] 
Merge branch 'dl/config-alias-doc'

Doc update.

* dl/config-alias-doc:
  config/alias.txt: document alias accepting non-command first word
  config/alias.txt: change " and ' to `

4 years agoMerge branch 'tm/tag-gpgsign-config'
Junio C Hamano [Tue, 9 Jul 2019 22:25:34 +0000 (15:25 -0700)] 
Merge branch 'tm/tag-gpgsign-config'

A new tag.gpgSign configuration variable turns "git tag -a" into
"git tag -s".

* tm/tag-gpgsign-config:
  tag: add tag.gpgSign config option to force all tags be GPG-signed

4 years agoMerge branch 'fc/fetch-with-import-fix'
Junio C Hamano [Tue, 9 Jul 2019 22:25:34 +0000 (15:25 -0700)] 
Merge branch 'fc/fetch-with-import-fix'

Code restructuring during 2.20 period broke fetching tags via
"import" based transports.

* fc/fetch-with-import-fix:
  fetch: fix regression with transport helpers
  fetch: make the code more understandable
  fetch: trivial cleanup
  t5801 (remote-helpers): add test to fetch tags
  t5801 (remote-helpers): cleanup refspec stuff

4 years agoMerge branch 'po/doc-branch'
Junio C Hamano [Tue, 9 Jul 2019 22:25:34 +0000 (15:25 -0700)] 
Merge branch 'po/doc-branch'

Doc update.

* po/doc-branch:
  doc branch: provide examples for listing remote tracking branches

4 years agoMerge branch 'nb/branch-show-other-worktrees-head'
Junio C Hamano [Tue, 9 Jul 2019 22:25:33 +0000 (15:25 -0700)] 
Merge branch 'nb/branch-show-other-worktrees-head'

"git branch --list" learned to show branches that are checked out
in other worktrees connected to the same repository prefixed with
'+', similar to the way the currently checked out branch is shown
with '*' in front.

* nb/branch-show-other-worktrees-head:
  branch: add worktree info on verbose output
  branch: update output to include worktree info
  ref-filter: add worktreepath atom

4 years agomingw: fix possible buffer overrun when calling `GetUserNameW()`
Johannes Schindelin [Thu, 4 Jul 2019 22:36:57 +0000 (15:36 -0700)] 
mingw: fix possible buffer overrun when calling `GetUserNameW()`

In 39a98e9b68b8 (mingw: get pw_name in UTF-8 format, 2019-06-27), this
developer missed the fact that the `GetUserNameW()` function takes the
number of characters as `len` parameter, not the number of bytes.

Reported-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoci/lib.sh: update a comment about installed P4 and Git-LFS versions
SZEDER Gábor [Sat, 6 Jul 2019 16:21:14 +0000 (18:21 +0200)] 
ci/lib.sh: update a comment about installed P4 and Git-LFS versions

A comment in 'ci/lib.sh' claims that the "OS X build installs the
latest available versions" of P4 and Git-LFS, but since f2f47150
("ci: don't update Homebrew", 2019-07-03) that's no longer the case,
as it will install the versions which were recorded in the image's
Homebrew database when the image was created.

Update this comment accordingly.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agogettext: always use UTF-8 on native Windows
Karsten Blees [Wed, 3 Jul 2019 20:46:04 +0000 (13:46 -0700)] 
gettext: always use UTF-8 on native Windows

On native Windows, Git exclusively uses UTF-8 for console output (both
with MinTTY and native Win32 Console). Gettext uses `setlocale()` to
determine the output encoding for translated text, however, MSVCRT's
`setlocale()` does not support UTF-8. As a result, translated text is
encoded in system encoding (as per `GetAPC()`), and non-ASCII chars are
mangled in console output.

Side note: There is actually a code page for UTF-8: 65001. In practice,
it does not work as expected at least on Windows 7, though, so we cannot
use it in Git. Besides, if we overrode the code page, any process
spawned from Git would inherit that code page (as opposed to the code
page configured for the current user), which would quite possibly break
e.g. diff or merge helpers. So we really cannot override the code page.

In `init_gettext_charset()`, Git calls gettext's
`bind_textdomain_codeset()` with the character set obtained via
`locale_charset()`; Let's override that latter function to force the
encoding to UTF-8 on native Windows.

In Git for Windows' SDK, there is a `libcharset.h` and therefore we
define `HAVE_LIBCHARSET_H` in the MINGW-specific section in
`config.mak.uname`, therefore we need to add the override before that
conditionally-compiled code block.

Rather than simply defining `locale_charset()` to return the string
`"UTF-8"`, though, we are careful not to break `LC_ALL=C`: the
`ab/no-kwset` patch series, for example, needs to have a way to prevent
Git from expecting UTF-8-encoded input.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoci: disable Homebrew's auto cleanup
SZEDER Gábor [Wed, 3 Jul 2019 10:47:48 +0000 (12:47 +0200)] 
ci: disable Homebrew's auto cleanup

Lately Homebrew learned to automagically clean up information about
outdated packages during other 'brew' commands, which might be useful
for the avarage user, but is a waste of time in CI build jobs, because
the next build jobs will start from the exact same image containing
the same outdated packages anyway.

Export HOMEBREW_NO_INSTALL_CLEANUP=1 to disable this auto cleanup feature,
shaving off about 20-30s from the time needed to install dependencies
in our macOS build jobs on Travis CI.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoci: don't update Homebrew
SZEDER Gábor [Wed, 3 Jul 2019 10:47:47 +0000 (12:47 +0200)] 
ci: don't update Homebrew

Lately our GCC macOS build job on Travis CI has been erroring out
while installing dependencies with:

  +brew link gcc@8
  Error: No such keg: /usr/local/Cellar/gcc@8
  The command "ci/install-dependencies.sh" failed and exited with 1 during .

Now, while gcc@8 is still pre-installed (but not linked) and would be
perfectly usable in the Travis CI macOS image we use [1], it's at
version 8.2.  However, when installing dependencies we first
explicitly run 'brew update', which spends over two minutes to update
itself and information about the available packages, and it learns
about GCC 8.3.  After that point gcc@8 exclusively refers to v8.3,
and, unfortunately, 'brew' is just too dumb to be able to do anything
with the still installed 8.2 package, and the subsequent 'brew link
gcc@8' fails.  (Even 'brew uninstall gcc@8' fails with the same
error!)

Don't run 'brew update' to keep the already installed GCC 8.2 'brew
link'-able.  Note that in addition we have to 'export
HOMEBREW_NO_AUTO_UPDATE=1' first, because 'brew' is so very helpful
that it would implicitly run update for us on the next 'brew install
<pkg>' otherwise.

Disabling 'brew update' has additional benefits:

  - It shaves off 2-3mins from the ~4mins currently spent on
    installing dependencies, and the macOS build jobs have always been
    prone to exceeding the time limit on Travis CI.

  - Our builds won't suddenly break because of the occasional Homebrew
    breakages [2].

The drawback is that we'll be stuck with slightly older versions of
the packages that we install via Homebrew (Git-LFS 2.5.2 and Perforce
2018.1; they are currently at 2.7.2 and 2019.1, respectively).  We
might want to reconsider this decision as time goes on and/or switch
to a more recent macOS image as they become available.

[1] 2000ac9fbf (travis-ci: switch to Xcode 10.1 macOS image,
    2019-01-17)

[2] See e.g. a1ccaedd62 (travis-ci: make the OSX build jobs' 'brew
    update' more quiet, 2019-02-02) or

    https://public-inbox.org/git/20180907032002.23366-1-szeder.dev@gmail.com/T/#+u

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agol10n: localizable upload progress messages
Dimitriy Ryazantcev [Tue, 2 Jul 2019 18:22:48 +0000 (21:22 +0300)] 
l10n: localizable upload progress messages

Currenly the data rate in throughput_string(...) method is
output by simple strbuf_humanise_bytes(...) call and '/s' append.
But for proper translation of such string the translator needs
full context.

Add strbuf_humanise_rate(...) method to properly print out
localizable version of data rate ('3.5 MiB/s' etc) with full context.

Strings with the units in strbuf_humanise_bytes(...) are marked
for translation.

Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agodocs: git-clone: list short form of options first
Quentin Nerden [Tue, 2 Jul 2019 14:37:41 +0000 (07:37 -0700)] 
docs: git-clone: list short form of options first

List the short form of options (e.g.: '-l') before the long form (e.g.
'--local').
This is to match the doc of git-add, git-commit, git-clean, git-branch...

Signed-off-by: Quentin Nerden <quentin.nerden@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agodocs: git-clone: refer to long form of options
Quentin Nerden [Tue, 2 Jul 2019 14:37:40 +0000 (07:37 -0700)] 
docs: git-clone: refer to long form of options

To make the doc of git-clone easier to read,
refer to the long form of the options
(it is easier to guess what '--verbose' is doing than '-v').

Signed-off-by: Quentin Nerden <quentin.nerden@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoDocument that 'git -C ""' works and doesn't change directory
SZEDER Gábor [Sat, 29 Jun 2019 08:24:57 +0000 (10:24 +0200)] 
Document that 'git -C ""' works and doesn't change directory

It's been behaving so since 6a536e2076 (git: treat "git -C '<path>'"
as a no-op when <path> is empty, 2015-03-06).

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