OSDN Git Service

git-core/git.git
6 years agoGit 2.13.6 v2.13.6
Junio C Hamano [Fri, 22 Sep 2017 05:49:24 +0000 (14:49 +0900)]
Git 2.13.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoSync with 2.12.5
Junio C Hamano [Fri, 22 Sep 2017 05:48:08 +0000 (14:48 +0900)]
Sync with 2.12.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoGit 2.12.5 v2.12.5
Junio C Hamano [Fri, 22 Sep 2017 05:47:41 +0000 (14:47 +0900)]
Git 2.12.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoSync with 2.11.4
Junio C Hamano [Fri, 22 Sep 2017 05:45:30 +0000 (14:45 +0900)]
Sync with 2.11.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoGit 2.11.4 v2.11.4
Junio C Hamano [Fri, 22 Sep 2017 05:44:45 +0000 (14:44 +0900)]
Git 2.11.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoSync with 2.10.5
Junio C Hamano [Fri, 22 Sep 2017 05:43:13 +0000 (14:43 +0900)]
Sync with 2.10.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoGit 2.10.5 v2.10.5
Junio C Hamano [Fri, 22 Sep 2017 05:42:22 +0000 (14:42 +0900)]
Git 2.10.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoMerge branch 'jk/safe-pipe-capture' into maint-2.10
Junio C Hamano [Fri, 22 Sep 2017 05:34:34 +0000 (14:34 +0900)]
Merge branch 'jk/safe-pipe-capture' into maint-2.10

6 years agoMerge branch 'jk/cvsimport-quoting' into maint-2.10
Junio C Hamano [Fri, 22 Sep 2017 05:34:34 +0000 (14:34 +0900)]
Merge branch 'jk/cvsimport-quoting' into maint-2.10

6 years agoMerge branch 'jc/cvsserver' into maint-2.10
Junio C Hamano [Fri, 22 Sep 2017 05:34:34 +0000 (14:34 +0900)]
Merge branch 'jc/cvsserver' into maint-2.10

6 years agoMerge branch 'jk/git-shell-drop-cvsserver' into maint-2.10
Junio C Hamano [Fri, 22 Sep 2017 05:34:34 +0000 (14:34 +0900)]
Merge branch 'jk/git-shell-drop-cvsserver' into maint-2.10

6 years agocvsimport: shell-quote variable used in backticks
Jeff King [Mon, 11 Sep 2017 14:24:26 +0000 (10:24 -0400)]
cvsimport: shell-quote variable used in backticks

We run `git rev-parse` though the shell, and quote its
argument only with single-quotes. This prevents most
metacharacters from being a problem, but misses the obvious
case when $name itself has single-quotes in it. We can fix
this by applying the usual shell-quoting formula.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoarchimport: use safe_pipe_capture for user input
Jeff King [Mon, 11 Sep 2017 14:24:11 +0000 (10:24 -0400)]
archimport: use safe_pipe_capture for user input

Refnames can contain shell metacharacters which need to be
passed verbatim to sub-processes. Using safe_pipe_capture
skips the shell entirely.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoshell: drop git-cvsserver support by default
Jeff King [Mon, 11 Sep 2017 15:27:51 +0000 (11:27 -0400)]
shell: drop git-cvsserver support by default

The git-cvsserver script is old and largely unmaintained
these days. But git-shell allows untrusted users to run it
out of the box, significantly increasing its attack surface.

Let's drop it from git-shell's list of internal handlers so
that it cannot be run by default.  This is not backwards
compatible. But given the age and development activity on
CVS-related parts of Git, this is likely to impact very few
users, while helping many more (i.e., anybody who runs
git-shell and had no intention of supporting CVS).

There's no configuration mechanism in git-shell for us to
add a boolean and flip it to "off". But there is a mechanism
for adding custom commands, and adding CVS support here is
fairly trivial. Let's document it to give guidance to
anybody who really is still running cvsserver.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agocvsserver: use safe_pipe_capture for `constant commands` as well
Junio C Hamano [Mon, 11 Sep 2017 05:45:54 +0000 (14:45 +0900)]
cvsserver: use safe_pipe_capture for `constant commands` as well

This is not strictly necessary, but it is a good code hygiene.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agocvsserver: use safe_pipe_capture instead of backticks
joernchen [Mon, 11 Sep 2017 05:45:09 +0000 (14:45 +0900)]
cvsserver: use safe_pipe_capture instead of backticks

This makes the script pass arguments that are derived from end-user
input in safer way when invoking subcommands.

