gitweb.git
git-svn.txt: drop escaping '\' that ends up being renderedMartin Ågren Wed, 6 Mar 2019 06:30:17 +0000 (07:30 +0100)

git-svn.txt: drop escaping '\' that ends up being rendered

Escaping two *'s as "\*\*" apparently makes Asciidoctor render the
second backslash literally, so we end up with "*\*". So let's not escape
that second asterisk. The result is now "**" as intended, both in
AsciiDoc and Asciidoctor.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git.txt: remove empty line before list continuationMartin Ågren Wed, 6 Mar 2019 06:30:16 +0000 (07:30 +0100)

git.txt: remove empty line before list continuation

This patch is a no-op for Asciidoctor, but makes AsciiDoc render this as
intended.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config/fsck.txt: avoid starting line with dashMartin Ågren Wed, 6 Mar 2019 06:30:15 +0000 (07:30 +0100)

config/fsck.txt: avoid starting line with dash

This dash at the start of the line causes Asciidoctor to trip on the
list continuations that follow and to render the pluses literally.
Rewrap a little to put the dash elsewhere.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config/diff.txt: drop spurious backtickMartin Ågren Wed, 6 Mar 2019 06:30:14 +0000 (07:30 +0100)

config/diff.txt: drop spurious backtick

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitattributes.txt: fix typoYash Bhatambare Wed, 6 Mar 2019 05:23:10 +0000 (05:23 +0000)

gitattributes.txt: fix typo

`UTF-16-LE-BOM` to `UTF-16LE-BOM`.

this closes https://github.com/git-for-windows/git/issues/2095

Signed-off-by: Yash Bhatambare <ybhatambare@gmail.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --submoduleNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:26 +0000 (19:30 +0700)

diff-parseopt: convert --submodule

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --ignore-submodulesNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:25 +0000 (19:30 +0700)

diff-parseopt: convert --ignore-submodules

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --textconvNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:24 +0000 (19:30 +0700)

diff-parseopt: convert --textconv

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --ext-diffNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:23 +0000 (19:30 +0700)

diff-parseopt: convert --ext-diff

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --quietNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:22 +0000 (19:30 +0700)

diff-parseopt: convert --quiet

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --exit-codeNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:21 +0000 (19:30 +0700)

diff-parseopt: convert --exit-code

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --color-wordsNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:20 +0000 (19:30 +0700)

diff-parseopt: convert --color-words

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --word-diff-regexNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:19 +0000 (19:30 +0700)

diff-parseopt: convert --word-diff-regex

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --word-diffNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:18 +0000 (19:30 +0700)

diff-parseopt: convert --word-diff

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --[no-]colorNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:17 +0000 (19:30 +0700)

diff-parseopt: convert --[no-]color

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --[no-]followNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:16 +0000 (19:30 +0700)

diff-parseopt: convert --[no-]follow

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert -RNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:15 +0000 (19:30 +0700)

diff-parseopt: convert -R

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert -a|--textNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:14 +0000 (19:30 +0700)

diff-parseopt: convert -a|--text

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --full-indexNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:13 +0000 (19:30 +0700)

diff-parseopt: convert --full-index

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --binaryNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:12 +0000 (19:30 +0700)

diff-parseopt: convert --binary

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --anchoredNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:11 +0000 (19:30 +0700)

diff-parseopt: convert --anchored

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --diff-algorithmNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:10 +0000 (19:30 +0700)

diff-parseopt: convert --diff-algorithm

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --histogramNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:09 +0000 (19:30 +0700)

diff-parseopt: convert --histogram

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --patienceNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:08 +0000 (19:30 +0700)

diff-parseopt: convert --patience

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --[no-]indent-heuristicNguyễn Thái Ngọc Duy Tue, 5 Mar 2019 12:30:07 +0000 (19:30 +0700)

diff-parseopt: convert --[no-]indent-heuristic

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

compat/bswap: add include header guardsJeff King Wed, 6 Mar 2019 19:05:10 +0000 (14:05 -0500)

compat/bswap: add include header guards

Our compat/bswap.h lacks the usual preprocessor guards against multiple
inclusion. This usually isn't an issue since it only gets included from
git-compat-util.h, which has its own guards. But it would produce
redeclaration errors if any file included it separately.

Our hdr-check target would complain about this, except that it currently
skips items in compat/ entirely.

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

Makefile: fix 'hdr-check' when GCRYPT not installedRamsay Jones Wed, 6 Mar 2019 00:11:13 +0000 (00:11 +0000)

Makefile: fix 'hdr-check' when GCRYPT not installed

If the GCRYPT_SHA256 build variable is not set, then the 'hdr-check'
target complains about the missing <gcrypt.h> header file. Add the
'sha256/gcrypt.h' header file to the exception list, if the build
variable is not defined. While here, replace the 'xdiff%' filter
pattern with 'xdiff/%' (and similarly for the compat pattern) since
the original pattern inadvertently excluded the 'xdiff-interface.h'
header.

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

git-reset.txt: clarify documentationDenton Liu Tue, 5 Mar 2019 23:34:26 +0000 (15:34 -0800)

git-reset.txt: clarify documentation

git-reset.txt contained a missing "a" and "wrt". Fix the missing "a" for
correctness and replace "wrt" with "with respect to" so that the
documentation is not so cryptic.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Doc: fix misleading asciidoc formatingJean-Noël Avila Tue, 5 Mar 2019 21:44:23 +0000 (22:44 +0100)

Doc: fix misleading asciidoc formating

The end of sentence in "x." at the begining of a line misleads
ascidoctor into interpreting it as the start of numbered sub-list.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fsck: always compute USED flags for unreachable objectsJeff King Tue, 5 Mar 2019 04:47:39 +0000 (23:47 -0500)

fsck: always compute USED flags for unreachable objects

