gitweb.git
init: correct re-initialization from a linked worktreeNguyễn Thái Ngọc Duy Sun, 25 Sep 2016 03:14:36 +0000 (10:14 +0700)

init: correct re-initialization from a linked worktree

When 'git init' is called from a linked worktree, we treat '.git'
dir (which is $GIT_COMMON_DIR/worktrees/something) as the main
'.git' (i.e. $GIT_COMMON_DIR) and populate the whole repository skeleton
in there. It does not harm anything (*) but it is still wrong.

Since 'git init' calls set_git_dir() at preparation time, which
indirectly calls get_common_dir() and correctly detects multiple
worktree setup, all git_path_buf() calls in create_default_files() will
return correct paths in both single and multiple worktree setups. The
only thing left is copy_templates(), which targets $GIT_DIR, not
$GIT_COMMON_DIR.

Fix that with get_git_common_dir(). This function will return $GIT_DIR
in single-worktree setup, so we don't have to make a special case for
multiple-worktree here.

(*) It does in fact, thanks to another bug. More on that later.

Noticed-by: Max Nordlund <max.nordlund@sqore.com>
Helped-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1007: factor out repeated setupJeff King Tue, 13 Sep 2016 03:23:12 +0000 (20:23 -0700)

t1007: factor out repeated setup

We have a series of 3 CRLF tests that do exactly the same
(long) setup sequence. Let's pull it out into a common setup
test, which is shorter, more efficient, and will make it
easier to add new tests.

Note that we don't have to worry about cleaning up any of
the setup which was previously per-test; we call pop_repo
after the CRLF tests, which cleans up everything.

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

init: reset cached config when entering new repoJeff King Tue, 13 Sep 2016 03:24:23 +0000 (20:24 -0700)

init: reset cached config when entering new repo

After we copy the templates into place, we re-read the
config in case we copied in a default config file. But since
git_config() is backed by a cache these days, it's possible
that the call will not actually touch the filesystem at all;
we need to tell it that something has changed behind the
scenes.

Note that we also need to reset the shared_repository
config. At first glance, it seems like this should probably
just be folded into git_config_clear(). But unfortunately
that is not quite right. The shared repository value may
come from config, _or_ it may have been set manually. So
only the caller who knows whether or not they set it is the
one who can clear it (and indeed, if you _do_ put it into
git_config_clear(), then many tests fail, as we have to
clear the config cache any time we set a new config
variable).

There are three tests here. The first two actually pass
already, though it's largely luck: they just don't happen to
actually read any config before we enter the new repo.

But the third one does fail without this patch; we look at
core.sharedrepository while creating the directory, but need
to make sure the value from the template config overrides
it.

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

init: expand comments explaining config trickeryJeff King Tue, 13 Sep 2016 03:24:19 +0000 (20:24 -0700)

init: expand comments explaining config trickery

git-init may copy "config" from the templates directory and
then re-read it. There are some comments explaining what's
going on here, but they are not grouped very well with the
matching code. Let's rearrange and expand them.

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

config: only read .git/config from configured reposJeff King Tue, 13 Sep 2016 03:24:15 +0000 (20:24 -0700)

config: only read .git/config from configured repos

When git_config() runs, it looks in the system, user-wide,
and repo-level config files. It gets the latter by calling
git_pathdup(), which in turn calls get_git_dir(). If we
haven't set up the git repository yet, this may simply
return ".git", and we will look at ".git/config". This
seems like it would be helpful (presumably we haven't set up
the repository yet, so it tries to find it), but it turns
out to be a bad idea for a few reasons:

- it's not sufficient, and therefore hides bugs in a
confusing way. Config will be respected if commands are
run from the top-level of the working tree, but not from
a subdirectory.

- it's not always true that we haven't set up the
repository _yet_; we may not want to do it at all. For
instance, if you run "git init /some/path" from inside
another repository, it should not load config from the
existing repository.

- there might be a path ".git/config", but it is not the
actual repository we would find via setup_git_directory().
This may happen, e.g., if you are storing a git
repository inside another git repository, but have
munged one of the files in such a way that the
inner repository is not valid (e.g., by removing HEAD).

We have at least two bugs of the second type in git-init,
introduced by ae5f677 (lazily load core.sharedrepository,
2016-03-11). It causes init to use git_configset(), which
loads all of the config, including values from the current
repo (if any). This shows up in two ways:

1. If we happen to be in an existing repository directory,
we'll read and respect core.sharedrepository from it,
even though it should have no bearing on the new
repository. A new test in t1301 covers this.