Reported-by: joernchen <joernchen@phenoelit.de>
Signed-off-by: joernchen <joernchen@phenoelit.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agocvsserver: move safe_pipe_capture() to the main package
Junio C Hamano [Mon, 11 Sep 2017 05:44:24 +0000 (14:44 +0900)]
cvsserver: move safe_pipe_capture() to the main package

As a preparation for replacing `command` with a call to this
function from outside GITCVS::updater package, move it to the main
package.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoGit 2.13.5 v2.13.5
Junio C Hamano [Tue, 1 Aug 2017 19:30:00 +0000 (12:30 -0700)]
Git 2.13.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoMerge tag 'v2.12.4' into maint
Junio C Hamano [Tue, 1 Aug 2017 19:27:31 +0000 (12:27 -0700)]
Merge tag 'v2.12.4' into maint

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

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoPreparation for 2.13.4 continues
Junio C Hamano [Mon, 31 Jul 2017 20:52:40 +0000 (13:52 -0700)]
Preparation for 2.13.4 continues

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoMerge branch 'ks/doc-fixes' into maint
Junio C Hamano [Mon, 31 Jul 2017 20:51:06 +0000 (13:51 -0700)]
Merge branch 'ks/doc-fixes' into maint

Doc clean-up.

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

6 years agoMerge branch 'jk/test-copy-bytes-fix' into maint
Junio C Hamano [Mon, 31 Jul 2017 20:51:05 +0000 (13:51 -0700)]
Merge branch 'jk/test-copy-bytes-fix' into maint

A test fix.

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

6 years agoMerge branch 'pw/unquote-path-in-git-pm' into maint
Junio C Hamano [Mon, 31 Jul 2017 20:51:05 +0000 (13:51 -0700)]
Merge branch 'pw/unquote-path-in-git-pm' into maint

Code refactoring.

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

6 years agoMerge branch 'jk/gc-pre-detach-under-hook' into maint
Junio C Hamano [Mon, 31 Jul 2017 20:51:05 +0000 (13:51 -0700)]
Merge branch 'jk/gc-pre-detach-under-hook' into maint

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

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

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

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

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

6 years agoMerge branch 'rs/progress-overall-throughput-at-the-end' into maint
Junio C Hamano [Mon, 31 Jul 2017 20:51:04 +0000 (13:51 -0700)]
Merge branch 'rs/progress-overall-throughput-at-the-end' into maint

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

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

6 years agoMerge branch 'tb/push-to-cygwin-unc-path' into maint
Junio C Hamano [Mon, 31 Jul 2017 20:51:04 +0000 (13:51 -0700)]
Merge branch 'tb/push-to-cygwin-unc-path' into maint

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

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

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

6 years agoMerge branch 'rs/apply-avoid-over-reading' into maint
Junio C Hamano [Mon, 31 Jul 2017 20:51:04 +0000 (13:51 -0700)]
Merge branch 'rs/apply-avoid-over-reading' into maint

Code cleanup.

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

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

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoMerge tag 'v2.11.3' into maint-2.12
Junio C Hamano [Sun, 30 Jul 2017 22:04:22 +0000 (15:04 -0700)]
Merge tag 'v2.11.3' into maint-2.12

Git 2.11.3

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

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

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoMerge tag 'v2.10.4' into maint-2.11
Junio C Hamano [Sun, 30 Jul 2017 22:01:31 +0000 (15:01 -0700)]
Merge tag 'v2.10.4' into maint-2.11

Git 2.10.4

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

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoMerge tag 'v2.9.5' into maint-2.10
Junio C Hamano [Sun, 30 Jul 2017 21:57:33 +0000 (14:57 -0700)]
Merge tag 'v2.9.5' into maint-2.10

Git 2.9.5

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

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoMerge tag 'v2.8.6' into maint-2.9
Junio C Hamano [Sun, 30 Jul 2017 21:52:14 +0000 (14:52 -0700)]
Merge tag 'v2.8.6' into maint-2.9

Git 2.8.6

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

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoMerge tag 'v2.7.6' into maint-2.8
Junio C Hamano [Sun, 30 Jul 2017 21:46:43 +0000 (14:46 -0700)]
Merge tag 'v2.7.6' into maint-2.8

Git 2.7.6

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

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoMerge branch 'jk/ssh-funny-url' into maint-2.7
Junio C Hamano [Fri, 28 Jul 2017 23:11:54 +0000 (16:11 -0700)]
Merge branch 'jk/ssh-funny-url' into maint-2.7