The --connectivity-only option avoids opening every object, and instead
just marks reachable objects with a flag and compares this to the set
of all objects. This strategy is discussed in more detail in 3e3f8bd608
(fsck: prepare dummy objects for --connectivity-check, 2017-01-17).

This means that we report _every_ unreachable object as dangling.
Whereas in a full fsck, we'd have actually opened and parsed each of
those unreachable objects, marking their child objects with the USED
flag, to mean "this was mentioned by another object". And thus we can
report only the tip of an unreachable segment of the object graph as
dangling.

You can see this difference with a trivial example:

tree=$(git hash-object -t tree -w /dev/null)
one=$(echo one | git commit-tree $tree)
two=$(echo two | git commit-tree -p $one $tree)

Running `git fsck` will report only $two as dangling, but with
--connectivity-only, both commits (and the tree) are reported. Likewise,
using --lost-found would write all three objects.

We can make --connectivity-only work like the normal case by taking a
separate pass over the unreachable objects, parsing them and marking
objects they refer to as USED. That still avoids parsing any blobs,
though we do pay the cost to access any unreachable commits and trees
(which may or may not be noticeable, depending on how many you have).

If neither --dangling nor --lost-found is in effect, then we can skip
this step entirely, just like we do now. That makes "--connectivity-only
--no-dangling" just as fast as the current "--connectivity-only". I.e.,
we do the correct thing always, but you can still tweak the options to
make it faster if you don't care about dangling objects.

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

doc/fsck: clarify --connectivity-only behaviorJeff King Tue, 5 Mar 2019 04:46:38 +0000 (23:46 -0500)

doc/fsck: clarify --connectivity-only behavior

On reading this again, there are two things that were not immediately
clear to me:

- we do still check links to blobs, even though we don't open the
blobs themselves

- we do not do the normal fsck checks, even for non-blob objects we do
open

Let's reword it to make these points a little more clear.

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

rev-list: allow cached objects in existence checkJeff King Mon, 4 Mar 2019 17:40:54 +0000 (12:40 -0500)

rev-list: allow cached objects in existence check

This fixes a regression in 7c0fe330d5 (rev-list: handle missing tree
objects properly, 2018-10-05) where rev-list will now complain about the
empty tree when it doesn't physically exist on disk.

Before that commit, we relied on the traversal code in list-objects.c to
walk through the trees. Since it uses parse_tree(), we'd do a normal
object lookup that includes looking in the set of "cached" objects
(which is where our magic internal empty-tree kicks in).

After that commit, we instead tell list-objects.c not to die on any
missing trees, and we check them ourselves using has_object_file(). But
that function uses OBJECT_INFO_SKIP_CACHED, which means we won't use our
internal empty tree.

This normally wouldn't come up. For most operations, Git will try to
write out the empty tree object as it would any other object. And
pack-objects in a push or fetch will send the empty tree (even if it's
virtual on the sending side). However, there are cases where this can
matter. One I found in the wild:

1. The root tree of a commit became empty by deleting all files,
without using an index. In this case it was done using libgit2's
tree builder API, but as the included test shows, it can easily be
done with regular git using hash-object.

The resulting repo works OK, as we'd avoid walking over our own
reachable commits for a connectivity check.

2. Cloning with --reference pointing to the repository from (1) can
trigger the problem, because we tell the other side we already have
that commit (and hence the empty tree), but then walk over it
during the connectivity check (where we complain about it missing).

Arguably the workflow in step (1) should be more careful about writing
the empty tree object if we're referencing it. But this workflow did
work prior to 7c0fe330d5, so let's restore it.

This patch makes the minimal fix, which is to swap out a direct call to
oid_object_info_extended(), minus the SKIP_CACHED flag, instead of
calling has_object_file(). This is all that has_object_file() is doing
under the hood. And there's little danger of unrelated fallout from
other unexpected "cached" objects, since there's only one call site that
ends such a cached object, and it's in git-blame.

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

Makefile: use `git ls-files` to list header files,... Johannes Schindelin Mon, 4 Mar 2019 13:47:06 +0000 (05:47 -0800)

Makefile: use `git ls-files` to list header files, if possible

In d85b0dff72 (Makefile: use `find` to determine static header
dependencies, 2014-08-25), we switched from a static list of header
files to a dynamically-generated one, asking `find` to enumerate them.

Back in those days, we did not use `$(LIB_H)` by default, and many a
`make` implementation seems smart enough not to run that `find` command
in that case, so it was deemed okay to run `find` for special targets
requiring this macro.

However, as of ebb7baf02f (Makefile: add a hdr-check target,
2018-09-19), $(LIB_H) is part of a global rule and therefore must be
expanded. Meaning: this `find` command has to be run upon every
`make` invocation. In the presence of many a worktree, this can tax the
developers' patience quite a bit.

Even in the absence of worktrees or other untracked files and
directories, the cost of I/O to generate that list of header files is
simply a lot larger than a simple `git ls-files` call.