2. Similarly, if we're in an existing repo that sets
core.logallrefupdates, that will cause init to fail to
set it in a newly created repository (because it thinks
that the user's templates already did so). A new test
in t0001 covers this.

We also need to adjust an existing test in t1302, which
gives another example of why this patch is an improvement.

That test creates an embedded repository with a bogus
core.repositoryformatversion of "99". It wants to make sure
that we actually stop at the bogus repo rather than
continuing upward to find the outer repo. So it checks that
"git config core.repositoryformatversion" returns 99. But
that only works because we blindly read ".git/config", even
though we _know_ we're in a repository whose vintage we do
not understand.

After this patch, we avoid reading config from the unknown
vintage repository at all, which is a safer choice. But we
need to tweak the test, since core.repositoryformatversion
will not return 99; it will claim that it could not find the
variable at all.

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

test-config: setup git directoryJeff King Tue, 13 Sep 2016 03:24:10 +0000 (20:24 -0700)

test-config: setup git directory

The t1308 test script uses our test-config helper to read
repository-level config, but never actually sets up the
repository. This works because git_config() blindly reads
".git/config" even if we have not configured a repository.

This means that test-config won't work from a subdirectory,
though since it's just a helper for the test scripts, that's
not a big deal.

More important is that the behavior of git_config() is going
to change, and we want to make sure that t1308 continues to
work. We can just use setup_git_directory(), and not the
gentle form; there's no point in being flexible, as it's
just a helper for the tests.

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

t1302: use "git -C"Jeff King Tue, 13 Sep 2016 03:24:00 +0000 (20:24 -0700)

t1302: use "git -C"

This is shorter, and saves a subshell.

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

pager: handle early configJeff King Tue, 13 Sep 2016 03:23:56 +0000 (20:23 -0700)

pager: handle early config

The pager code is often run early in the git.c startup,
before we have actually found the repository. When we ask
git_config() to look for values like core.pager, it doesn't
know where to find the repo-level config, and will blindly
examine ".git/config" if it exists. That's why t7006 shows
that many pager-related features happen to work from the
top-level of a repository, but not from a subdirectory.

This patch pulls that ".git/config" hack explicitly into the
pager code. There are two reasons for this:

1. We'd like to clean up the git_config() behavior, as
looking at ".git/config" when we do not have a
configured repository is often the wrong thing to do.
But we'd prefer not to break the pager config any worse
than it already is.

2. It's one very tiny step on the road to ultimately
making the pager config work consistently. If we
eventually get an equivalent of setup_git_directory()
that _just_ finds the directory and doesn't chdir() or
set up any global state, we could plug it in here
(instead of blindly looking at ".git/config").

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

pager: use callbacks instead of configsetJeff King Tue, 13 Sep 2016 03:23:52 +0000 (20:23 -0700)

pager: use callbacks instead of configset

While the cached configset interface is more pleasant to
use, it is not appropriate for "early" config like pager
setup, which must sometimes do tricky things like reading
from ".git/config" even when we have not set up the
repository.

As a preparatory step to handling these cases better, let's
switch back to using the callback interface, which gives us
more control.

Note that this is essentially a revert of 586f414 (pager.c:
replace `git_config()` with `git_config_get_value()`,
2014-08-07), but with some minor style fixups and
modernizations.

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

pager: make pager_program a file-local staticJeff King Tue, 13 Sep 2016 03:23:48 +0000 (20:23 -0700)

pager: make pager_program a file-local static

This variable is only ever used by the routines in pager.c,
and other parts of the code should always use those routines
(like git_pager()) to make decisions about which pager to
use. Let's reduce its scope to prevent accidents.

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

pager: stop loading git_default_config()Jeff King Tue, 13 Sep 2016 03:23:44 +0000 (20:23 -0700)

pager: stop loading git_default_config()

In git_pager(), we really only care about getting the value
of core.pager. But to do so, we use the git_default_config()
callback, which loads many other values. Ordinarily it
isn't a big deal to load this config an extra time, as it
simply overwrites the values from the previous run. But it's
a bad idea here, for two reasons:

1. The pager setup may be called very early in the
program, before we have found the git repository. As a
result, we may fail to read the correct repo-level
config file. This is a problem for core.pager, too,
but we should at least try to minimize the pollution to
other configured values.

2. Because we call setup_pager() from git.c, basically
every builtin command _may_ end up reading this config
and getting an implicit git_default_config() setup.

Which doesn't sound like a terrible thing, except that
we don't do it consistently; it triggers only when
stdout is a tty. So if a command forgets to load the
default config itself (but depends on it anyway), it
may appear to work, and then mysteriously fail when the
pager is not in use.

We can improve this by loading _just_ the core.pager config
from git_pager().

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

pager: remove obsolete commentJeff King Tue, 13 Sep 2016 03:23:40 +0000 (20:23 -0700)

pager: remove obsolete comment

The comment at the top of pager.c claims that we've split
the code out so that Windows can do something different.
This dates back to f67b45f (Introduce trivial new pager.c
helper infrastructure, 2006-02-28), because the original
implementation used fork(). Later, we ended up sticking the
Windows #ifdefs into this file anyway. And then even later,
in ea27a18 (spawn pager via run_command interface,
2008-07-22) we unified the implementations.

So these days this comment is really saying nothing at all.
Let's drop it.

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

diff: always try to set up the repositoryJeff King Tue, 13 Sep 2016 03:23:36 +0000 (20:23 -0700)

diff: always try to set up the repository

If we see an explicit "--no-index", we do not bother calling
setup_git_directory_gently() at all. This means that we may
miss out on reading repo-specific config.

It's arguable whether this is correct or not. If we were
designing from scratch, making "git diff --no-index"
completely ignore the repository makes some sense. But we
are nowhere near scratch, so let's look at the existing
behavior:

1. If you're in the top-level of a repository and run an
explicit "diff --no-index", the config subsystem falls
back to reading ".git/config", and we will respect repo
config.

2. If you're in a subdirectory of a repository, then we
still try to read ".git/config", but it generally
doesn't exist. So "diff --no-index" there does not
respect repo config.

3. If you have $GIT_DIR set in the environment, we read
and respect $GIT_DIR/config,

4. If you run "git diff /tmp/foo /tmp/bar" to get an
implicit no-index, we _do_ run the repository setup,
and set $GIT_DIR (or respect an existing $GIT_DIR
variable). We find the repo config no matter where we
started, and respect it.

So we already respect the repository config in a number of
common cases, and case (2) is the only one that does not.
And at least one of our tests, t4034, depends on case (1)
behaving as it does now (though it is just incidental, not
an explicit test for this behavior).

So let's bring case (2) in line with the others by always
running the repository setup, even with an explicit
"--no-index". We shouldn't need to change anything else, as the
implicit case already handles the prefix.

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

diff: handle --no-index prefixes consistentlyJeff King Tue, 13 Sep 2016 03:23:32 +0000 (20:23 -0700)

diff: handle --no-index prefixes consistently

If we see an explicit "git diff --no-index ../foo ../bar",
then we do not set up the git repository at all (we already
know we are in --no-index mode, so do not have to check "are
we in a repository?"), and hence have no "prefix" within the
repository. A patch generated by this command will have the
filenames "a/../foo" and "b/../bar", no matter which
directory we are in with respect to any repository.

However, in the implicit case, where we notice that the
files are outside the repository, we will have chdir()'d to
the top-level of the repository. We then feed the prefix
back to the diff machinery. As a result, running the same
diff from a subdirectory will result in paths that look like
"a/subdir/../../foo".

Besides being unnecessarily long, this may also be confusing
to the user: they don't care about the subdir or the
repository at all; it's just where they happened to be when
running the command. We should treat this the same as the
explicit --no-index case.

One way to address this would be to chdir() back to the
original path before running our diff. However, that's a bit
hacky, as we would also need to adjust $GIT_DIR, which could
be a relative path from our top-level.

Instead, we can reuse the diff machinery's RELATIVE_NAME
option, which automatically strips off the prefix. Note that
this _also_ restricts the diff to this relative prefix, but
that's OK for our purposes: we queue our own diff pairs
manually, and do not rely on that part of the diff code.

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

diff: skip implicit no-index check when given --no... Jeff King Tue, 13 Sep 2016 03:23:27 +0000 (20:23 -0700)

diff: skip implicit no-index check when given --no-index

We can invoke no-index mode in two ways: by an explicit
request from the user, or implicitly by noticing that we
have two paths, and at least one is outside the repository.

If the user already told us --no-index, there is no need for
us to do the implicit test at all. However, we currently
do, and downgrade our "explicit" to DIFF_NO_INDEX_IMPLICIT.

This doesn't have any user-visible behavior, though it's not
immediately obvious why. We only trigger the implicit check
when we have exactly two non-option arguments. And the only
code that cares about implicit versus explicit is an error
message that we show when we _don't_ have two non-option
arguments.

However, it's worth fixing anyway. Besides being slightly
more efficient, it makes the code easier to follow, which
will help when we modify it in future patches.

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

patch-id: use RUN_SETUP_GENTLYJeff King Tue, 13 Sep 2016 03:23:22 +0000 (20:23 -0700)

patch-id: use RUN_SETUP_GENTLY

Patch-id does not require a repository because it is just
processing the incoming diff on stdin, but it may look at
git config for keys like patchid.stable.

Even though we do not setup_git_directory(), this works from
the top-level of a repository because we blindly look at
".git/config" in this case. But as the included test
demonstrates, it does not work from a subdirectory.

We can fix it by using RUN_SETUP_GENTLY. We do not take any
filenames from the user on the command line, so there's no
need to adjust them via prefix_filename().

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

hash-object: always try to set up the git repositoryJeff King Tue, 13 Sep 2016 03:23:17 +0000 (20:23 -0700)

hash-object: always try to set up the git repository

When "hash-object" is run without "-w", we don't need to be
in a git repository at all; we can just hash the object and
write its sha1 to stdout. However, if we _are_ in a git
repository, we would want to know that so we can follow the
normal rules for respecting config, .gitattributes, etc.

This happens to work at the top-level of a git repository
because we blindly read ".git/config", but as the included
test shows, it does not work when you are in a subdirectory.

The solution is to just do a "gentle" setup in this case. We
already take care to use prefix_filename() on any filename
arguments we get (to handle the "-w" case), so we don't need
to do anything extra to handle the side effects of repo
setup.

An alternative would be to specify RUN_SETUP_GENTLY for this
command in git.c, and then die if "-w" is set but we are not
in a repository. However, the error messages generated at
the time of setup_git_directory() are more detailed, so it's
better to find out which mode we are in, and then call the
appropriate function.

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

Git 2.8.4 v2.8.4Junio C Hamano Mon, 6 Jun 2016 21:29:32 +0000 (14:29 -0700)

Git 2.8.4

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

Merge branch 'kb/msys2-tty' into maintJunio C Hamano Mon, 6 Jun 2016 21:27:38 +0000 (14:27 -0700)

Merge branch 'kb/msys2-tty' into maint

The "are we talking with TTY, doing an interactive session?"
detection has been updated to work better for "Git for Windows".

* kb/msys2-tty:
mingw: make isatty() recognize MSYS2's pseudo terminals (/dev/pty*)

Merge branch 'da/difftool' into maintJunio C Hamano Mon, 6 Jun 2016 21:27:37 +0000 (14:27 -0700)

Merge branch 'da/difftool' into maint

"git difftool" learned to handle unmerged paths correctly in
dir-diff mode.

* da/difftool:
difftool: handle unmerged files in dir-diff mode
difftool: initialize variables for readability

Merge branch 'tb/core-eol-fix' into maintJunio C Hamano Mon, 6 Jun 2016 21:27:36 +0000 (14:27 -0700)

Merge branch 'tb/core-eol-fix' into maint

A couple of bugs around core.autocrlf have been fixed.

* tb/core-eol-fix:
convert.c: ident + core.autocrlf didn't work
t0027: test cases for combined attributes
convert: allow core.autocrlf=input and core.eol=crlf
t0027: make commit_chk_wrnNNO() reliable

Merge branch 'ar/diff-args-osx-precompose' into maintJunio C Hamano Mon, 6 Jun 2016 21:27:35 +0000 (14:27 -0700)

Merge branch 'ar/diff-args-osx-precompose' into maint

Many commands normalize command line arguments from NFD to NFC
variant of UTF-8 on OSX, but commands in the "diff" family did
not, causing "git diff $path" to complain that no such path is
known to Git. They have been taught to do the normalization.

* ar/diff-args-osx-precompose:
diff: run arguments through precompose_argv

More topics for 2.8.4Junio C Hamano Tue, 31 May 2016 21:11:38 +0000 (14:11 -0700)

More topics for 2.8.4

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

Merge branch 'sb/submodule-deinit-all' into maintJunio C Hamano Tue, 31 May 2016 21:09:46 +0000 (14:09 -0700)

Merge branch 'sb/submodule-deinit-all' into maint

Correct faulty recommendation to use "git submodule deinit ." when
de-initialising all submodules, which would result in a strange
error message in a pathological corner case.

* sb/submodule-deinit-all:
submodule deinit: require '--all' instead of '.' for all submodules

Merge branch 'bn/http-cookiefile-config' into maintJunio C Hamano Tue, 31 May 2016 21:08:28 +0000 (14:08 -0700)

Merge branch 'bn/http-cookiefile-config' into maint

"http.cookieFile" configuration variable clearly wants a pathname,
but we forgot to treat it as such by e.g. applying tilde expansion.

* bn/http-cookiefile-config:
http: expand http.cookieFile as a path
Documentation: config: improve word ordering for http.cookieFile

Merge branch 'jk/test-send-sh-x-trace-elsewhere' into... Junio C Hamano Tue, 31 May 2016 21:08:27 +0000 (14:08 -0700)

Merge branch 'jk/test-send-sh-x-trace-elsewhere' into maint

Running tests with '-x' option to trace the individual command
executions is a useful way to debug test scripts, but some tests
that capture the standard error stream and check what the command
said can be broken with the trace output mixed in. When running
our tests under "bash", however, we can redirect the trace output
to another file descriptor to keep the standard error of programs
being tested intact.

* jk/test-send-sh-x-trace-elsewhere:
test-lib: set BASH_XTRACEFD automatically

Merge branch 'js/name-rev-use-oldest-ref' into maintJunio C Hamano Tue, 31 May 2016 21:08:26 +0000 (14:08 -0700)

Merge branch 'js/name-rev-use-oldest-ref' into maint

"git describe --contains" often made a hard-to-justify choice of
tag to give name to a given commit, because it tried to come up
with a name with smallest number of hops from a tag, causing an old
commit whose close descendant that is recently tagged were not
described with respect to an old tag but with a newer tag. It did
not help that its computation of "hop" count was further tweaked to
penalize being on a side branch of a merge. The logic has been
updated to favor using the tag with the oldest tagger date, which
is a lot easier to explain to the end users: "We describe a commit
in terms of the (chronologically) oldest tag that contains the
commit."

* js/name-rev-use-oldest-ref:
name-rev: include taggerdate in considering the best name

Start preparing for 2.8.4Junio C Hamano Thu, 26 May 2016 20:21:00 +0000 (13:21 -0700)

Start preparing for 2.8.4

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

Merge branch 'jc/linkgit-fix' into maintJunio C Hamano Thu, 26 May 2016 20:17:26 +0000 (13:17 -0700)

Merge branch 'jc/linkgit-fix' into maint

Many 'linkgit:<git documentation page>' references were broken,
which are all fixed with this.

* jc/linkgit-fix:
Documentation: fix linkgit references

Merge branch 'ls/travis-build-doc' into maintJunio C Hamano Thu, 26 May 2016 20:17:25 +0000 (13:17 -0700)

Merge branch 'ls/travis-build-doc' into maint

CI test was taught to build documentation pages.

* ls/travis-build-doc:
travis-ci: build documentation

Merge branch 'jc/fsck-nul-in-commit' into maintJunio C Hamano Thu, 26 May 2016 20:17:24 +0000 (13:17 -0700)

Merge branch 'jc/fsck-nul-in-commit' into maint

"git fsck" learned to catch NUL byte in a commit object as
potential error and warn.

* jc/fsck-nul-in-commit:
fsck: detect and warn a commit with embedded NUL
fsck_commit_buffer(): do not special case the last validation

Merge branch 'jk/rebase-interative-eval-fix' into maintJunio C Hamano Thu, 26 May 2016 20:17:24 +0000 (13:17 -0700)

Merge branch 'jk/rebase-interative-eval-fix' into maint

Portability enhancement for "rebase -i" to help platforms whose
shell does not like "for i in <empty>" (which is not POSIX-kosher).

* jk/rebase-interative-eval-fix:
rebase--interactive: avoid empty list in shell for-loop

Merge branch 'js/windows-dotgit' into maintJunio C Hamano Thu, 26 May 2016 20:17:23 +0000 (13:17 -0700)

Merge branch 'js/windows-dotgit' into maint

On Windows, .git and optionally any files whose name starts with a
dot are now marked as hidden, with a core.hideDotFiles knob to
customize this behaviour.

* js/windows-dotgit:
mingw: remove unnecessary definition
mingw: introduce the 'core.hideDotFiles' setting

Merge branch 'kf/gpg-sig-verification-doc' into maintJunio C Hamano Thu, 26 May 2016 20:17:22 +0000 (13:17 -0700)

Merge branch 'kf/gpg-sig-verification-doc' into maint

Documentation for "git merge --verify-signatures" has been updated
to clarify that the signature of only the commit at the tip is
verified. Also the phrasing used for signature and key validity is
adjusted to align with that used by OpenPGP.

* kf/gpg-sig-verification-doc:
Documentation: clarify signature verification

Merge branch 'lp/typofixes' into maintJunio C Hamano Thu, 26 May 2016 20:17:21 +0000 (13:17 -0700)

Merge branch 'lp/typofixes' into maint

Typofixes.

* lp/typofixes:
typofix: assorted typofixes in comments, documentation and messages

Merge branch 'sb/z-is-gnutar-ism' into maintJunio C Hamano Thu, 26 May 2016 20:17:21 +0000 (13:17 -0700)

Merge branch 'sb/z-is-gnutar-ism' into maint

Test fix.

* sb/z-is-gnutar-ism:
t6041: do not compress backup tar file
t3513: do not compress backup tar file

Merge branch 'va/i18n-misc-updates' into maintJunio C Hamano Thu, 26 May 2016 20:17:20 +0000 (13:17 -0700)

Merge branch 'va/i18n-misc-updates' into maint

Mark several messages for translation.

* va/i18n-misc-updates:
i18n: unpack-trees: avoid substituting only a verb in sentences
i18n: builtin/pull.c: split strings marked for translation
i18n: builtin/pull.c: mark placeholders for translation
i18n: git-parse-remote.sh: mark strings for translation
i18n: branch: move comment for translators
i18n: branch: unmark string for translation
i18n: builtin/rm.c: remove a comma ',' from string
i18n: unpack-trees: mark strings for translation
i18n: builtin/branch.c: mark option for translation
i18n: index-pack: use plural string instead of normal one

Merge branch 'bn/config-doc-tt-varnames' into maintJunio C Hamano Thu, 26 May 2016 20:17:19 +0000 (13:17 -0700)

Merge branch 'bn/config-doc-tt-varnames' into maint

Doc formatting fixes.

* bn/config-doc-tt-varnames:
config: consistently format $variables in monospaced font
config: describe 'pathname' value type

Merge branch 'nd/remote-plural-ours-plus-theirs' into... Junio C Hamano Thu, 26 May 2016 20:17:18 +0000 (13:17 -0700)

Merge branch 'nd/remote-plural-ours-plus-theirs' into maint

Message fix.

* nd/remote-plural-ours-plus-theirs:
remote.c: specify correct plural form in "commit diverge" message

Merge branch 'ak/t4151-ls-files-could-be-empty' into... Junio C Hamano Thu, 26 May 2016 20:17:17 +0000 (13:17 -0700)

Merge branch 'ak/t4151-ls-files-could-be-empty' into maint

Test fix.

* ak/t4151-ls-files-could-be-empty:
t4151: make sure argument to 'test -z' is given

Merge branch 'jc/test-seq' into maintJunio C Hamano Thu, 26 May 2016 20:17:16 +0000 (13:17 -0700)

Merge branch 'jc/test-seq' into maint

Test fix.

* jc/test-seq:
test-lib-functions.sh: rewrite test_seq without Perl
test-lib-functions.sh: remove misleading comment on test_seq

Merge branch 'tb/t5601-sed-fix' into maintJunio C Hamano Thu, 26 May 2016 20:17:15 +0000 (13:17 -0700)

Merge branch 'tb/t5601-sed-fix' into maint

Test fix.

* tb/t5601-sed-fix:
t5601: Remove trailing space in sed expression

Merge branch 'va/i18n-remote-comment-to-align' into... Junio C Hamano Thu, 26 May 2016 20:17:14 +0000 (13:17 -0700)

Merge branch 'va/i18n-remote-comment-to-align' into maint

Message fix.

* va/i18n-remote-comment-to-align:
i18n: remote: add comment for translators

Merge branch 'va/mailinfo-doc-typofix' into maintJunio C Hamano Thu, 26 May 2016 20:17:13 +0000 (13:17 -0700)

Merge branch 'va/mailinfo-doc-typofix' into maint

Typofix.

* va/mailinfo-doc-typofix:
Documentation/git-mailinfo: fix typo

Merge branch 'maint-2.7' into maintJunio C Hamano Thu, 26 May 2016 20:16:51 +0000 (13:16 -0700)

Merge branch 'maint-2.7' into maint

* maint-2.7:
archive-tar: convert snprintf to xsnprintf

mingw: make isatty() recognize MSYS2's pseudo terminals... Karsten Blees Wed, 27 Apr 2016 15:16:37 +0000 (17:16 +0200)

mingw: make isatty() recognize MSYS2's pseudo terminals (/dev/pty*)

MSYS2 emulates pseudo terminals via named pipes, and isatty() returns 0
for such file descriptors. Therefore, some interactive functionality
(such as launching a pager, asking if a failed unlink should be repeated
etc.) doesn't work when run in a terminal emulator that uses MSYS2's
ptys (such as mintty).

However, MSYS2 uses special names for its pty pipes ('msys-*-pty*'),
which allows us to distinguish them from normal piped input / output.

On startup, check if stdin / stdout / stderr are connected to such pipes
using the NtQueryObject API from NTDll.dll. If the names match, adjust
the flags in MSVCRT's ioinfo structure accordingly.

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>

Merge branch 'jk/war-on-sprintf' into maint-2.7Junio C Hamano Thu, 26 May 2016 17:45:37 +0000 (10:45 -0700)

Merge branch 'jk/war-on-sprintf' into maint-2.7

* jk/war-on-sprintf:
archive-tar: convert snprintf to xsnprintf

archive-tar: convert snprintf to xsnprintfJeff King Thu, 26 May 2016 04:28:08 +0000 (00:28 -0400)

archive-tar: convert snprintf to xsnprintf

Commit f2f0267 (archive-tar: use xsnprintf for trivial
formatting, 2015-09-24) converted cases of "sprintf" to
"xsnprintf", but accidentally left one as just "snprintf".
This meant that we could silently truncate the resulting
buffer instead of flagging an error.

In practice, this is impossible to achieve, as we are
formatting a ustar checksum, which can be at most 7
characters. But the point of xsnprintf is to document and
check for "should be impossible" conditions; this site was
just accidentally mis-converted during f2f0267.

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

Git 2.8.3 v2.8.3Junio C Hamano Wed, 18 May 2016 21:45:08 +0000 (14:45 -0700)

Git 2.8.3

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

Merge branch 'sb/misc-cleanups' into HEADJunio C Hamano Wed, 18 May 2016 21:40:15 +0000 (14:40 -0700)

Merge branch 'sb/misc-cleanups' into HEAD

* sb/misc-cleanups:
submodule-config: don't shadow `cache`
config.c: drop local variable
credential-cache, send_request: close fd when done
bundle: don't leak an fd in case of early return
abbrev_sha1_in_line: don't leak memory
notes: don't leak memory in git_config_get_notes_strategy

Merge branch 'ew/doc-split-pack-disables-bitmap' into... Junio C Hamano Wed, 18 May 2016 21:40:15 +0000 (14:40 -0700)

Merge branch 'ew/doc-split-pack-disables-bitmap' into HEAD

Doc update.

* ew/doc-split-pack-disables-bitmap:
pack-objects: warn on split packs disabling bitmaps

Merge branch 'sb/clean-test-fix' into HEADJunio C Hamano Wed, 18 May 2016 21:40:14 +0000 (14:40 -0700)

Merge branch 'sb/clean-test-fix' into HEAD

* sb/clean-test-fix:
t7300: mark test with SANITY

Merge branch 'rn/glossary-typofix' into HEADJunio C Hamano Wed, 18 May 2016 21:40:13 +0000 (14:40 -0700)

Merge branch 'rn/glossary-typofix' into HEAD

* rn/glossary-typofix:
Documentation: fix typo 'In such these cases'

Merge branch 'ew/normal-to-e' into HEADJunio C Hamano Wed, 18 May 2016 21:40:12 +0000 (14:40 -0700)

Merge branch 'ew/normal-to-e' into HEAD

* ew/normal-to-e:
.mailmap: update to my shorter email address

Merge branch 'sb/config-exit-status-list' into HEADJunio C Hamano Wed, 18 May 2016 21:40:12 +0000 (14:40 -0700)

Merge branch 'sb/config-exit-status-list' into HEAD

Doc update.

* sb/config-exit-status-list:
config doc: improve exit code listing

Merge branch 'rt/string-list-lookup-cleanup' into HEADJunio C Hamano Wed, 18 May 2016 21:40:12 +0000 (14:40 -0700)

Merge branch 'rt/string-list-lookup-cleanup' into HEAD

Code cleanup.

* rt/string-list-lookup-cleanup:
string_list: use string-list API in unsorted_string_list_lookup()

Merge branch 'jk/fix-attribute-macro-in-2.5' into HEADJunio C Hamano Wed, 18 May 2016 21:40:12 +0000 (14:40 -0700)

Merge branch 'jk/fix-attribute-macro-in-2.5' into HEAD

Code fixup.

* jk/fix-attribute-macro-in-2.5:
remote.c: spell __attribute__ correctly

Merge branch 'sg/test-lib-simplify-expr-away' into... Junio C Hamano Wed, 18 May 2016 21:40:11 +0000 (14:40 -0700)

Merge branch 'sg/test-lib-simplify-expr-away' into HEAD

Code cleanup.

* sg/test-lib-simplify-expr-away:
test-lib: simplify '--option=value' parsing

Merge branch 'nd/remove-unused' into HEADJunio C Hamano Wed, 18 May 2016 21:40:11 +0000 (14:40 -0700)

Merge branch 'nd/remove-unused' into HEAD

Code cleanup.

* nd/remove-unused:
wrapper.c: delete dead function git_mkstemps()
dir.c: remove dead function fnmatch_icase()

Merge branch 'sk/gitweb-highlight-encoding' into HEADJunio C Hamano Wed, 18 May 2016 21:40:10 +0000 (14:40 -0700)

Merge branch 'sk/gitweb-highlight-encoding' into HEAD

Some multi-byte encoding can have a backslash byte as a later part
of one letter, which would confuse "highlight" filter used in
gitweb.

* sk/gitweb-highlight-encoding:
gitweb: apply fallback encoding before highlight

Merge branch 'ls/travis-submitting-patches' into HEADJunio C Hamano Wed, 18 May 2016 21:40:09 +0000 (14:40 -0700)

Merge branch 'ls/travis-submitting-patches' into HEAD

* ls/travis-submitting-patches:
Documentation: add setup instructions for Travis CI

Merge branch 'js/close-packs-before-gc' into HEADJunio C Hamano Wed, 18 May 2016 21:40:09 +0000 (14:40 -0700)

Merge branch 'js/close-packs-before-gc' into HEAD

* js/close-packs-before-gc:
t5510: run auto-gc in the foreground

Merge branch 'ls/p4-lfs' into HEADJunio C Hamano Wed, 18 May 2016 21:40:08 +0000 (14:40 -0700)

Merge branch 'ls/p4-lfs' into HEAD

Recent update to Git LFS broke "git p4" by changing the output from
its "lfs pointer" subcommand.

* ls/p4-lfs:
git-p4: fix Git LFS pointer parsing
travis-ci: express Linux/OS X dependency versions more clearly
travis-ci: update Git-LFS and P4 to the latest version

Merge branch 'ls/p4-lfs-test-fix-2.7.0' into HEADJunio C Hamano Wed, 18 May 2016 21:40:08 +0000 (14:40 -0700)

Merge branch 'ls/p4-lfs-test-fix-2.7.0' into HEAD

Fix a broken test.

* ls/p4-lfs-test-fix-2.7.0:
t9824: fix wrong reference value
t9824: fix broken &&-chain in a subshell

Merge branch 'nf/mergetool-prompt' into HEADJunio C Hamano Wed, 18 May 2016 21:40:07 +0000 (14:40 -0700)

Merge branch 'nf/mergetool-prompt' into HEAD

UI consistency improvements.

* nf/mergetool-prompt:
difftool/mergetool: make the form of yes/no questions consistent

Merge branch 'jd/send-email-to-whom' into HEADJunio C Hamano Wed, 18 May 2016 21:40:07 +0000 (14:40 -0700)

Merge branch 'jd/send-email-to-whom' into HEAD

A question by "git send-email" to ask the identity of the sender
has been updated.

* jd/send-email-to-whom:
send-email: fix grammo in the prompt that asks e-mail recipients

Merge branch 'js/win32-mmap' into HEADJunio C Hamano Wed, 18 May 2016 21:40:06 +0000 (14:40 -0700)

Merge branch 'js/win32-mmap' into HEAD

mmap emulation on Windows has been optimized and work better without
consuming paging store when not needed.

* js/win32-mmap:
mmap(win32): avoid expensive fstat() call
mmap(win32): avoid copy-on-write when it is unnecessary
win32mmap: set errno appropriately

Merge branch 'jk/push-client-deadlock-fix' into HEADJunio C Hamano Wed, 18 May 2016 21:40:06 +0000 (14:40 -0700)

Merge branch 'jk/push-client-deadlock-fix' into HEAD

Some Windows SDK lacks pthread_sigmask() implementation and fails
to compile the recently updated "git push" codepath that uses it.

* jk/push-client-deadlock-fix:
Windows: only add a no-op pthread_sigmask() when needed
Windows: add pthread_sigmask() that does nothing
t5504: drop sigpipe=ok from push tests
fetch-pack: isolate sigpipe in demuxer thread
send-pack: isolate sigpipe in demuxer thread
run-command: teach async threads to ignore SIGPIPE
send-pack: close demux pipe before finishing async process

Merge branch 'sb/mv-submodule-fix' into HEADJunio C Hamano Wed, 18 May 2016 21:40:05 +0000 (14:40 -0700)

Merge branch 'sb/mv-submodule-fix' into HEAD

"git mv old new" did not adjust the path for a submodule that lives
as a subdirectory inside old/ directory correctly.

* sb/mv-submodule-fix:
mv: allow moving nested submodules

Merge branch 'da/user-useconfigonly' into HEADJunio C Hamano Wed, 18 May 2016 21:40:05 +0000 (14:40 -0700)

Merge branch 'da/user-useconfigonly' into HEAD

The "user.useConfigOnly" configuration variable makes it an error
if users do not explicitly set user.name and user.email. However,
its check was not done early enough and allowed another error to
trigger, reporting that the default value we guessed from the
system setting was unusable. This was a suboptimal end-user
experience as we want the users to set user.name/user.email without
relying on the auto-detection at all.

* da/user-useconfigonly:
ident: give "please tell me" message upon useConfigOnly error
ident: check for useConfigOnly before auto-detection of name/email

Merge branch 'ld/p4-test-py3' into HEADJunio C Hamano Wed, 18 May 2016 21:40:04 +0000 (14:40 -0700)

Merge branch 'ld/p4-test-py3' into HEAD

The test scripts for "git p4" (but not "git p4" implementation
itself) has been updated so that they would work even on a system
where the installed version of Python is python 3.

* ld/p4-test-py3:
git-p4 tests: time_in_seconds should use $PYTHON_PATH
git-p4 tests: work with python3 as well as python2
git-p4 tests: cd to / before running python

difftool: handle unmerged files in dir-diff modeDavid Aguilar Mon, 16 May 2016 18:05:37 +0000 (11:05 -0700)

difftool: handle unmerged files in dir-diff mode

When files are unmerged they can show up as both unmerged and
modified in the output of `git diff --raw`. This causes
difftool's dir-diff to create filesystem entries for the same
path twice, which fails when it encounters a duplicate path.

Ensure that each worktree path is only processed once.
Add a test to demonstrate the breakage.

Reported-by: Jan Smets <jan@smets.cx>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

difftool: initialize variables for readabilityDavid Aguilar Mon, 16 May 2016 18:05:36 +0000 (11:05 -0700)

difftool: initialize variables for readability

The code always goes into one of the two conditional blocks but make it
clear that not doing so is an error condition by setting $ok to 0.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: run arguments through precompose_argvAlexander Rinass Fri, 13 May 2016 20:41:02 +0000 (22:41 +0200)

diff: run arguments through precompose_argv

When running diff commands, a pathspec containing decomposed
unicode code points is not converted to precomposed unicode form
under Mac OS X, but we normalize the paths in the index and the
history to precomposed form on that platform. As a result, the
pathspec would not match and no diff is shown.

Unlike many builtin commands, the "diff" family of commands do
not use parse_options(), which is how other builtin commands
indirectly call precompose_argv() to normalize argv[] into
precomposed form on Mac OSX. Teach these commands to call
precompose_argv() themselves.

Note that precomopose_argv() normalizes not just paths but all
command line arguments, so things like "git diff -G $string"
when $string has the decomposed form would first be normalized
into the precomposed form and would stop hitting the same string
in the decomposed form in the diff output with this change.

It is not a problem per-se, as "log" family of commands already use
parse_options() and call precompose_argv()--we can think of this
change as making the "diff" family of commands behave in a similar
way as the commands in the "log" family.

Signed-off-by: Alexander Rinass <alex@fournova.com>
Helped-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: clarify signature verificationKeller Fuchs Fri, 13 May 2016 09:51:01 +0000 (09:51 +0000)

Documentation: clarify signature verification

Clarify that "merge --verify-signatures" checks the signature on the
tip commit of the history being merged.

Uniformise the vocabulary used wrt. key/signature validity with OpenPGP:
- a signature is valid if made by a key with a valid uid;
- in the default trust-model, a uid is valid if signed by a trusted key;
- a key is trusted if the (local) user set a trust level for it.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Keller Fuchs <KellerFuchs@hashbang.sh>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: unpack-trees: avoid substituting only a verb... Vasco Almeida Thu, 12 May 2016 23:16:26 +0000 (23:16 +0000)

i18n: unpack-trees: avoid substituting only a verb in sentences

Instead of reusing the same set of message templates for checkout
and other actions and substituting the verb with "%s", prepare
separate message templates for each known action. That would make
it easier for translation into languages where the same verb may
conjugate differently depending on the message we are giving.

See gettext documentation for details:
http://www.gnu.org/software/gettext/manual/html_node/Preparing-Strings.html

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-mailinfo: fix typoVasco Almeida Wed, 11 May 2016 20:42:54 +0000 (20:42 +0000)

Documentation/git-mailinfo: fix typo

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-lib: set BASH_XTRACEFD automaticallyJeff King Wed, 11 May 2016 13:44:04 +0000 (09:44 -0400)

test-lib: set BASH_XTRACEFD automatically

Passing "-x" to a test script enables the shell's "set -x"
tracing, which can help with tracking down the command that
is causing a failure. Unfortunately, it can also _cause_
failures in some tests that redirect the stderr of a shell
function. Inside the function the shell continues to
respect "set -x", and the trace output is collected along
with whatever stderr is generated normally by the function.

You can see an example of this by running:

./t0040-parse-options.sh -x -i

which will fail immediately in the first test, as it
expects:

test_must_fail some-cmd 2>output.err

to leave output.err empty (but with "-x" it has our trace
output).

Unfortunately there isn't a portable or scalable solution to
this. We could teach test_must_fail to disable "set -x", but
that doesn't help any of the other functions or subshells.

However, we can work around it by pointing the "set -x"
output to our descriptor 4, which always points to the
original stderr of the test script. Unfortunately this only
works for bash, but it's better than nothing (and other
shells will just ignore the BASH_XTRACEFD variable).

The patch itself is a simple one-liner, but note the caveats
in the accompanying comments.

Automatic tests for our "-x" option may be a bit too meta
(and a pain, because they are bash-specific), but I did
confirm that it works correctly both with regular "-x" and
with "--verbose-only=1". This works because the latter flips
"set -x" off and on for particular tests (if it didn't, we
would get tracing for all tests, as going to descriptor 4
effectively circumvents the verbose flag).

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

Windows: only add a no-op pthread_sigmask() when neededJohannes Schindelin Wed, 11 May 2016 15:10:30 +0000 (17:10 +0200)

Windows: only add a no-op pthread_sigmask() when needed

In f924b52 (Windows: add pthread_sigmask() that does nothing,
2016-05-01), we introduced a no-op for Windows. However, this breaks
building Git in Git for Windows' SDK because pthread_sigmask() is
already a no-op there, #define'd in the pthread_signal.h header in
/mingw64/x86_64-w64-mingw32/include/.

Let's wrap the definition of pthread_sigmask() in a guard that skips
it when compiling with MinGW-w64' headers.

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

mingw: remove unnecessary definitionJohannes Schindelin Wed, 11 May 2016 08:43:41 +0000 (10:43 +0200)

mingw: remove unnecessary definition

For some reason, the definition of the MINGW version of
`mark_as_git_dir()` slipped into this developer's patch series to
support building Git for Windows.

As the `mark_as_git_dir()` function is not needed at all anymore (it was
used originally to support the core.hideDotFiles = gitDirOnly setting,
but we now use a different method to support that case), let's just
remove it.

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

mingw: introduce the 'core.hideDotFiles' settingJohannes Schindelin Wed, 11 May 2016 08:43:37 +0000 (10:43 +0200)

mingw: introduce the 'core.hideDotFiles' setting

On Unix (and Linux), files and directories whose names start with a dot
are usually not shown by default. This convention is used by Git: the
.git/ directory should be left alone by regular users, and only accessed
through Git itself.

On Windows, no such convention exists. Instead, there is an explicit flag
to mark files or directories as hidden.

In the early days, Git for Windows did not mark the .git/ directory (or
for that matter, any file or directory whose name starts with a dot)
hidden. This lead to quite a bit of confusion, and even loss of data.

Consequently, Git for Windows introduced the core.hideDotFiles setting,
with three possible values: true, false, and dotGitOnly, defaulting to
marking only the .git/ directory as hidden.

The rationale: users do not need to access .git/ directly, and indeed (as
was demonstrated) should not really see that directory, either. However,
not all dot files should be hidden by default, as e.g. Eclipse does not
show them (and the user would therefore be unable to see, say, a
.gitattributes file).

In over five years since the last attempt to bring this patch into core
Git, a slightly buggy version of this patch has served Git for Windows'
users well: no single report indicated problems with the hidden .git/
directory, and the stream of problems caused by the previously non-hidden
.git/ directory simply stopped. The bugs have been fixed during the
process of getting this patch upstream.

Note that there is a funny quirk we have to pay attention to when
creating hidden files: we use Win32's _wopen() function which
transmogrifies its arguments and hands off to Win32's CreateFile()
function. That latter function errors out with ERROR_ACCESS_DENIED (the
equivalent of EACCES) when the equivalent of the O_CREAT flag was passed
and the file attributes (including the hidden flag) do not match an
existing file's. And _wopen() accepts no parameter that would be
transmogrified into said hidden flag. Therefore, we simply try again
without O_CREAT.

A slightly different method is required for our fopen()/freopen()
function as we cannot even *remove* the implicit O_CREAT flag.
Therefore, we briefly mark existing files as unhidden when opening them
via fopen()/freopen().

The ERROR_ACCESS_DENIED error can also be triggered by opening a file
that is marked as a system file (which is unlikely to be tracked in
Git), and by trying to create a file that has *just* been deleted and is
awaiting the last open handles to be released (which would be handled
better by the "Try again?" logic, a story for a different patch series,
though). In both cases, it does not matter much if we try again without
the O_CREAT flag, read: it does not hurt, either.

For details how ERROR_ACCESS_DENIED can be triggered, see
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858

Original-patch-by: Erik Faye-Lund <kusmabite@gmail.com>
Initial-Test-By: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase--interactive: avoid empty list in shell for... Jeff King Tue, 10 May 2016 21:07:10 +0000 (17:07 -0400)

rebase--interactive: avoid empty list in shell for-loop

The $strategy_opts variable contains a space-separated list
of strategy options, each individually shell-quoted. To loop
over each, we "unwrap" them by doing an eval like:

eval '
for opt in '"$strategy_opts"'
do
...
done
'

Note the quoting that means we expand $strategy_opts inline
in the code to be evaluated (which is the right thing
because we want the IFS-split and de-quoting). If the
variable is empty, however, we ask the shell to eval the
following code:

for opt in
do
...
done

without anything between "in" and "do". Most modern shells
are happy to treat that like a noop, but reportedly ksh88 on
AIX considers it a syntax error. So let's catch the case
that the variable is empty and skip the eval altogether
(since we know the loop would be a noop anyway).

Reported-by: Armin Kunaschik <megabreit@googlemail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: build documentationLars Schneider Wed, 4 May 2016 08:38:36 +0000 (10:38 +0200)

travis-ci: build documentation

Build documentation as separate Travis CI job to check for
documentation errors.

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

fsck: detect and warn a commit with embedded NULJunio C Hamano Thu, 14 Apr 2016 17:58:22 +0000 (10:58 -0700)

fsck: detect and warn a commit with embedded NUL

Even though a Git commit object is designed to be capable of storing
any binary data as its payload, in practice people use it to describe
the changes in textual form, and tools like "git log" are designed to
treat the payload as text.

Detect and warn when we see any commit object with a NUL byte in
it.

Note that a NUL byte in the header part is already detected as a
grave error. This change is purely about the message part.

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

Documentation: fix linkgit referencesJunio C Hamano Wed, 4 May 2016 17:36:24 +0000 (10:36 -0700)

Documentation: fix linkgit references

There are a handful of incorrect "linkgit:<page>[<section>]"
instances in our documentation set.

* Some have an extra colon after "linkgit:"; fix them by removing
the extra colon;

* Some refer to a page outside the Git suite, namely curl(1); fix
them by using the `curl(1)` that already appears on the same page
for the same purpose of referring the readers to its manual page.

* Some spell the name of the page incorrectly, e.g. "rev-list" when
they mean "git-rev-list"; fix them.

* Some list the manual section incorrectly; fix them to make sure
they match what is at the top of the target of the link.

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

test-lib-functions.sh: rewrite test_seq without PerlJunio C Hamano Mon, 9 May 2016 19:37:01 +0000 (12:37 -0700)

test-lib-functions.sh: rewrite test_seq without Perl

Rewrite the 'seq' imitation using only commands and features that
are typically found built into modern POSIX shells, instead of
relying on Perl to run a single-liner script.

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

t4151: make sure argument to 'test -z' is givenArmin Kunaschik Mon, 9 May 2016 18:57:25 +0000 (11:57 -0700)

t4151: make sure argument to 'test -z' is given

88d50724 (am --skip: revert changes introduced by failed 3way merge,
2015-06-06), unlike all the other patches in the series, forgot to
quote the output from "$(git ls-files -u)" when using it as the
argument to "test -z", leading to a syntax error on platforms whose
test does not interpret "test -z" (no other arguments) as testing if
a string "-z" is the null string (which GNU test and test that is
built into bash and dash seem to do).

Note that $(git ls-files -u | wc -l) is deliberately left unquoted,
as some implementations of "wc -l" includes extra blank characters
in its output and cannot be compared as string, i.e. "test 0 = $(...)".

Signed-off-by: Armin Kunaschik <megabreit@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-lib-functions.sh: remove misleading comment on... Junio C Hamano Mon, 9 May 2016 18:36:09 +0000 (11:36 -0700)

test-lib-functions.sh: remove misleading comment on test_seq

We never used the "letters" form since we came up with "test_seq" to
replace use of non-portable "seq" in our test script, which we
introduced it at d17cf5f3 (tests: Introduce test_seq, 2012-08-04).

We use this helper to either iterate for N times (i.e. the values on
the lines do not even matter), or just to get N distinct strings
(i.e. the values on the lines themselves do not really matter, but
we care that they are different from each other and reproducible).

Stop promising that we may allow using "letters"; this would open an
easier reimplementation that does not rely on $PERL, if somebody
later wants to.

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

i18n: remote: add comment for translatorsVasco Almeida Sun, 8 May 2016 20:00:18 +0000 (20:00 +0000)

i18n: remote: add comment for translators

Add comment drawing translator attention in order to align "Push
URL:" and "Fetch URL:" fields translation of git remote show output.

Aligning both fields makes the output more appealing and easier to
grasp.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6041: do not compress backup tar fileStefan Beller Mon, 9 May 2016 17:09:08 +0000 (10:09 -0700)

t6041: do not compress backup tar file

The test uses the 'z' option, i.e. "compress the output while at
it", which is GNUism and not portable.

Reported-by: Armin Kunaschik <megabreit@googlemail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3513: do not compress backup tar fileStefan Beller Fri, 6 May 2016 18:37:05 +0000 (11:37 -0700)

t3513: do not compress backup tar file

The test uses the 'z' option, i.e. "compress the output while at
it", which is GNUism and not portable.

Reported-by: Armin Kunaschik <megabreit@googlemail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5601: Remove trailing space in sed expressionTorsten Bögershausen Mon, 9 May 2016 17:53:12 +0000 (19:53 +0200)

t5601: Remove trailing space in sed expression

The sed expression for IPv6, "Tested User And Host" or "tuah" used a wrong
sed expression, which doesn't work under all versions of sed.

Reported-By: Armin Kunaschik <megabreit@googlemail.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Almost ready for 2.8.3Junio C Hamano Fri, 6 May 2016 21:53:36 +0000 (14:53 -0700)

Almost ready for 2.8.3

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

Merge branch 'sb/submodule-path-misc-bugs' into maintJunio C Hamano Fri, 6 May 2016 21:53:24 +0000 (14:53 -0700)

Merge branch 'sb/submodule-path-misc-bugs' into maint

"git submodule" reports the paths of submodules the command
recurses into, but this was incorrect when the command was not run
from the root level of the superproject.

* sb/submodule-path-misc-bugs:
t7407: make expectation as clear as possible
submodule update: test recursive path reporting from subdirectory
submodule update: align reporting path for custom command execution
submodule status: correct path handling in recursive submodules
submodule update --init: correct path handling in recursive submodules
submodule foreach: correct path display in recursive submodules

Merge branch 'ky/imap-send-openssl-1.1.0' into maintJunio C Hamano Fri, 6 May 2016 21:53:24 +0000 (14:53 -0700)

Merge branch 'ky/imap-send-openssl-1.1.0' into maint

Upcoming OpenSSL 1.1.0 will break compilation b updating a few APIs
we use in imap-send, which has been adjusted for the change.

* ky/imap-send-openssl-1.1.0:
configure: remove checking for HMAC_CTX_cleanup
imap-send: avoid deprecated TLSv1_method()
imap-send: check NULL return of SSL_CTX_new()
imap-send: use HMAC() function provided by OpenSSL

Merge branch 'js/replace-edit-use-editor-configuration... Junio C Hamano Fri, 6 May 2016 21:53:24 +0000 (14:53 -0700)

Merge branch 'js/replace-edit-use-editor-configuration' into maint

"git replace -e" did not honour "core.editor" configuration.

* js/replace-edit-use-editor-configuration:
replace --edit: respect core.editor

Merge branch 'cc/apply' into maintJunio C Hamano Fri, 6 May 2016 21:53:23 +0000 (14:53 -0700)

Merge branch 'cc/apply' into maint

Minor code clean-up.

* cc/apply:
builtin/apply: free patch when parse_chunk() fails
builtin/apply: handle parse_binary() failure
apply: remove unused call to free() in gitdiff_{old,new}name()
builtin/apply: get rid of useless 'name' variable

Merge branch 'kn/for-each-tag-branch' into maintJunio C Hamano Fri, 6 May 2016 21:53:23 +0000 (14:53 -0700)

Merge branch 'kn/for-each-tag-branch' into maint

A minor documentation update.

* kn/for-each-tag-branch:
for-each-ref: fix description of '--contains' in manpage

typofix: assorted typofixes in comments, documentation... Li Peng Fri, 6 May 2016 12:36:46 +0000 (20:36 +0800)

typofix: assorted typofixes in comments, documentation and messages

Many instances of duplicate words (e.g. "the the path") and
a few typoes are fixed, originally in multiple patches.

wildmatch: fix duplicate words of "the"
t: fix duplicate words of "output"
transport-helper: fix duplicate words of "read"
Git.pm: fix duplicate words of "return"
path: fix duplicate words of "look"
pack-protocol.txt: fix duplicate words of "the"
precompose-utf8: fix typo of "sequences"
split-index: fix typo
worktree.c: fix typo
remote-ext: fix typo
utf8: fix duplicate words of "the"
git-cvsserver: fix duplicate words

Signed-off-by: Li Peng <lip@dtdream.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote.c: specify correct plural form in "commit diverg... Nguyễn Thái Ngọc Duy Tue, 3 May 2016 00:12:30 +0000 (07:12 +0700)

remote.c: specify correct plural form in "commit diverge" message

We need to count both "ours" and "theirs" commits when selecting plural
form for this message. Note that even though in this block, both ours
and theirs must be positive (i.e. can't be in singular form), we still
keep Q_(singular, plural) because languages other than English may have
more than one plural form.

Reported-by: Alfonsogonzalez, Ernesto (GE Digital) <ernesto.alfonsogonzalez@ge.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>