6 years agoconnect: reject paths that look like command line options
Jeff King [Fri, 28 Jul 2017 19:28:55 +0000 (15:28 -0400)]
connect: reject paths that look like command line options

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

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

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoconnect: reject dashed arguments for proxy commands
Jeff King [Fri, 28 Jul 2017 19:26:50 +0000 (15:26 -0400)]
connect: reject dashed arguments for proxy commands

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

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

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

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

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

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

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoconnect: factor out "looks like command line option" check
Jeff King [Fri, 28 Jul 2017 19:25:45 +0000 (15:25 -0400)]
connect: factor out "looks like command line option" check

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

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agot5813: add test for hostname starting with dash
Jeff King [Fri, 28 Jul 2017 19:23:32 +0000 (15:23 -0400)]
t5813: add test for hostname starting with dash

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

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoconnect: reject ssh hostname that begins with a dash
Junio C Hamano [Wed, 26 Jul 2017 17:24:20 +0000 (10:24 -0700)]
connect: reject ssh hostname that begins with a dash

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

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

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

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

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

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

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

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

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

Noticed-by: Joern Schneeweisz of Recurity Labs
Reported-by: Brian at GitLab
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agot/lib-proto-disable: restore protocol.allow after config tests
Jeff King [Fri, 28 Jul 2017 21:47:48 +0000 (17:47 -0400)]
t/lib-proto-disable: restore protocol.allow after config tests

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

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

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

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

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

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

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agofixes from 'master' for 2.13.4
Junio C Hamano [Fri, 21 Jul 2017 22:06:09 +0000 (15:06 -0700)]
fixes from 'master' for 2.13.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoMerge branch 'ew/fd-cloexec-fix' into maint
Junio C Hamano [Fri, 21 Jul 2017 22:03:40 +0000 (15:03 -0700)]
Merge branch 'ew/fd-cloexec-fix' into maint

Portability/fallback fix.

* ew/fd-cloexec-fix:
  set FD_CLOEXEC properly when O_CLOEXEC is not supported

6 years agoMerge branch 'ks/fix-rebase-doc-picture' into maint
Junio C Hamano [Fri, 21 Jul 2017 22:03:39 +0000 (15:03 -0700)]
Merge branch 'ks/fix-rebase-doc-picture' into maint

Doc update.

* ks/fix-rebase-doc-picture:
  doc: correct a mistake in an illustration

6 years agoMerge branch 'js/alias-case-sensitivity' into maint
Junio C Hamano [Fri, 21 Jul 2017 22:03:38 +0000 (15:03 -0700)]
Merge branch 'js/alias-case-sensitivity' into maint

A recent update broke an alias that contained an uppercase letter.

* js/alias-case-sensitivity:
  alias: compare alias name *case-insensitively*
  t1300: demonstrate that CamelCased aliases regressed

6 years agoMerge branch 'bb/unicode-10.0' into maint
Junio C Hamano [Fri, 21 Jul 2017 22:03:38 +0000 (15:03 -0700)]
Merge branch 'bb/unicode-10.0' into maint

Update the character width tables.

* bb/unicode-10.0:
  unicode: update the width tables to Unicode 10

6 years agodoc: reformat the paragraph containing the 'cut-line'
Kaartic Sivaraam [Tue, 18 Jul 2017 14:34:27 +0000 (20:04 +0530)]
doc: reformat the paragraph containing the 'cut-line'

The paragraph that describes the 'scissors' cleanup mode of
'commit' had the 'cut-line' in the middle of a sentence. This
made it possible for the line to get wrapped on smaler windows.
This shouldn't be the case as it makes it hard for the user to
understand the structure of the cut-line.

Reformat the pragraph to make the 'cut-line' stand on a line of
it's own thus distinguishing it from the rest of the paragraph.
This further prevents it from getting wrapped to some extent.

Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agodoc: camelCase the i18n config variables to improve readability
Kaartic Sivaraam [Mon, 17 Jul 2017 15:39:00 +0000 (21:09 +0530)]
doc: camelCase the i18n config variables to improve readability

The i18n config variable used weren't readable as they were in
the crude form of how git stores/uses it's config variables.

Improve it's readability by replacing them with camelCased versions
of config variables as it doesn't have any impact on it's usage.

Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agot: handle EOF in test_copy_bytes()
Jeff King [Sun, 16 Jul 2017 10:45:32 +0000 (06:45 -0400)]
t: handle EOF in test_copy_bytes()