Therefore, just like in 335339758c (Makefile: ask "ls-files" to list
source files if available, 2011-10-18), we now prefer to use `git
ls-files` to enumerate the header files to enumerating them via `find`,
falling back to the latter if the former failed (which would be the case
e.g. in a worktree that was extracted from a source .tar file rather
than from a clone of Git's sources).

This has one notable consequence: we no longer include `command-list.h`
in `LIB_H`, as it is a generated file, not a tracked one, but that is
easily worked around. Of the three sites that use `LIB_H`, two
(`LOCALIZED_C` and `CHK_HDRS`) already handle generated headers
separately. In the third, the computed-dependency fallback, we can just
add in a reference to $(GENERATED_H).

Likewise, we no longer include not-yet-tracked header files in `LIB_H`.

Given the speed improvements, these consequences seem a comparably small
price to pay.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge tag 'l10n-2.21.0-rnd2.1' of git://github.com... Junio C Hamano Tue, 5 Mar 2019 12:53:10 +0000 (21:53 +0900)

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

L10n for Git 2.21.0 round 2.1

* tag 'l10n-2.21.0-rnd2.1' of git://github.com/git-l10n/git-po:
l10n: Fixes to Catalan translation
l10n: Updated Vietnamese translation for v2.21 rd2
l10n: fr.po remove obsolete entries

fetch: ignore SIGPIPE during network operationJeff King Sun, 3 Mar 2019 16:58:43 +0000 (11:58 -0500)

fetch: ignore SIGPIPE during network operation

The default SIGPIPE behavior can be useful for a command that generates
a lot of output: if the receiver of our output goes away, we'll be
notified asynchronously to stop generating it (typically by killing the
program).

But for a command like fetch, which is primarily concerned with
receiving data and writing it to disk, an unexpected SIGPIPE can be
awkward. We're already checking the return value of all of our write()
calls, and dying due to the signal takes away our chance to gracefully
handle the error.

On Linux, we wouldn't generally see SIGPIPE at all during fetch. If the
other side of the network connection hangs up, we'll see ECONNRESET. But
on OS X, we get a SIGPIPE, and the process is killed. This causes t5570
to racily fail, as we sometimes die by signal (instead of the expected
die() call) when the server side hangs up.

Let's ignore SIGPIPE during the network portion of the fetch, which will
cause our write() to return EPIPE, giving us consistent behavior across
platforms.

This fixes the test flakiness, but note that it stops short of fixing
the larger problem. The server side hit a fatal error, sent us an "ERR"
packet, and then hung up. We notice the failure because we're trying to
write to a closed socket. But by dying immediately, we never actually
read the ERR packet and report its content to the user. This is a (racy)
problem on all platforms. So this patch lays the groundwork from which
that problem might be fixed consistently, but it doesn't actually fix
it.

Note the placement of the SIGPIPE handling. The absolute minimal change
would be to ignore SIGPIPE only when we're writing. But twiddling the
signal handler for each write call is inefficient and maintenance
burden. On the opposite end of the spectrum, we could simply declare
that fetch does not need SIGPIPE handling, since it doesn't generate a
lot of output, and we could just ignore it at the start of cmd_fetch().

This patch takes a middle ground. It ignores SIGPIPE during the network
operation (which is admittedly most of the program, since the actual
network operations are all done under the hood by the transport code).
So it's still pretty coarse.

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

fetch: avoid calling write_or_die()Jeff King Tue, 5 Mar 2019 04:11:39 +0000 (23:11 -0500)

fetch: avoid calling write_or_die()

The write_or_die() function has one quirk that a caller might not
expect: when it sees EPIPE from the write() call, it translates that
into a death by SIGPIPE. This doesn't change the overall behavior (the
program exits either way), but it does potentially confuse test scripts
looking for a non-signal exit code.

Let's switch away from using write_or_die() in a few code paths, which
will give us more consistent exit codes. It also gives us the
opportunity to write more descriptive error messages, since we have
context that write_or_die() does not.

Note that this won't do much by itself, since we'd typically be killed
by SIGPIPE before write_or_die() even gets a chance to do its thing.
That will be addressed in the next patch.

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

built-in rebase: set ORIG_HEAD just once, before the... Johannes Schindelin Sun, 3 Mar 2019 17:11:55 +0000 (09:11 -0800)

built-in rebase: set ORIG_HEAD just once, before the rebase

Technically, the scripted version set ORIG_HEAD only in two spots (which
really could have been one, because it called `git checkout $onto^0` to
start the rebase and also if it could take a shortcut, and in both cases
it called `git update-ref $orig_head`).

Practically, it *implicitly* reset ORIG_HEAD whenever `git reset --hard`
was called.

However, what we really want is that it is set exactly once, at the
beginning of the rebase.

So let's do that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

built-in rebase: demonstrate that ORIG_HEAD is not... Johannes Schindelin Sun, 3 Mar 2019 17:11:54 +0000 (09:11 -0800)

built-in rebase: demonstrate that ORIG_HEAD is not set correctly

The ORIG_HEAD pseudo ref is supposed to refer to the original,
pre-rebase state after a successful rebase. Let's add a regression test
to prove that this regressed: With GIT_TEST_REBASE_USE_BUILTIN=false,
this test case passes, with GIT_TEST_REBASE_USE_BUILTIN=true (or unset),
it fails.

Reported by Nazri Ramliy.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

built-in rebase: use the correct reflog when switching... Johannes Schindelin Sun, 3 Mar 2019 17:11:54 +0000 (09:11 -0800)

built-in rebase: use the correct reflog when switching branches

By mistake, we used the reflog intended for ORIG_HEAD.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

built-in rebase: no need to check out `onto` twiceJohannes Schindelin Sun, 3 Mar 2019 17:11:53 +0000 (09:11 -0800)

built-in rebase: no need to check out `onto` twice

In the case that the rebase boils down to a fast-forward, the built-in
rebase reset the working tree twice: once to start the rebase at `onto`,
then realizing that the original (pre-rebase) HEAD was an ancestor and
we basically already fast-forwarded to the post-rebase HEAD,
`reset_head()` was called to update the original ref and to point HEAD
back to it.

That second `reset_head()` call does not need to touch the working tree,
though, as it does not change the actual tip commit (and therefore the
working tree should stay unchanged anyway): only the ref needs to be
updated (because the rebase detached the HEAD, and we want to go back to
the branch on which the rebase was started).

But that second `reset_head()` was called without the flag to leave the
working tree alone (the reason: when that call was introduced, that flag
was not yet even thought of). Let's avoid that unnecessary work by
passing that flag.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: introduce --stress-jobs=<N>Johannes Schindelin Sun, 3 Mar 2019 14:44:55 +0000 (06:44 -0800)