The test_copy_bytes() function claims to read up to N bytes,
or until it gets EOF. But we never handle EOF in our loop,
and a short input will cause perl to go into an infinite
loop of read() getting zero bytes.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoset FD_CLOEXEC properly when O_CLOEXEC is not supported
Eric Wong [Sat, 15 Jul 2017 18:55:40 +0000 (18:55 +0000)]
set FD_CLOEXEC properly when O_CLOEXEC is not supported

FD_CLOEXEC only applies to the file descriptor, so it needs to be
manipuluated via F_GETFD/F_SETFD.  F_GETFL/F_SETFL are for file
description flags.

Verified via strace with o_cloexec set to zero.

Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoalias: compare alias name *case-insensitively*
Johannes Schindelin [Fri, 14 Jul 2017 08:39:38 +0000 (10:39 +0200)]
alias: compare alias name *case-insensitively*

It is totally legitimate to add CamelCased aliases, but due to the way
config keys are compared, the case does not matter.

Therefore, we must compare the alias name insensitively to the config
keys.

This fixes a regression introduced by a9bcf6586d1 (alias: use
the early config machinery to expand aliases, 2017-06-14).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agot1300: demonstrate that CamelCased aliases regressed
Johannes Schindelin [Fri, 14 Jul 2017 08:39:29 +0000 (10:39 +0200)]
t1300: demonstrate that CamelCased aliases regressed

It is totally legitimate to add CamelCased aliases, but due to the way
config keys are compared, the case does not matter.

Except that now it does: the alias name is expected to be all
lower-case. This is a regression introduced by a9bcf6586d1 (alias: use
the early config machinery to expand aliases, 2017-06-14).

Noticed by Alejandro Pauly, diagnosed by Kevin Willford.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoGit 2.13.3 v2.13.3
Junio C Hamano [Wed, 12 Jul 2017 22:24:15 +0000 (15:24 -0700)]
Git 2.13.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoMerge branch 'kn/ref-filter-branch-list' into maint
Junio C Hamano [Wed, 12 Jul 2017 22:23:09 +0000 (15:23 -0700)]
Merge branch 'kn/ref-filter-branch-list' into maint

The rewrite of "git branch --list" using for-each-ref's internals
that happened in v2.13 regressed its handling of color.branch.local;
this has been fixed.

* kn/ref-filter-branch-list:
  ref-filter.c: drop return from void function
  branch: set remote color in ref-filter branch immediately
  branch: use BRANCH_COLOR_LOCAL in ref-filter format
  branch: only perform HEAD check for local branches

6 years agoMerge branch 'ks/typofix-commit-c-comment' into maint
Junio C Hamano [Wed, 12 Jul 2017 22:20:48 +0000 (15:20 -0700)]
Merge branch 'ks/typofix-commit-c-comment' into maint

Typofix.

* ks/typofix-commit-c-comment:
  builtin/commit.c: fix a typo in the comment

6 years agoMerge branch 'jk/reflog-walk-maint' into maint
Junio C Hamano [Wed, 12 Jul 2017 22:20:35 +0000 (15:20 -0700)]
Merge branch 'jk/reflog-walk-maint' into maint

After "git branch --move" of the currently checked out branch, the
code to walk the reflog of HEAD via "log -g" and friends
incorrectly stopped at the reflog entry that records the renaming
of the branch.

* jk/reflog-walk-maint:
  reflog-walk: include all fields when freeing complete_reflogs
  reflog-walk: don't free reflogs added to cache
  reflog-walk: duplicate strings in complete_reflogs list
  reflog-walk: skip over double-null oid due to HEAD rename

6 years agogc: run pre-detach operations under lock
Jeff King [Tue, 11 Jul 2017 09:06:35 +0000 (05:06 -0400)]
gc: run pre-detach operations under lock

We normally try to avoid having two auto-gc operations run
at the same time, because it wastes resources. This was done
long ago in 64a99eb47 (gc: reject if another gc is running,
unless --force is given, 2013-08-08).

When we do a detached auto-gc, we run the ref-related
commands _before_ detaching, to avoid confusing lock
contention. This was done by 62aad1849 (gc --auto: do not
lock refs in the background, 2014-05-25).

These two features do not interact well. The pre-detach
operations are run before we check the gc.pid lock, meaning
that on a busy repository we may run many of them
concurrently. Ideally we'd take the lock before spawning any
operations, and hold it for the duration of the program.

This is tricky, though, with the way the pid-file interacts
with the daemonize() process.  Other processes will check
that the pid recorded in the pid-file still exists. But
detaching causes us to fork and continue running under a
new pid. So if we take the lock before detaching, the
pid-file will have a bogus pid in it. We'd have to go back
and update it with the new pid after detaching. We'd also
have to play some tricks with the tempfile subsystem to
tweak the "owner" field, so that the parent process does not
clean it up on exit, but the child process does.

Instead, we can do something a bit simpler: take the lock
only for the duration of the pre-detach work, then detach,
then take it again for the post-detach work. Technically,
this means that the post-detach lock could lose to another
process doing pre-detach work. But in the long run this
works out.

That second process would then follow-up by doing
post-detach work. Unless it was in turn blocked by a third
process doing pre-detach work, and so on. This could in
theory go on indefinitely, as the pre-detach work does not
repack, and so need_to_gc() will continue to trigger.  But
in each round we are racing between the pre- and post-detach
locks. Eventually, one of the post-detach locks will win the
race and complete the full gc. So in the worst case, we may
racily repeat the pre-detach work, but we would never do so
simultaneously (it would happen via a sequence of serialized
race-wins).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agopre-rebase hook: capture documentation in a <<here document
Jonathan Nieder [Mon, 10 Jul 2017 23:35:25 +0000 (16:35 -0700)]
pre-rebase hook: capture documentation in a <<here document

Without this change, the sample hook does not pass a syntax check
(sh -n):

  $ sh -n hooks--pre-rebase.sample
  hooks--pre-rebase.sample: line 101: syntax error near unexpected token `('
  hooks--pre-rebase.sample: line 101: `   merged into it again (either directly or indirectly).'

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoPrepare for 2.13.3
Junio C Hamano [Mon, 10 Jul 2017 21:02:07 +0000 (14:02 -0700)]
Prepare for 2.13.3

6 years agoMerge branch 'sb/merge-recursive-code-cleanup' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:59:09 +0000 (13:59 -0700)]
Merge branch 'sb/merge-recursive-code-cleanup' into maint

Code clean-up.

* sb/merge-recursive-code-cleanup:
  merge-recursive: use DIFF_XDL_SET macro

6 years agoMerge branch 'jc/utf8-fprintf' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:59:08 +0000 (13:59 -0700)]
Merge branch 'jc/utf8-fprintf' into maint

Code cleanup.

* jc/utf8-fprintf:
  submodule--helper: do not call utf8_fprintf() unnecessarily

6 years agoMerge branch 'js/fsck-name-object' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:59:08 +0000 (13:59 -0700)]
Merge branch 'js/fsck-name-object' into maint

Test fix.

* js/fsck-name-object:
  t1450: use egrep for regexp "alternation"

6 years agoMerge branch 'js/t5534-rev-parse-gives-multi-line-output-fix' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:59:07 +0000 (13:59 -0700)]
Merge branch 'js/t5534-rev-parse-gives-multi-line-output-fix' into maint

A few tests that tried to verify the contents of push certificates
did not use 'git rev-parse' to formulate the line to look for in
the certificate correctly.

* js/t5534-rev-parse-gives-multi-line-output-fix:
  t5534: fix misleading grep invocation

6 years agoMerge branch 'ab/sha1dc-maint' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:59:06 +0000 (13:59 -0700)]
Merge branch 'ab/sha1dc-maint' into maint

Update the sha1dc again to fix portability glitches.

* ab/sha1dc-maint:
  sha1dc: update from upstream

6 years agoMerge branch 'aw/contrib-subtree-doc-asciidoctor' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:59:06 +0000 (13:59 -0700)]
Merge branch 'aw/contrib-subtree-doc-asciidoctor' into maint

The Makefile rule in contrib/subtree for building documentation
learned to honour USE_ASCIIDOCTOR just like the main documentation
set does.

* aw/contrib-subtree-doc-asciidoctor:
  subtree: honour USE_ASCIIDOCTOR when set

6 years agoMerge branch 'cc/shared-index-permfix' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:59:05 +0000 (13:59 -0700)]
Merge branch 'cc/shared-index-permfix' into maint

The split index code did not honor core.sharedrepository setting
correctly.

* cc/shared-index-permfix:
  t1700: make sure split-index respects core.sharedrepository
  t1301: move modebits() to test-lib-functions.sh
  read-cache: use shared perms when writing shared index

6 years agoMerge branch 'ah/doc-pretty-color-auto-prefix' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:59:05 +0000 (13:59 -0700)]
Merge branch 'ah/doc-pretty-color-auto-prefix' into maint

Doc update.

* ah/doc-pretty-color-auto-prefix:
  doc: clarify syntax for %C(auto,...) in pretty formats