tests: introduce --stress-jobs=<N>

The --stress option currently accepts an argument, but it is confusing
to at least this user that the argument does not define the maximal
number of stress iterations, but instead the number of jobs to run in
parallel per stress iteration.

Let's introduce a separate option for that, whose name makes it more
obvious what it is about, and let --stress=<N> error out with a helpful
suggestion about the two options tha could possibly have been meant.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: let --stress-limit=<N> imply --stressJohannes Schindelin Sun, 3 Mar 2019 14:44:54 +0000 (06:44 -0800)

tests: let --stress-limit=<N> imply --stress

It does not make much sense that running a test with
--stress-limit=<N> seemingly ignores that option because it does not
stress test at all.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-curl: use post_rpc() for protocol v2 alsoJonathan Tan Thu, 21 Feb 2019 20:24:41 +0000 (12:24 -0800)

remote-curl: use post_rpc() for protocol v2 also

When transmitting and receiving POSTs for protocol v0 and v1,
remote-curl uses post_rpc() (and associated functions), but when doing
the same for protocol v2, it uses a separate set of functions
(proxy_rpc() and others). Besides duplication of code, this has caused
at least one bug: the auth retry mechanism that was implemented in v0/v1
was not implemented in v2.

To fix this issue and avoid it in the future, make remote-curl also use
post_rpc() when handling protocol v2. Because line lengths are written
to the HTTP request in protocol v2 (unlike in protocol v0/v1), this
necessitates changes in post_rpc() and some of the functions it uses;
perform these changes too.

A test has been included to ensure that the code for both the unchunked
and chunked variants of the HTTP request is exercised.

Note: stateless_connect() has been updated to use the lower-level packet
reading functions instead of struct packet_reader. The low-level control
is necessary here because we cannot change the destination buffer of
struct packet_reader while it is being used; struct packet_buffer has a
peeking mechanism which relies on the destination buffer being present
in between a peek and a read.

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

docs/git-gc: fix typo "--prune=all" to "--prune=now"Robert P. J. Day Sat, 2 Mar 2019 08:51:52 +0000 (03:51 -0500)

docs/git-gc: fix typo "--prune=all" to "--prune=now"

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: Fixes to Catalan translationJordi Mas Sat, 2 Mar 2019 18:12:58 +0000 (19:12 +0100)

l10n: Fixes to Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>

l10n: Updated Vietnamese translation for v2.21 rd2Tran Ngoc Quan Tue, 26 Feb 2019 07:50:59 +0000 (14:50 +0700)

l10n: Updated Vietnamese translation for v2.21 rd2

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>

setup: fix memory leaks with `struct repository_format`Martin Ågren Thu, 28 Feb 2019 20:36:28 +0000 (21:36 +0100)

setup: fix memory leaks with `struct repository_format`

After we set up a `struct repository_format`, it owns various pieces of
allocated memory. We then either use those members, because we decide we
want to use the "candidate" repository format, or we discard the
candidate / scratch space. In the first case, we transfer ownership of
the memory to a few global variables. In the latter case, we just
silently drop the struct and end up leaking memory.

Introduce an initialization macro `REPOSITORY_FORMAT_INIT` and a
function `clear_repository_format()`, to be used on each side of
`read_repository_format()`. To have a clear and simple memory ownership,
let all users of `struct repository_format` duplicate the strings that
they take from it, rather than stealing the pointers.

Call `clear_...()` at the start of `read_...()` instead of just zeroing
the struct, since we sometimes enter the function multiple times. Thus,
it is important to initialize the struct before calling `read_...()`, so
document that. It's also important because we might not even call
`read_...()` before we call `clear_...()`, see, e.g., builtin/init-db.c.

Teach `read_...()` to clear the struct on error, so that it is reset to
a safe state, and document this. (In `setup_git_directory_gently()`, we
look at `repo_fmt.hash_algo` even if `repo_fmt.version` is -1, which we
weren't actually supposed to do per the API. After this commit, that's
ok.)

We inherit the existing code's combining "error" and "no version found".
Both are signalled through `version == -1` and now both cause us to
clear any partial configuration we have picked up. For "extensions.*",
that's fine, since they require a positive version number. For
"core.bare" and "core.worktree", we're already verifying that we have a
non-negative version number before using them.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis: remove the hack to build the Windows job on... Johannes Schindelin Thu, 28 Feb 2019 19:33:52 +0000 (11:33 -0800)

travis: remove the hack to build the Windows job on Azure Pipelines

Since Travis did not support Windows (and now only supports very limited
Windows jobs, too limited for our use, the test suite would time out
*all* the time), we added a hack where a Travis job would trigger an
Azure Pipeline (which back then was still called VSTS Build), wait for
it to finish (or time out), and download the log (if available).

Needless to say that it was a horrible hack, necessitated by a bad
situation.

Nowadays, however, we have Azure Pipelines support, and do not need that
hack anymore. So let's retire it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase docs: fix "gitlink" typoKyle Meyer Thu, 28 Feb 2019 02:43:15 +0000 (21:43 -0500)

rebase docs: fix "gitlink" typo

Change it to "linkgit" so that the reference is properly rendered.

Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: make diff-tree output prettierJeff King Fri, 22 Feb 2019 06:23:28 +0000 (01:23 -0500)

bisect: make diff-tree output prettier

After completing a bisection, we print out the commit we found using an
internal version of diff-tree. The result is aesthetically lacking:

- it shows a raw diff, which is generally less informative for human
readers than "--stat --summary" (which we already decided was nice
for humans in format-patch's output).

- by not abbreviating hashes, the result is likely to wrap on most
people's terminals

- we don't use "-r", so if the commit touched files in a directory,
you only get to see the top-level directory mentioned

- we don't specify "--cc" or similar, so merges print nothing (not
even the commit message!)