6 years agoMerge branch 'mb/reword-autocomplete-message' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:59:04 +0000 (13:59 -0700)]
Merge branch 'mb/reword-autocomplete-message' into maint

Message update.

* mb/reword-autocomplete-message:
  auto-correct: tweak phrasing

6 years agoMerge branch 'ks/t7508-indent-fix' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:59:03 +0000 (13:59 -0700)]
Merge branch 'ks/t7508-indent-fix' into maint

Cosmetic update to a test.

* ks/t7508-indent-fix:
  t7508: fix a broken indentation

6 years agoMerge branch 'sb/t4005-modernize' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:59:02 +0000 (13:59 -0700)]
Merge branch 'sb/t4005-modernize' into maint

Test clean-up.

* sb/t4005-modernize:
  t4005: modernize style and drop hard coded sha1

6 years agoMerge branch 'rs/apply-validate-input' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:59:01 +0000 (13:59 -0700)]
Merge branch 'rs/apply-validate-input' into maint

Tighten error checks for invalid "git apply" input.

* rs/apply-validate-input:
  apply: check git diffs for mutually exclusive header lines
  apply: check git diffs for invalid file modes
  apply: check git diffs for missing old filenames

6 years agoMerge branch 'jc/pack-bitmap-unaligned' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:59:00 +0000 (13:59 -0700)]
Merge branch 'jc/pack-bitmap-unaligned' into maint

An unaligned 32-bit access in pack-bitmap code ahs been corrected.

* jc/pack-bitmap-unaligned:
  pack-bitmap: don't perform unaligned memory access

6 years agoMerge branch 'pw/rebase-i-regression-fix-tests' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:58:59 +0000 (13:58 -0700)]
Merge branch 'pw/rebase-i-regression-fix-tests' into maint

Fix a recent regression to "git rebase -i" and add tests that would
have caught it and others.

* pw/rebase-i-regression-fix-tests:
  t3420: fix under GETTEXT_POISON build
  rebase: add more regression tests for console output
  rebase: add regression tests for console output
  rebase -i: add test for reflog message
  sequencer: print autostash messages to stderr

6 years agoMerge branch 'jk/add-p-commentchar-fix' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:58:58 +0000 (13:58 -0700)]
Merge branch 'jk/add-p-commentchar-fix' into maint

"git add -p" were updated in 2.12 timeframe to cope with custom
core.commentchar but the implementation was buggy and a
metacharacter like $ and * did not work.

* jk/add-p-commentchar-fix:
  add--interactive: quote commentChar regex
  add--interactive: handle EOF in prompt_yesno

6 years agoMerge branch 'js/alias-early-config' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:58:57 +0000 (13:58 -0700)]
Merge branch 'js/alias-early-config' into maint

The code to pick up and execute command alias definition from the
configuration used to switch to the top of the working tree and
then come back when the expanded alias was executed, which was
unnecessarilyl complex.  Attempt to simplify the logic by using the
early-config mechanism that does not chdir around.

* js/alias-early-config:
  alias: use the early config machinery to expand aliases
  t7006: demonstrate a problem with aliases in subdirectories
  t1308: relax the test verifying that empty alias values are disallowed
  help: use early config when autocorrecting aliases
  config: report correct line number upon error
  discover_git_directory(): avoid setting invalid git_dir

6 years agoMerge branch 'rs/pretty-add-again' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:58:57 +0000 (13:58 -0700)]
Merge branch 'rs/pretty-add-again' into maint

The pretty-format specifiers like '%h', '%t', etc. had an
optimization that no longer works correctly.  In preparation/hope
of getting it correctly implemented, first discard the optimization
that is broken.

* rs/pretty-add-again:
  pretty: recalculate duplicate short hashes

6 years agoMerge branch 'ah/doc-gitattributes-empty-index' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:58:56 +0000 (13:58 -0700)]
Merge branch 'ah/doc-gitattributes-empty-index' into maint

An example in documentation that does not work in multi worktree
configuration has been corrected.

* ah/doc-gitattributes-empty-index:
  doc: do not use `rm .git/index` when normalizing line endings

6 years agoMerge branch 'da/mergetools-meld-output-opt-on-macos' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:58:56 +0000 (13:58 -0700)]
Merge branch 'da/mergetools-meld-output-opt-on-macos' into maint

"git mergetool" learned to work around a wrapper MacOS X adds
around underlying meld.

* da/mergetools-meld-output-opt-on-macos:
  mergetools/meld: improve compatibiilty with Meld on macOS X

6 years agoMerge branch 'jk/diff-highlight-module' into maint
Junio C Hamano [Mon, 10 Jul 2017 20:58:56 +0000 (13:58 -0700)]
Merge branch 'jk/diff-highlight-module' into maint

The 'diff-highlight' program (in contrib/) has been restructured
for easier reuse by an external project 'diff-so-fancy'.

* jk/diff-highlight-module:
  diff-highlight: split code into module

6 years agoref-filter.c: drop return from void function
Alejandro R. Sedeño [Mon, 10 Jul 2017 19:03:03 +0000 (15:03 -0400)]
ref-filter.c: drop return from void function

Sun's C compiler errors out on this pattern:

void foo() { ... }
void bar() { return foo(); }

Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agol10n: de.po: fix typo
Ralf Thielow [Mon, 10 Jul 2017 16:23:08 +0000 (18:23 +0200)]
l10n: de.po: fix typo

Reported-by: Andre Hinrichs <andre.hinrichs@gmx.de>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agodoc: correct a mistake in an illustration
Kaartic Sivaraam [Mon, 10 Jul 2017 14:18:30 +0000 (19:48 +0530)]
doc: correct a mistake in an illustration

The first illustration of the "RECOVERING FROM UPSTREAM REBASE"
section in the 'git-rebase' documentation meant to depict that
there are number of commits on the 'master' branch, but it is
longer than the 'master' branch in the following illustrations
by one commit, even though there is no resetting of 'master' to
lose that commit.

Correct it.

Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoprogress: show overall rate in last update
René Scharfe [Sat, 8 Jul 2017 16:43:42 +0000 (18:43 +0200)]
progress: show overall rate in last update

The values in struct throughput are only updated every 0.5 seconds.  If
we're all done before that time span then the final update will show a
rate of 0 bytes/s, which is misleading if some bytes had been handled.
Remember the start time and show the total throughput instead.

And avoid division by zero by enforcing a minimum time span value of 1
(unit: 1/1024th of a second).  That makes the resulting rate an
underestimation, but it's closer to the actual value than the currently
shown 0 bytes/s.

Reported-by: 積丹尼 Dan Jacobson <jidanni@jidanni.org>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoapply: use strcmp(3) for comparing strings in gitdiff_verify_name()
René Scharfe [Sat, 8 Jul 2017 08:58:42 +0000 (10:58 +0200)]
apply: use strcmp(3) for comparing strings in gitdiff_verify_name()

We don't know the length of the C string "another".  It could be
shorter than "name", which we compare it to using memchr(3).  Call
strcmp(3) instead to avoid running over the end of the former, and
get rid of a strlen(3) call as a bonus.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agobranch: set remote color in ref-filter branch immediately
Jeff King [Sun, 9 Jul 2017 10:00:45 +0000 (06:00 -0400)]
branch: set remote color in ref-filter branch immediately

We set the current and local branch colors at the top of the
build_format() function. Let's do the same for the remote
color. This saves a little bit of repetition, but more
importantly it puts all of the color-setting in the same
place. That makes it easier to see that we are coloring all
possibilities.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agobranch: use BRANCH_COLOR_LOCAL in ref-filter format
Jeff King [Sun, 9 Jul 2017 09:59:33 +0000 (05:59 -0400)]
branch: use BRANCH_COLOR_LOCAL in ref-filter format

Since 949af0684 (branch: use ref-filter printing APIs,
2017-01-10), git-branch's output is generated by passing a
custom format to the ref-filter code. This format forgot to
pass BRANCH_COLOR_LOCAL, meaning that local branches
(besides the current one) were never colored at all.

We can add it in the %(if) block where we decide whether the
branch is "current" or merely "local".  Note that this means
the current/local coloring is either/or. You can't set:

  [color "branch"]
  local = blue
  current = bold

and expect the current branch to be "bold blue". This
matches the pre-949af0684 behavior.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agobranch: only perform HEAD check for local branches
Jeff King [Sun, 9 Jul 2017 09:58:10 +0000 (05:58 -0400)]
branch: only perform HEAD check for local branches

When assembling the ref-filter format to show "git branch"
output, we put the "%(if)%(HEAD)" conditional at the start
of the overall format. But there's no point in checking
whether a remote branch matches HEAD, as it never will.
The check should go inside the local conditional; we
assemble that format inside the "local" strbuf.

By itself, this is just a minor optimization. But in a
future patch, we'll need this refactoring to fix
local-branch coloring.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agounicode: update the width tables to Unicode 10
Beat Bolli [Fri, 7 Jul 2017 12:08:44 +0000 (14:08 +0200)]
unicode: update the width tables to Unicode 10