Even though bisect might be driven by scripts, there's no reason to
consider this part of the output as machine-readable (if anything, the
initial "$hash is the first bad commit" might be parsed, but we won't
touch that here). Let's make it prettier and more informative for a
human reading the output.

While we're tweaking the options, let's also switch to using the diff
"ui" config. If we're accepting that this is human-readable output, then
we should respect the user's options for how to display it.

Note that we have to touch a few tests in t6030. These check bisection
in a corrupted repository (it's missing a subtree). They didn't fail
with the previous code, because it didn't actually recurse far enough in
the diff to find the broken tree. But now we'll see the corruption and
complain.

Adjusting the tests to expect the die() is the best fix. We still
confirm that we're able to bisect within the broken repo. And we'll
still print "$hash is the first bad commit" as usual before dying;
showing that is a reasonable outcome in a corrupt repository (and was
what might happen already, if the root tree was corrupt).

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

bisect: fix internal diff-tree config loadingJeff King Fri, 22 Feb 2019 06:21:33 +0000 (01:21 -0500)

bisect: fix internal diff-tree config loading

When we run our internal diff-tree to show the bisected commit, we call
init_revisions(), then load config, then setup_revisions(). But that
order is wrong: we copy the configured defaults into the rev_info struct
during the init_revisions step, so our config load wasn't actually doing
anything.

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

bisect: use string arguments to feed internal diff... Jeff King Fri, 22 Feb 2019 06:20:37 +0000 (01:20 -0500)

bisect: use string arguments to feed internal diff-tree

Commit e22278c0a0 (bisect: display first bad commit without forking a
new process, 2009-05-28) converted our external call to diff-tree to
an internal use of the log_tree_commit(). But rather than individually
setting options in the rev_info struct (and explaining in comments how
they map to command-line options), we can just pass the command-line
options to setup_revisions().

This is shorter, easier to change, and less likely to break if
revision.c internals change.

Note that we unconditionally set the output format to "raw". The
conditional in the original code didn't actually do anything useful,
since nobody had an opportunity to set the format to anything.

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

l10n: fr.po remove obsolete entriesJean-Noël Avila Mon, 25 Feb 2019 21:11:15 +0000 (22:11 +0100)

l10n: fr.po remove obsolete entries

On NetBSD, the version of msgfmt is still 0.14.4. There's no hope for
an upgrade due to some GPLv3 allergy of NetBSD's. This version chokes
on heavily decorated commented entries in po files. It's safer to get
rid of all these obsolete entries.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>

Git 2.21 v2.21.0Junio C Hamano Sun, 24 Feb 2019 15:55:19 +0000 (07:55 -0800)

Git 2.21

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

Makefile: allow for combining DEVELOPER=1 and CFLAGS... Ævar Arnfjörð Bjarmason Fri, 22 Feb 2019 14:41:27 +0000 (15:41 +0100)

Makefile: allow for combining DEVELOPER=1 and CFLAGS="..."

Ever since the DEVELOPER=1 facility introduced there's been no way to
have custom CFLAGS (e.g. CFLAGS="-O0 -g -ggdb3") while still
benefiting from the set of warnings and assertions DEVELOPER=1
enables.

This is because the semantics of variables in the Makefile are such
that the user setting CFLAGS overrides anything we set, including what
we're doing in config.mak.dev[1].

So let's introduce a "DEVELOPER_CFLAGS" variable in config.mak.dev and
add it to ALL_CFLAGS. Before this the ALL_CFLAGS variable
would (basically, there's some nuance we won't go into) be set to:

$(CPPFLAGS) [$(CFLAGS) *or* $(CFLAGS) in config.mak.dev] $(BASIC_CFLAGS) $(EXTRA_CPPFLAGS)

But will now be:

$(DEVELOPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) $(BASIC_CFLAGS) $(EXTRA_CPPFLAGS)

The reason for putting DEVELOPER_CFLAGS first is to allow for
selectively overriding something DEVELOPER=1 brings in. On both GCC
and Clang later settings override earlier ones. E.g. "-Wextra
-Wno-extra" will enable no "extra" warnings, but not if those two
arguments are reversed.

Examples of things that weren't possible before, but are now:

# Use -O0 instead of -O2 for less painful debuggng
DEVELOPER=1 CFLAGS="-O0 -g"
# DEVELOPER=1 plus -Wextra, but disable some of the warnings
DEVELOPER=1 DEVOPTS="no-error extra-all" CFLAGS="-O0 -g -Wno-unused-parameter"

The reason for the patches leading up to this one re-arranged the
various *FLAGS assignments and includes is just for readability. The
Makefile supports assignments out of order, e.g.:

$ cat Makefile
X = $(A) $(B) $(C)
A = A
B = B
include c.mak
all:
@echo $(X)
$ cat c.mak
C=C
$ make
A B C

So we could have gotten away with the much smaller change of changing
"CFLAGS" in config.mak.dev to "DEVELOPER_CFLAGS" and adding that to
ALL_CFLAGS earlier in the Makefile "before" the config.mak.*
includes. But I think it's more readable to use variables "after"
they're included.

1. https://www.gnu.org/software/make/manual/html_node/Overriding.html

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: move the setting of *FLAGS closer to "include"Ævar Arnfjörð Bjarmason Fri, 22 Feb 2019 14:41:26 +0000 (15:41 +0100)

Makefile: move the setting of *FLAGS closer to "include"

Move the setting of variables like CFLAGS down past settings like
"prefix" and default programs like "TAR" to just before we do the
include from "config.mak.*".

There's no functional changes here yet, but move note that
"ALL_CFLAGS" and "ALL_LDFLAGS" are moved below the include. A
follow-up change will tweak those depending on a variable set in
config.mak.dev.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: Move *_LIBS assignment into its own sectionÆvar Arnfjörð Bjarmason Fri, 22 Feb 2019 14:41:25 +0000 (15:41 +0100)

Makefile: Move *_LIBS assignment into its own section

Now the only other non-program assignment in the previous list is
PTHREAD_CFLAGS, which'll be moved elsewhere in a follow-up change.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: add/remove comments at top and tweak whitespaceÆvar Arnfjörð Bjarmason Fri, 22 Feb 2019 14:41:24 +0000 (15:41 +0100)

Makefile: add/remove comments at top and tweak whitespace

The top of the Makfile is mostly separated into logical steps like set
default configuration, set programs etc., but there's some deviation
from that.

Let's add mostly comments where they're missing, remove those that
don't add anything. The whitespace tweaking makes subsequent patches
smaller.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: move "strip" assignment down from flagsÆvar Arnfjörð Bjarmason Fri, 22 Feb 2019 14:41:23 +0000 (15:41 +0100)

Makefile: move "strip" assignment down from flags

Move the assignment of the "STRIP" variable down to where we're
setting variables with the names of other programs.

For consistency with those use "=" for the assignment instead of
"?=". I can't imagine why this would need to be different than the
rest, and 4dc00021f7 ("Makefile: add 'strip' target", 2006-01-12)
which added it doesn't provide an explanation.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: remove an out-of-date commentÆvar Arnfjörð Bjarmason Fri, 22 Feb 2019 14:41:22 +0000 (15:41 +0100)

Makefile: remove an out-of-date comment

Remove a comment referring to a caveat that hasn't been applicable
since 18b0fc1ce1 ("Git.pm: Kill Git.xs for now", 2006-09-23).

At the time of 8d7f586f13 ("Git.pm: Support for perl/ being built by a
different compiler", 2006-06-25) some of the code in perl would be
built by a C compiler, but support for that went away a few months
later in 18b0fc1ce1 discussed above.

Since my 20d2a30f8f ("Makefile: replace perl/Makefile.PL with simple
make rules", 2017-12-10) the perl/ directory doesn't even have its own
build process.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'yn/checkout-doc-fix'Junio C Hamano Sun, 24 Feb 2019 15:18:00 +0000 (07:18 -0800)

Merge branch 'yn/checkout-doc-fix'

Doc fix.

* yn/checkout-doc-fix:
checkout doc: fix an unmatched double-quote pair

diff: reuse diff setup for --no-index caseJeff King Sat, 16 Feb 2019 06:57:56 +0000 (01:57 -0500)

diff: reuse diff setup for --no-index case

When "--no-index" is in effect (or implied by the arguments), git-diff
jumps early to a special code path to perform that diff. This means we
miss out on some settings like enabling --ext-diff and --textconv by
default.

Let's jump to the no-index path _after_ we've done more setup on
rev.diffopt. Since some of the options don't affect us (e.g., items
related to the index), let's re-order the setup into two blocks (see the
in-code comments).

Note that we also need to stop re-initializing the diffopt struct in
diff_no_index(). This should not be necessary, as it will already have
been initialized by cmd_diff() (and there are no other callers). That in
turn lets us drop the "repository" argument from diff_no_index (which
never made much sense, since the whole point is that you don't need a
repository).

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

Merge tag 'l10n-2.21.0-rnd2' of git://github.com/git... Junio C Hamano Sun, 24 Feb 2019 15:03:39 +0000 (07:03 -0800)

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

l10n-2.21.0-rnd2

* tag 'l10n-2.21.0-rnd2' of git://github.com/git-l10n/git-po:
l10n: bg.po: Updated Bulgarian translation (4363t)
l10n: update German translation
l10n: zh_CN: Revision for git v2.21.0 l10n
l10n: zh_CN: for git v2.21.0 l10n round 1~2
l10n: bg.po: correct typo
l10n: Update Swedish translation (4363t0f0u)
l10n: de.po: fix grammar in message for tag.c
l10n: de.po: fix a message for index-pack.c
l10n: de.po: consistent translation of 'root commit'
l10n: it: update the Italian translation
l10n: es: 2.21.0 round 2
l10n: el: add Greek l10n team and essential translations
l10n: fr.po v2.21.0 rnd 2
l10n: fr.po Fix some typos from round3
l10n: fr.po Fix some typos
l10n: Fixes to Catalan translation
l10n: git.pot: v2.21.0 round 2 (3 new, 3 removed)
l10n: git.pot: v2.21.0 round 1 (214 new, 38 removed)
l10n: zh_CN: fix typo of submodule init message
l10n: Update Catalan translation

README: adjust for final Azure Pipeline IDJohannes Schindelin Sat, 23 Feb 2019 14:49:23 +0000 (06:49 -0800)

README: adjust for final Azure Pipeline ID

During the six months of development of the Azure Pipelines support, the
patches went through quite a few iterations of changes, and to test
those iterations, a temporary build definition was used.

In the meantime, Azure Pipelines support made it to `master`, and we now
have a regular Azure Pipeline, installed via the common GitHub App
workflow. This new pipeline has a different name (git.git instead of
test-git.git), and a new ID (11 instead of 2).

Let's adjust the badge in our README to reflect that final shape of the
Azure Pipeline.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

checkout doc: fix an unmatched double-quote pairYoichi Nakayama Sat, 23 Feb 2019 06:33:40 +0000 (15:33 +0900)

checkout doc: fix an unmatched double-quote pair

Signed-off-by: Yoichi Nakayama <yoichi.nakayama@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: bg.po: Updated Bulgarian translation (4363t)Alexander Shopov Sat, 23 Feb 2019 16:39:07 +0000 (18:39 +0200)

l10n: bg.po: Updated Bulgarian translation (4363t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>

Merge branch 'ab/bsd-fixes'Junio C Hamano Sat, 23 Feb 2019 05:20:19 +0000 (21:20 -0800)

Merge branch 'ab/bsd-fixes'

Test portability fix.

* ab/bsd-fixes:
commit-graph tests: fix unportable "dd" invocation
tests: fix unportable "\?" and "\+" regex syntax

Merge branch 'ab/workaround-dash-bug-in-test'Junio C Hamano Sat, 23 Feb 2019 05:20:19 +0000 (21:20 -0800)

Merge branch 'ab/workaround-dash-bug-in-test'

* ab/workaround-dash-bug-in-test:
tests: avoid syntax triggering old dash bug

trace2: add for_each macros to clang-formatJeff Hostetler Fri, 22 Feb 2019 22:25:11 +0000 (14:25 -0800)

trace2: add for_each macros to clang-format

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.shJeff Hostetler Fri, 22 Feb 2019 22:25:10 +0000 (14:25 -0800)

trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh

Create unit tests for Trace2.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2:data: add subverb for rebaseJeff Hostetler Fri, 22 Feb 2019 22:25:10 +0000 (14:25 -0800)

trace2:data: add subverb for rebase

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2:data: add subverb to reset commandJeff Hostetler Fri, 22 Feb 2019 22:25:09 +0000 (14:25 -0800)

trace2:data: add subverb to reset command

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2:data: add subverb to checkout commandJeff Hostetler Fri, 22 Feb 2019 22:25:08 +0000 (14:25 -0800)

trace2:data: add subverb to checkout command

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2:data: pack-objects: add trace2 regionsDerrick Stolee Fri, 22 Feb 2019 22:25:07 +0000 (14:25 -0800)

trace2:data: pack-objects: add trace2 regions

When studying the performance of 'git push' we would like to know
how much time is spent at various parts of the command. One area
that could cause performance trouble is 'git pack-objects'.

Add trace2 regions around the three main actions taken in this
command:

1. Enumerate objects.
2. Prepare pack.
3. Write pack-file.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2:data: add trace2 instrumentation to index read... Jeff Hostetler Fri, 22 Feb 2019 22:25:07 +0000 (14:25 -0800)

trace2:data: add trace2 instrumentation to index read/write

Add trace2 events to measure reading and writing the index.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2:data: add trace2 hook classificationJeff Hostetler Fri, 22 Feb 2019 22:25:06 +0000 (14:25 -0800)

trace2:data: add trace2 hook classification

Classify certain child processes as hooks.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2:data: add trace2 transport child classificationJeff Hostetler Fri, 22 Feb 2019 22:25:05 +0000 (14:25 -0800)

trace2:data: add trace2 transport child classification

Add trace2 child classification for transport processes.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2:data: add trace2 sub-process classificationJeff Hostetler Fri, 22 Feb 2019 22:25:05 +0000 (14:25 -0800)

trace2:data: add trace2 sub-process classification

Add trace2 classification for long-running processes
started in sub-process.c

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2:data: add editor/pager child classificationJeff Hostetler Fri, 22 Feb 2019 22:25:04 +0000 (14:25 -0800)

trace2:data: add editor/pager child classification

Add trace2 process classification for editor and pager
child processes.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2:data: add trace2 regions to wt-statusJeff Hostetler Fri, 22 Feb 2019 22:25:03 +0000 (14:25 -0800)

trace2:data: add trace2 regions to wt-status

Add trace2_region_enter() and trace2_region_leave() calls around the
various phases of a status scan. This gives elapsed time for each
phase in the GIT_TR2_PERF and GIT_TR2_EVENT trace target.

Also, these Trace2 calls now use s->repo rather than the_repository.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2: collect Windows-specific process informationJeff Hostetler Fri, 22 Feb 2019 22:25:02 +0000 (14:25 -0800)

trace2: collect Windows-specific process information

Add platform-specific interface to log information about the current
process.

On Windows, this interface is used to indicate whether the git process
is running under a debugger and list names of the process ancestors.

Information for other platforms is left for a future effort.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2: create new combined trace facilityJeff Hostetler Fri, 22 Feb 2019 22:25:01 +0000 (14:25 -0800)

trace2: create new combined trace facility

Create a new unified tracing facility for git. The eventual intent is to
replace the current trace_printf* and trace_performance* routines with a
unified set of git_trace2* routines.

In addition to the usual printf-style API, trace2 provides higer-level
event verbs with fixed-fields allowing structured data to be written.
This makes post-processing and analysis easier for external tools.

Trace2 defines 3 output targets. These are set using the environment
variables "GIT_TR2", "GIT_TR2_PERF", and "GIT_TR2_EVENT". These may be
set to "1" or to an absolute pathname (just like the current GIT_TRACE).

* GIT_TR2 is intended to be a replacement for GIT_TRACE and logs command
summary data.

* GIT_TR2_PERF is intended as a replacement for GIT_TRACE_PERFORMANCE.
It extends the output with columns for the command process, thread,
repo, absolute and relative elapsed times. It reports events for
child process start/stop, thread start/stop, and per-thread function
nesting.

* GIT_TR2_EVENT is a new structured format. It writes event data as a
series of JSON records.

Calls to trace2 functions log to any of the 3 output targets enabled
without the need to call different trace_printf* or trace_performance*
routines.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

trace2: Documentation/technical/api-trace2.txtJeff Hostetler Fri, 22 Feb 2019 22:25:00 +0000 (14:25 -0800)

trace2: Documentation/technical/api-trace2.txt

Created design document for Trace2 feature.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Delete check-racy.cNguyễn Thái Ngọc Duy Fri, 22 Feb 2019 11:27:57 +0000 (18:27 +0700)

Delete check-racy.c

This is git-checy-racy command, added a long time ago [1] and was never
part of the default build. Naturally after some makefile changes [2],
git-check-racy was no longer recognized as a build target. Even if it
compiles to day, it will not link after the introduction of
common-main.c [3].

Racy index has not been a problem for a long time [4]. It's time to let
this code go. I briefly consider if check-racy should be part of
test-tool. But I don't think it's worth the effort.

[1] 42f774063d (Add check program "git-check-racy" - 2006-08-15)
[2] c373991375 (Makefile: list generated object files in OBJECTS -
2010-01-26)
[3] 3f2e2297b9 (add an extra level of indirection to main() -
2016-07-01)
[4] I pretend I don't remember anything about the recent split-index's
racy problem

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-curl: refactor reading into rpc_state's bufJonathan Tan Thu, 21 Feb 2019 20:24:40 +0000 (12:24 -0800)

remote-curl: refactor reading into rpc_state's buf

Currently, whenever remote-curl reads pkt-lines from its response file
descriptor, only the payload is written to its buf, not the 4 characters
denoting the length. A future patch will require the ability to also
write those 4 characters, so in preparation for that, refactor this read
into its own function.

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

commit-graph tests: fix unportable "dd" invocationÆvar Arnfjörð Bjarmason Thu, 21 Feb 2019 19:28:49 +0000 (20:28 +0100)

commit-graph tests: fix unportable "dd" invocation

Change an unportable invocation of "dd" with count=0, that wanted to
truncate the commit-graph file. In POSIX it is unspecified what
happens when count=0 is provided[1]. The NetBSD "dd" behavior
differs from GNU (and seemingly other BSDs), which has left this test
broken since d2b86fbaa1 ("commit-graph: fix buffer read-overflow",
2019-01-15).

Copying from /dev/null would seek/truncate to seek=$zero_pos and
stop immediately after that (without being able to copy anything),
which is the right way to truncate the file.

1. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/dd.html

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'master' of https://github.com/ralfth... Jiang Xin Fri, 22 Feb 2019 14:18:12 +0000 (22:18 +0800)

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

l10n: update German translationRalf Thielow Fri, 22 Feb 2019 07:45:40 +0000 (08:45 +0100)

l10n: update German translation

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Reviewed-by: Matthias Rüster <matthias.ruester@gmail.com>

tests: fix unportable "\?" and "\+" regex syntaxÆvar Arnfjörð Bjarmason Thu, 21 Feb 2019 19:28:48 +0000 (20:28 +0100)

tests: fix unportable "\?" and "\+" regex syntax

Fix widely supported but non-POSIX basic regex syntax introduced in
[1] and [2]. On GNU, NetBSD and FreeBSD the following works:

$ echo xy >f
$ grep 'xy\?' f; echo $?
xy
0

The same goes for "\+". The "?" and "+" syntax is not in the BRE
syntax, just in ERE, but on some implementations it can be invoked by
prefixing the meta-operator with "\", but not on OpenBSD:

$ uname -a
OpenBSD obsd.my.domain 6.2 GENERIC#132 amd64
$ grep --version
grep version 0.9
$ grep 'xy\?' f; echo $?
1

Let's fix this by moving to ERE syntax instead, where "?" and "+" are
universally supported:

$ grep -E 'xy?' f; echo $?
xy
0

1. 2ed5c8e174 ("describe: setup working tree for --dirty", 2019-02-03)
2. c801170b0c ("t6120: test for describe with a bare repository",
2019-02-03)

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --ignore-some-changesNguyễn Thái Ngọc Duy Thu, 21 Feb 2019 11:16:21 +0000 (18:16 +0700)

diff-parseopt: convert --ignore-some-changes

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --[no-]minimalNguyễn Thái Ngọc Duy Thu, 21 Feb 2019 11:16:20 +0000 (18:16 +0700)

diff-parseopt: convert --[no-]minimal

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --relativeNguyễn Thái Ngọc Duy Thu, 21 Feb 2019 11:16:19 +0000 (18:16 +0700)

diff-parseopt: convert --relative

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --no-renames|--[no--rename-emptyNguyễn Thái Ngọc Duy Thu, 21 Feb 2019 11:16:18 +0000 (18:16 +0700)

diff-parseopt: convert --no-renames|--[no--rename-empty

For --rename-empty, see 90d43b0768 (teach diffcore-rename to
optionally ignore empty content - 2012-03-22) for more information.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --find-copies-harderNguyễn Thái Ngọc Duy Thu, 21 Feb 2019 11:16:17 +0000 (18:16 +0700)

diff-parseopt: convert --find-copies-harder

--no-find-copies-harder is also added on purpose (because I don't see
why we should not have the --no- version for this)

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert -C|--find-copiesNguyễn Thái Ngọc Duy Thu, 21 Feb 2019 11:16:16 +0000 (18:16 +0700)

diff-parseopt: convert -C|--find-copies

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert -D|--irreversible-deleteNguyễn Thái Ngọc Duy Thu, 21 Feb 2019 11:16:15 +0000 (18:16 +0700)

diff-parseopt: convert -D|--irreversible-delete

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert -M|--find-renamesNguyễn Thái Ngọc Duy Thu, 21 Feb 2019 11:16:14 +0000 (18:16 +0700)

diff-parseopt: convert -M|--find-renames

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert -B|--break-rewritesNguyễn Thái Ngọc Duy Thu, 21 Feb 2019 11:16:13 +0000 (18:16 +0700)

diff-parseopt: convert -B|--break-rewrites

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --output-*Nguyễn Thái Ngọc Duy Thu, 21 Feb 2019 11:16:12 +0000 (18:16 +0700)

diff-parseopt: convert --output-*

This also validates that the user specifies a single character in
--output-indicator-*, not a string.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-parseopt: convert --[no-]compact-summaryNguyễn Thái Ngọc Duy Thu, 21 Feb 2019 11:16:11 +0000 (18:16 +0700)

diff-parseopt: convert --[no-]compact-summary

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>