Now that Unicode 10 has been announced[0], update the character
width tables to the new version.

[0] http://blog.unicode.org/2017/06/announcing-unicode-standard-version-100.html

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoreflog-walk: include all fields when freeing complete_reflogs
Jeff King [Fri, 7 Jul 2017 08:43:16 +0000 (04:43 -0400)]
reflog-walk: include all fields when freeing complete_reflogs

When we encounter an error adding reflogs for a walk, we try
to free any logs we have read. But we didn't free all
fields, meaning that we could in theory leak all of the
"items" array (which would consitute the bulk of the
allocated memory).

This patch adds a helper which frees all of the entries and
uses it as appropriate.

As it turns out, the leak seems impossible to trigger with
the current code. Of the three error paths that free the
complete_reflogs struct, two only kick in when the items
array is empty, and the third was removed entirely in the
previous commit.

So this patch should be a noop in terms of behavior, but it
fixes a potential maintenance headache should anybody add a
new error path and copy the partial-free code. Which is
what happened in 5026b47175 (add_reflog_for_walk: avoid
memory leak, 2017-05-04), though its leaky call was the
third one that was recently removed.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoreflog-walk: don't free reflogs added to cache
Jeff King [Fri, 7 Jul 2017 08:41:49 +0000 (04:41 -0400)]
reflog-walk: don't free reflogs added to cache

The add_reflog_for_walk() function keeps a cache mapping
refnames to their reflog contents. We use a cached reflog
entry if available, and otherwise allocate and store a new
one.

Since 5026b47175 (add_reflog_for_walk: avoid memory leak,
2017-05-04), when we hit an error parsing a date-based
reflog spec, we free the reflog memory but leave the cache
entry pointing to the now-freed memory.

We can fix this by just leaving the memory intact once it
has made it into the cache. This may leave an unused entry
in the cache, but that's OK. And it means we also catch a
similar situation: we may not have allocated at all in this
invocation, but simply be pointing to a cached entry from a
previous invocation (which is relying on that entry being
present).

The new test in t1411 exercises this case and fails when run
with --valgrind or ASan.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoreflog-walk: duplicate strings in complete_reflogs list
Jeff King [Fri, 7 Jul 2017 08:39:50 +0000 (04:39 -0400)]
reflog-walk: duplicate strings in complete_reflogs list

As part of the add_reflog_to_walk() function, we keep a
string_list mapping refnames to their reflog contents. This
serves as a cache so that accessing the same reflog twice
requires only a single copy of the log in memory.

The string_list is initialized via xcalloc, meaning its
strdup_strings field is set to 0. But after inserting a
string into the list, we unconditionally call free() on the
string, leaving the list pointing to freed memory. If
another reflog is added (e.g., "git log -g HEAD HEAD"), then
the second one may have unpredictable results.

The extra free was added by 5026b47175 (add_reflog_for_walk:
avoid memory leak, 2017-05-04). Though if you look
carefully, you can see that the code was buggy even before
then. If we tried to read the reflogs by time but came up
with no entries, we exited with an error, freeing the string
in that code path. So the bug was harder to trigger, but
still there.

We can fix it by just asking the string list to make a copy
of the string. Technically we could fix the problem by not
calling free() on our string (and just handing over
ownership to the string list), but there are enough
conditionals that it's quite hard to figure out which code
paths need the free and which do not. Simpler is better
here.

The new test reliably shows the problem when run with
--valgrind or ASAN.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agobuiltin/commit.c: fix a typo in the comment
Kaartic Sivaraam [Thu, 6 Jul 2017 03:19:57 +0000 (08:49 +0530)]
builtin/commit.c: fix a typo in the comment

Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agocygwin: allow pushing to UNC paths
Torsten Bögershausen [Mon, 3 Jul 2017 14:41:37 +0000 (16:41 +0200)]
cygwin: allow pushing to UNC paths

 cygwin can use an UNC path like //server/share/repo

 $ cd //server/share/dir
 $ mkdir test
 $ cd test
 $ git init --bare

 However, when we try to push from a local Git repository to this repo,
 there is a problem: Git converts the leading "//" into a single "/".

 As cygwin handles an UNC path so well, Git can support them better:

 - Introduce cygwin_offset_1st_component() which keeps the leading "//",
   similar to what Git for Windows does.

 - Move CYGWIN out of the POSIX in the tests for path normalization in t0060

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