]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
8 years agorefs: move head_ref{,_submodule} to the common code
David Turner [Thu, 7 Apr 2016 19:02:48 +0000 (15:02 -0400)] 
refs: move head_ref{,_submodule} to the common code

These don't use any backend-specific functions.  These were previously
defined in terms of the do_head_ref helper function, but since they
are otherwise identical, we don't need that function.

Signed-off-by: David Turner <dturner@twopensource.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoverify_repository_format: mark messages for translation
Jeff King [Fri, 11 Mar 2016 22:37:22 +0000 (17:37 -0500)] 
verify_repository_format: mark messages for translation

These messages are human-readable and should be translated.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agosetup: drop repository_format_version global
Jeff King [Fri, 11 Mar 2016 22:37:18 +0000 (17:37 -0500)] 
setup: drop repository_format_version global

Nobody reads this anymore, and they're not likely to; the
interesting thing is whether or not we passed
check_repository_format(), and possibly the individual
"extension" variables.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agosetup: unify repository version callbacks
Jeff King [Fri, 11 Mar 2016 22:37:14 +0000 (17:37 -0500)] 
setup: unify repository version callbacks

Once upon a time, check_repository_format_gently would parse
the config with a single callback, and that callback would
set up a bunch of global variables. But now that we have
separate workdirs, we have to be more careful. Commit
31e26eb (setup.c: support multi-checkout repo setup,
2014-11-30) introduced a reduced callback which omits some
values like core.worktree. In the "main" callback we call
the reduced one, and then add back in the missing variables.

Now that we have split the config-parsing from the munging
of the global variables, we can do it all with a single
callback, and keep all of the "are we in a separate workdir"
logic together.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoinit: use setup.c's repo version verification
Jeff King [Fri, 11 Mar 2016 22:37:11 +0000 (17:37 -0500)] 
init: use setup.c's repo version verification

We check our templates to make sure they are from a
version of git we understand (otherwise we would init a
repository we cannot ourselves run in!). But our simple
integer check has fallen behind the times. Let's use the
helpers that setup.c provides to do it right.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agosetup: refactor repo format reading and verification
Jeff King [Fri, 11 Mar 2016 22:37:07 +0000 (17:37 -0500)] 
setup: refactor repo format reading and verification

When we want to know if we're in a git repository of
reasonable vintage, we can call check_repository_format_gently(),
which does three things:

  1. Reads the config from the .git/config file.

  2. Verifies that the version info we read is sane.

  3. Writes some global variables based on this.

There are a few things we could improve here.

One is that steps 1 and 3 happen together. So if the
verification in step 2 fails, we still clobber the global
variables. This is especially bad if we go on to try another
repository directory; we may end up with a state of mixed
config variables.

The second is there's no way to ask about the repository
version for anything besides the main repository we're in.
git-init wants to do this, and it's possible that we would
want to start doing so for submodules (e.g., to find out
which ref backend they're using).

We can improve both by splitting the first two steps into
separate functions. Now check_repository_format_gently()
calls out to steps 1 and 2, and does 3 only if step 2
succeeds.

Note that the public interface for read_repository_format()
and what check_repository_format_gently() needs from it are
not quite the same, leading us to have an extra
read_repository_format_1() helper. The extra needs from
check_repository_format_gently() will go away in a future
patch, and we can simplify this then to just the public
interface.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoconfig: drop git_config_early
Jeff King [Fri, 11 Mar 2016 22:37:03 +0000 (17:37 -0500)] 
config: drop git_config_early

There are no more callers, and it's a rather confusing
interface. This could just be folded into
git_config_with_options(), but for the sake of readability,
we'll leave it as a separate (static) helper function.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agocheck_repository_format_gently: stop using git_config_early
Jeff King [Fri, 11 Mar 2016 22:36:59 +0000 (17:36 -0500)] 
check_repository_format_gently: stop using git_config_early

There's a chicken-and-egg problem with using the regular
git_config during the repository setup process. We get
around it here by using a special interface that lets us
specify the per-repo config, and avoid calling
git_pathdup().

But this interface doesn't actually make sense. It will look
in the system and per-user config, too; we definitely would
not want to accept a core.repositoryformatversion from
there.

The git_config_from_file interface is a better match, as it
lets us look at a single file.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agolazily load core.sharedrepository
Jeff King [Fri, 11 Mar 2016 22:36:53 +0000 (17:36 -0500)] 
lazily load core.sharedrepository

The "shared_repository" config is loaded as part of
check_repository_format_version, but it's not quite like the
other values we check there. Something like
core.repositoryformatversion only makes sense in per-repo
config, but core.sharedrepository can be set in a per-user
config (e.g., to make all "git init" invocations shared by
default).

So it would make more sense as part of git_default_config.
Commit 457f06d (Introduce core.sharedrepository, 2005-12-22)
says:

  [...]the config variable is set in the function which
  checks the repository format. If this were done in
  git_default_config instead, a lot of programs would need
  to be modified to call git_config(git_default_config)
  first.

This is still the case today, but we have one extra trick up
our sleeve. Now that we have the git_configset
infrastructure, it's not so expensive for us to ask for a
single value. So we can simply lazy-load it on demand.

This should be OK to do in general. There are some problems
with loading config before setup_git_directory() is called,
but we shouldn't be accessing the value before then (if we
were, then it would already be broken, as the variable would
not have been set by check_repository_format_version!). The
trickiest caller is git-init, but it handles the values
manually itself.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agowrap shared_repository global in get/set accessors
Jeff King [Fri, 11 Mar 2016 22:36:49 +0000 (17:36 -0500)] 
wrap shared_repository global in get/set accessors

It would be useful to control access to the global
shared_repository, so that we can lazily load its config.
The first step to doing so is to make sure all access
goes through a set of functions.

This step is purely mechanical, and should result in no
change of behavior.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agosetup: document check_repository_format()
Jeff King [Fri, 11 Mar 2016 22:36:45 +0000 (17:36 -0500)] 
setup: document check_repository_format()

This function's interface is rather enigmatic, so let's
document it further.

While we're here, let's also drop the return value. It will
always either be "0" or the function will die (consequently,
neither of its two callers bothered to check the return).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoGit 2.8-rc1 v2.8.0-rc1
Junio C Hamano [Fri, 4 Mar 2016 21:48:55 +0000 (13:48 -0800)] 
Git 2.8-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'nd/clear-gitenv-upon-use-of-alias'
Junio C Hamano [Fri, 4 Mar 2016 21:46:44 +0000 (13:46 -0800)] 
Merge branch 'nd/clear-gitenv-upon-use-of-alias'

Hotfix for a test breakage made between 2.7 and 'master'.

* nd/clear-gitenv-upon-use-of-alias:
  t0001: fix GIT_* environment variable check under --valgrind

8 years agoMerge branch 'js/pthread-exit-emu-windows'
Junio C Hamano [Fri, 4 Mar 2016 21:46:39 +0000 (13:46 -0800)] 
Merge branch 'js/pthread-exit-emu-windows'

* js/pthread-exit-emu-windows:
  Mark win32's pthread_exit() as NORETURN

8 years agoMerge branch 'sb/submodule-parallel-fetch'
Junio C Hamano [Fri, 4 Mar 2016 21:46:30 +0000 (13:46 -0800)] 
Merge branch 'sb/submodule-parallel-fetch'

Simplify the two callback functions that are triggered when the
child process terminates to avoid misuse of the child-process
structure that has already been cleaned up.

* sb/submodule-parallel-fetch:
  run-command: do not pass child process data into callbacks

8 years agoMerge branch 'jk/tighten-alloc'
Junio C Hamano [Fri, 4 Mar 2016 21:46:25 +0000 (13:46 -0800)] 
Merge branch 'jk/tighten-alloc'

* jk/tighten-alloc:
  compat/mingw: brown paper bag fix for 50a6c8e

8 years agoMerge branch 'nd/i18n-2.8.0'
Junio C Hamano [Fri, 4 Mar 2016 21:46:20 +0000 (13:46 -0800)] 
Merge branch 'nd/i18n-2.8.0'

* nd/i18n-2.8.0:
  trailer.c: mark strings for translation
  ref-filter.c: mark strings for translation
  builtin/clone.c: mark strings for translation
  builtin/checkout.c: mark strings for translation

8 years agoMerge branch 'tb/avoid-gcc-on-darwin-10-6'
Junio C Hamano [Fri, 4 Mar 2016 21:46:08 +0000 (13:46 -0800)] 
Merge branch 'tb/avoid-gcc-on-darwin-10-6'

Out-of-maintenance gcc on OSX 10.6 fails to compile the code in
'master'; work it around by using clang by default on the platform.

* tb/avoid-gcc-on-darwin-10-6:
  config.mak.uname: use clang for Mac OS X 10.6

8 years agoMerge branch 'jk/pack-idx-corruption-safety'
Junio C Hamano [Fri, 4 Mar 2016 21:45:46 +0000 (13:45 -0800)] 
Merge branch 'jk/pack-idx-corruption-safety'

The code to read the pack data using the offsets stored in the pack
idx file has been made more carefully check the validity of the
data in the idx.

* jk/pack-idx-corruption-safety:
  sha1_file.c: mark strings for translation
  use_pack: handle signed off_t overflow
  nth_packed_object_offset: bounds-check extended offset
  t5313: test bounds-checks of corrupted/malicious pack/idx files

8 years agoMerge branch 'mg/httpd-tests-update-for-apache-2.4'
Junio C Hamano [Fri, 4 Mar 2016 21:45:42 +0000 (13:45 -0800)] 
Merge branch 'mg/httpd-tests-update-for-apache-2.4'

The way the test scripts configure the Apache web server has been
updated to work also for Apache 2.4 running on RedHat derived
distros.

* mg/httpd-tests-update-for-apache-2.4:
  t/lib-httpd: load mod_unixd

8 years agoMerge branch 'js/mingw-tests'
Junio C Hamano [Fri, 4 Mar 2016 18:14:39 +0000 (10:14 -0800)] 
Merge branch 'js/mingw-tests'

* js/mingw-tests:
  t9700: fix test for perl older than 5.14

8 years agot9700: fix test for perl older than 5.14
Jeff King [Fri, 4 Mar 2016 11:43:21 +0000 (06:43 -0500)] 
t9700: fix test for perl older than 5.14

Commit d53c2c6 (mingw: fix t9700's assumption about
directory separators, 2016-01-27) uses perl's "/r" regex
modifier to do a non-destructive replacement on a string,
leaving the original unmodified and returning the result.

This feature was introduced in perl 5.14, but systems with
older perl are still common (e.g., CentOS 6.5 still has perl
5.10). Let's work around it by providing a helper function
that does the same thing using older syntax.

While we're at it, let's switch to using an alternate regex
separator, which is slightly more readable.

Reported-by: Christian Couder <christian.couder@gmail.com>
Helped-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agodocumentation: fix some typos
Thomas Ackermann [Thu, 3 Mar 2016 18:43:51 +0000 (19:43 +0100)] 
documentation: fix some typos

Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot0001: fix GIT_* environment variable check under --valgrind
Johannes Sixt [Thu, 3 Mar 2016 06:55:17 +0000 (07:55 +0100)] 
t0001: fix GIT_* environment variable check under --valgrind

When a test case is run without --valgrind, the wrap-for-bin.sh
helper script inserts the environment variable GIT_TEXTDOMAINDIR, but
when run with --valgrind, the variable is missing. A recently
introduced test case expects the presence of the variable, though, and
fails under --valgrind.

Rewrite the test case to strip conditially defined environment variables
from both expected and actual output.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMark win32's pthread_exit() as NORETURN
Johannes Schindelin [Wed, 2 Mar 2016 19:11:13 +0000 (20:11 +0100)] 
Mark win32's pthread_exit() as NORETURN

The pthread_exit() function is not expected to return. Ever. On Windows,
we call ExitThread() whose documentation claims: "Ends the calling
thread", i.e. there is no condition in which this function simply
returns: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682659

While at it, fix the return type to be void, as per
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_exit.html

Pointed out by Jeff King, helped by Stefan Naewe, Junio Hamano &
Johannes Sixt.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agorun-command: do not pass child process data into callbacks
Stefan Beller [Mon, 29 Feb 2016 21:57:06 +0000 (13:57 -0800)] 
run-command: do not pass child process data into callbacks

The expected way to pass data into the callback is to pass them via
the customizable callback pointer. The error reporting in
default_{start_failure, task_finished} is not user friendly enough, that
we want to encourage using the child data for such purposes.

Furthermore the struct child data is cleaned by the run-command API,
before we access them in the callbacks, leading to use-after-free
situations.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agotrailer.c: mark strings for translation
Nguyễn Thái Ngọc Duy [Sat, 27 Feb 2016 06:42:10 +0000 (13:42 +0700)] 
trailer.c: mark strings for translation

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoref-filter.c: mark strings for translation
Nguyễn Thái Ngọc Duy [Sat, 27 Feb 2016 06:42:04 +0000 (13:42 +0700)] 
ref-filter.c: mark strings for translation

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agobuiltin/clone.c: mark strings for translation
Nguyễn Thái Ngọc Duy [Sat, 27 Feb 2016 06:41:55 +0000 (13:41 +0700)] 
builtin/clone.c: mark strings for translation

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agobuiltin/checkout.c: mark strings for translation
Nguyễn Thái Ngọc Duy [Sat, 27 Feb 2016 06:41:54 +0000 (13:41 +0700)] 
builtin/checkout.c: mark strings for translation

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agocompat/mingw: brown paper bag fix for 50a6c8e
Jeff King [Mon, 29 Feb 2016 10:02:59 +0000 (05:02 -0500)] 
compat/mingw: brown paper bag fix for 50a6c8e

Commit 50a6c8e (use st_add and st_mult for allocation size
computation, 2016-02-22) fixed up many xmalloc call-sites
including ones in compat/mingw.c.

But I screwed up one of them, which was half-converted to
ALLOC_ARRAY, using a very early prototype of the function.
And I never caught it because I don't build on Windows.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoconfig.mak.uname: use clang for Mac OS X 10.6
Torsten Bögershausen [Sun, 28 Feb 2016 20:09:44 +0000 (21:09 +0100)] 
config.mak.uname: use clang for Mac OS X 10.6

Gcc under Mac OX 10.6 throws an internal compiler error:

CC combine-diff.o
    combine-diff.c: In function ‘diff_tree_combined’:
    combine-diff.c:1391: internal compiler error: Segmentation fault

while attempting to build Git at 5b442c4f (tree-diff: catch integer
overflow in combine_diff_path allocation, 2016-02-19).

As clang that ships with the version does not have the same bug,
make Git compile under Mac OS X 10.6 by using clang instead of gcc
to work this around, as it is unlikely that we will see fixed GCC
on that platform.

Later versions of Mac OSX/Xcode only provide clang, and gcc is a
wrapper to it.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agosha1_file.c: mark strings for translation
Nguyễn Thái Ngọc Duy [Sat, 27 Feb 2016 07:49:33 +0000 (14:49 +0700)] 
sha1_file.c: mark strings for translation

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoGit 2.8-rc0 v2.8.0-rc0
Junio C Hamano [Fri, 26 Feb 2016 21:45:26 +0000 (13:45 -0800)] 
Git 2.8-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'mm/readme-markdown'
Junio C Hamano [Fri, 26 Feb 2016 21:37:28 +0000 (13:37 -0800)] 
Merge branch 'mm/readme-markdown'

README has been renamed to README.md and its contents got tweaked
slightly to make it easier on the eyes.

* mm/readme-markdown:
  README.md: move down historical explanation about the name
  README.md: don't call git stupid in the title
  README.md: move the link to git-scm.com up
  README.md: add hyperlinks on filenames
  README: use markdown syntax

8 years agoMerge branch 'ma/update-hooks-sample-typofix'
Junio C Hamano [Fri, 26 Feb 2016 21:37:28 +0000 (13:37 -0800)] 
Merge branch 'ma/update-hooks-sample-typofix'

* ma/update-hooks-sample-typofix:
  templates/hooks: fix minor typo in the sample update-hook

8 years agoMerge branch 'ls/makefile-cflags-developer-tweak'
Junio C Hamano [Fri, 26 Feb 2016 21:37:27 +0000 (13:37 -0800)] 
Merge branch 'ls/makefile-cflags-developer-tweak'

There is a new DEVELOPER knob that enables many compiler warning
options in the Makefile.

* ls/makefile-cflags-developer-tweak:
  add DEVELOPER makefile knob to check for acknowledged warnings

8 years agoMerge branch 'dt/initial-ref-xn-commit-doc'
Junio C Hamano [Fri, 26 Feb 2016 21:37:27 +0000 (13:37 -0800)] 
Merge branch 'dt/initial-ref-xn-commit-doc'

* dt/initial-ref-xn-commit-doc:
  refs: document transaction semantics

8 years agoMerge branch 'js/config-set-in-non-repository'
Junio C Hamano [Fri, 26 Feb 2016 21:37:26 +0000 (13:37 -0800)] 
Merge branch 'js/config-set-in-non-repository'

"git config section.var value" to set a value in per-repository
configuration file failed when it was run outside any repository,
but didn't say the reason correctly.

* js/config-set-in-non-repository:
  git config: report when trying to modify a non-existing repo config

8 years agoMerge branch 'jk/epipe-in-async'
Junio C Hamano [Fri, 26 Feb 2016 21:37:26 +0000 (13:37 -0800)] 
Merge branch 'jk/epipe-in-async'

Handling of errors while writing into our internal asynchronous
process has been made more robust, which reduces flakiness in our
tests.

* jk/epipe-in-async:
  t5504: handle expected output from SIGPIPE death
  test_must_fail: report number of unexpected signal
  fetch-pack: ignore SIGPIPE in sideband demuxer
  write_or_die: handle EPIPE in async threads

8 years agoMerge branch 'mm/push-default-warning'
Junio C Hamano [Fri, 26 Feb 2016 21:37:25 +0000 (13:37 -0800)] 
Merge branch 'mm/push-default-warning'

Across the transition at around Git version 2.0, the user used to
get a pretty loud warning when running "git push" without setting
push.default configuration variable.  We no longer warn, given that
the transition is over long time ago.

* mm/push-default-warning:
  push: remove "push.default is unset" warning message

8 years agoMerge branch 'fa/merge-recursive-no-rename'
Junio C Hamano [Fri, 26 Feb 2016 21:37:25 +0000 (13:37 -0800)] 
Merge branch 'fa/merge-recursive-no-rename'

"git merge-recursive" learned "--no-renames" option to disable its
rename detection logic.

* fa/merge-recursive-no-rename:
  t3034: test deprecated interface
  t3034: test option to disable renames
  t3034: add rename threshold tests
  merge-recursive: find-renames resets threshold
  merge-strategies.txt: fix typo
  merge-recursive: more consistent interface
  merge-recursive: option to disable renames

8 years agoMerge branch 'sb/submodule-fetch-nontip'
Junio C Hamano [Fri, 26 Feb 2016 21:37:24 +0000 (13:37 -0800)] 
Merge branch 'sb/submodule-fetch-nontip'

When "git submodule update" did not result in fetching the commit
object in the submodule that is referenced by the superproject, the
command learned to retry another fetch, specifically asking for
that commit that may not be connected to the refs it usually
fetches.

* sb/submodule-fetch-nontip:
  submodule: try harder to fetch needed sha1 by direct fetching sha1

8 years agoMerge branch 'sb/submodule-module-list-fix'
Junio C Hamano [Fri, 26 Feb 2016 21:37:24 +0000 (13:37 -0800)] 
Merge branch 'sb/submodule-module-list-fix'

A helper function "git submodule" uses since v2.7.0 to list the
modules that match the pathspec argument given to its subcommands
(e.g. "submodule add <repo> <path>") has been fixed.

* sb/submodule-module-list-fix:
  submodule helper list: respect correct path prefix

8 years agoMerge branch 'tb/conversion'
Junio C Hamano [Fri, 26 Feb 2016 21:37:23 +0000 (13:37 -0800)] 
Merge branch 'tb/conversion'

Code simplification.

* tb/conversion:
  convert.c: correct attr_action()
  convert.c: simplify text_stat
  convert.c: refactor crlf_action
  convert.c: use text_eol_is_crlf()
  convert.c: remove input_crlf_action()
  convert.c: remove unused parameter 'path'
  t0027: add tests for get_stream_filter()

8 years agoMerge branch 'jk/grep-binary-workaround-in-test'
Junio C Hamano [Fri, 26 Feb 2016 21:37:23 +0000 (13:37 -0800)] 
Merge branch 'jk/grep-binary-workaround-in-test'

Recent versions of GNU grep are pickier when their input contains
arbitrary binary data, which some of our tests uses.  Rewrite the
tests to sidestep the problem.

* jk/grep-binary-workaround-in-test:
  t9200: avoid grep on non-ASCII data
  t8005: avoid grep on non-ASCII data

8 years agoMerge branch 'ps/plug-xdl-merge-leak'
Junio C Hamano [Fri, 26 Feb 2016 21:37:22 +0000 (13:37 -0800)] 
Merge branch 'ps/plug-xdl-merge-leak'

* ps/plug-xdl-merge-leak:
  xdiff/xmerge: fix memory leak in xdl_merge

8 years agoMerge branch 'mm/push-simple-doc'
Junio C Hamano [Fri, 26 Feb 2016 21:37:21 +0000 (13:37 -0800)] 
Merge branch 'mm/push-simple-doc'

The documentation did not clearly state that the 'simple' mode is
now the default for "git push" when push.default configuration is
not set.

* mm/push-simple-doc:
  Documentation/git-push: document that 'simple' is the default

8 years agoMerge branch 'jg/credential-cache-chdir-to-sockdir'
Junio C Hamano [Fri, 26 Feb 2016 21:37:20 +0000 (13:37 -0800)] 
Merge branch 'jg/credential-cache-chdir-to-sockdir'

The "credential-cache" daemon process used to run in whatever
directory it happened to start in, but this made umount(2)ing the
filesystem that houses the repository harder; now the process
chdir()s to the directory that house its own socket on startup.

* jg/credential-cache-chdir-to-sockdir:
  credential-cache--daemon: change to the socket dir on startup
  credential-cache--daemon: disallow relative socket path
  credential-cache--daemon: refactor check_socket_directory

8 years agoMerge branch 'ps/config-error'
Junio C Hamano [Fri, 26 Feb 2016 21:37:19 +0000 (13:37 -0800)] 
Merge branch 'ps/config-error'

Many codepaths forget to check return value from git_config_set();
the function is made to die() to make sure we do not proceed when
setting a configuration variable failed.

* ps/config-error:
  config: rename git_config_set_or_die to git_config_set
  config: rename git_config_set to git_config_set_gently
  compat: die when unable to set core.precomposeunicode
  sequencer: die on config error when saving replay opts
  init-db: die on config errors when initializing empty repo
  clone: die on config error in cmd_clone
  remote: die on config error when manipulating remotes
  remote: die on config error when setting/adding branches
  remote: die on config error when setting URL
  submodule--helper: die on config error when cloning module
  submodule: die on config error when linking modules
  branch: die on config error when editing branch description
  branch: die on config error when unsetting upstream
  branch: report errors in tracking branch setup
  config: introduce set_or_die wrappers

8 years agoMerge branch 'mg/work-tree-tests'
Junio C Hamano [Fri, 26 Feb 2016 21:37:18 +0000 (13:37 -0800)] 
Merge branch 'mg/work-tree-tests'

Traditionally, the tests that try commands that work on the
contents in the working tree were named with "worktree" in their
filenames, but with the recent addition of "git worktree"
subcommand, whose tests are also named similarly, it has become
harder to tell them apart.  The traditional tests have been renamed
to use "work-tree" instead in an attempt to differentiate them.

* mg/work-tree-tests:
  tests: rename work-tree tests to *work-tree*

8 years agoMerge branch 'ls/config-origin'
Junio C Hamano [Fri, 26 Feb 2016 21:37:17 +0000 (13:37 -0800)] 
Merge branch 'ls/config-origin'

The configuration system has been taught to phrase where it found a
bad configuration variable in a better way in its error messages.
"git config" learnt a new "--show-origin" option to indicate where
the values come from.

* ls/config-origin:
  config: add '--show-origin' option to print the origin of a config value
  config: add 'origin_type' to config_source struct
  rename git_config_from_buf to git_config_from_mem
  t: do not hide Git's exit code in tests using 'nul_to_q'

8 years agoMerge branch 'jk/tighten-alloc'
Junio C Hamano [Fri, 26 Feb 2016 21:37:16 +0000 (13:37 -0800)] 
Merge branch 'jk/tighten-alloc'

Update various codepaths to avoid manually-counted malloc().

* jk/tighten-alloc: (22 commits)
  ewah: convert to REALLOC_ARRAY, etc
  convert ewah/bitmap code to use xmalloc
  diff_populate_gitlink: use a strbuf
  transport_anonymize_url: use xstrfmt
  git-compat-util: drop mempcpy compat code
  sequencer: simplify memory allocation of get_message
  test-path-utils: fix normalize_path_copy output buffer size
  fetch-pack: simplify add_sought_entry
  fast-import: simplify allocation in start_packfile
  write_untracked_extension: use FLEX_ALLOC helper
  prepare_{git,shell}_cmd: use argv_array
  use st_add and st_mult for allocation size computation
  convert trivial cases to FLEX_ARRAY macros
  use xmallocz to avoid size arithmetic
  convert trivial cases to ALLOC_ARRAY
  convert manual allocations to argv_array
  argv-array: add detach function
  add helpers for allocating flex-array structs
  harden REALLOC_ARRAY and xcalloc against size_t overflow
  tree-diff: catch integer overflow in combine_diff_path allocation
  ...

8 years agoMerge branch 'jk/more-comments-on-textconv'
Junio C Hamano [Fri, 26 Feb 2016 21:37:15 +0000 (13:37 -0800)] 
Merge branch 'jk/more-comments-on-textconv'

The memory ownership rule of fill_textconv() API, which was a bit
tricky, has been documented a bit better.

* jk/more-comments-on-textconv:
  diff: clarify textconv interface

8 years agoMerge branch 'jk/no-diff-emit-common'
Junio C Hamano [Fri, 26 Feb 2016 21:37:14 +0000 (13:37 -0800)] 
Merge branch 'jk/no-diff-emit-common'

"git merge-tree" used to mishandle "both sides added" conflict with
its own "create a fake ancestor file that has the common parts of
what both sides have added and do a 3-way merge" logic; this has
been updated to use the usual "3-way merge with an empty blob as
the fake common ancestor file" approach used in the rest of the
system.

* jk/no-diff-emit-common:
  xdiff: drop XDL_EMIT_COMMON
  merge-tree: drop generate_common strategy
  merge-one-file: use empty blob for add/add base

8 years agoMerge branch 'ak/git-strip-extension-from-dashed-command'
Junio C Hamano [Fri, 26 Feb 2016 21:37:13 +0000 (13:37 -0800)] 
Merge branch 'ak/git-strip-extension-from-dashed-command'

Code simplification.

* ak/git-strip-extension-from-dashed-command:
  git.c: simplify stripping extension of a file in handle_builtin()

8 years agoMerge branch 'ak/extract-argv0-last-dir-sep'
Junio C Hamano [Fri, 26 Feb 2016 21:37:12 +0000 (13:37 -0800)] 
Merge branch 'ak/extract-argv0-last-dir-sep'

Code simplification.

* ak/extract-argv0-last-dir-sep:
  exec_cmd.c: use find_last_dir_sep() for code simplification

8 years agoMerge branch 'kn/ref-filter-atom-parsing'
Junio C Hamano [Fri, 26 Feb 2016 21:37:10 +0000 (13:37 -0800)] 
Merge branch 'kn/ref-filter-atom-parsing'

The ref-filter's format-parsing code has been refactored, in
preparation for "branch --format" and friends.

* kn/ref-filter-atom-parsing:
  ref-filter: introduce objectname_atom_parser()
  ref-filter: introduce contents_atom_parser()
  ref-filter: introduce remote_ref_atom_parser()
  ref-filter: align: introduce long-form syntax
  ref-filter: introduce align_atom_parser()
  ref-filter: introduce parse_align_position()
  ref-filter: introduce color_atom_parser()
  ref-filter: introduce parsing functions for each valid atom
  ref-filter: introduce struct used_atom
  ref-filter: bump 'used_atom' and related code to the top
  ref-filter: use string_list_split over strbuf_split

8 years agoMerge branch 'tg/git-remote'
Junio C Hamano [Fri, 26 Feb 2016 21:37:09 +0000 (13:37 -0800)] 
Merge branch 'tg/git-remote'

The internal API to interact with "remote.*" configuration
variables has been streamlined.

* tg/git-remote:
  remote: use remote_is_configured() for add and rename
  remote: actually check if remote exits
  remote: simplify remote_is_configured()
  remote: use parse_config_key

8 years agot/lib-httpd: load mod_unixd
Michael J Gruber [Mon, 11 May 2015 11:54:17 +0000 (13:54 +0200)] 
t/lib-httpd: load mod_unixd

In contrast to apache 2.2, apache 2.4 does not load mod_unixd in its
default configuration (because there are choices). Thus, with the
current config, apache 2.4.10 will not be started and the httpd tests
will not run on distros with default apache config (RedHat type).

Enable mod_unixd to make the httpd tests run. This does not affect
distros negatively which have that config already in their default
(Debian type). httpd tests will run on these before and after this patch.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot5504: handle expected output from SIGPIPE death
Jeff King [Wed, 24 Feb 2016 07:48:36 +0000 (02:48 -0500)] 
t5504: handle expected output from SIGPIPE death

Commit 8bf4bec (add "ok=sigpipe" to test_must_fail and use
it to fix flaky tests, 2015-11-27) taught t5504 to handle
"git push" racily exiting with SIGPIPE rather than failing.

However, one of the tests checks the output of the command,
as well. In the SIGPIPE case, we will not have produced any
output. If we want the test to be truly non-flaky, we have
to accept either output.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agotest_must_fail: report number of unexpected signal
Jeff King [Wed, 24 Feb 2016 07:45:49 +0000 (02:45 -0500)] 
test_must_fail: report number of unexpected signal

If a command is marked as test_must_fail but dies with a
signal, we consider that a problem and report the error to
stderr. However, we don't say _which_ signal; knowing that
can make debugging easier. Let's share as much as we know.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agofetch-pack: ignore SIGPIPE in sideband demuxer
Jeff King [Wed, 24 Feb 2016 07:44:58 +0000 (02:44 -0500)] 
fetch-pack: ignore SIGPIPE in sideband demuxer

If the other side feeds us a bogus pack, index-pack (or
unpack-objects) may die early, before consuming all of its
input. As a result, the sideband demuxer may get SIGPIPE
(racily, depending on whether our data made it into the pipe
buffer or not). If this happens and we are compiled with
pthread support, it will take down the main thread, too.

This isn't the end of the world, as the main process will
just die() anyway when it sees index-pack failed. But it
does mean we don't get a chance to say "fatal: index-pack
failed" or similar. And it also means that we racily fail
t5504, as we sometimes die() and sometimes are killed by
SIGPIPE.

So let's ignore SIGPIPE while demuxing the sideband. We are
already careful to check the return value of write(), so we
won't waste time writing to a broken pipe. The caller will
notice the error return from the async thread, though in
practice we don't even get that far, as we die() as soon as
we see that index-pack failed.

The non-sideband case is already fine; we let index-pack
read straight from the socket, so there is no SIGPIPE at
all. Technically the non-threaded async case is also OK
without this (the forked async process gets SIGPIPE), but
it's not worth distinguishing from the threaded case here.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agowrite_or_die: handle EPIPE in async threads
Jeff King [Wed, 24 Feb 2016 07:40:16 +0000 (02:40 -0500)] 
write_or_die: handle EPIPE in async threads

When write_or_die() sees EPIPE, it treats it specially by
converting it into a SIGPIPE death. We obviously cannot
ignore it, as the write has failed and the caller expects us
to die. But likewise, we cannot just call die(), because
printing any message at all would be a nuisance during
normal operations.

However, this is a problem if write_or_die() is called from
a thread. Our raised signal ends up killing the whole
process, when logically we just need to kill the thread
(after all, if we are ignoring SIGPIPE, there is good reason
to think that the main thread is expecting to handle it).

Inside an async thread, the die() code already does the
right thing, because we use our custom die_async() routine,
which calls pthread_join(). So ideally we would piggy-back
on that, and simply call:

  die_quietly_with_code(141);

or similar. But refactoring the die code to do this is
surprisingly non-trivial. The die_routines themselves handle
both printing and the decision of the exit code. Every one
of them would have to be modified to take new parameters for
the code, and to tell us to be quiet.

Instead, we can just teach write_or_die() to check for the
async case and handle it specially. We do have to build an
interface to abstract the async exit, but it's simple and
self-contained. If we had many call-sites that wanted to do
this die_quietly_with_code(), this approach wouldn't scale
as well, but we don't. This is the only place where do this
weird exit trick.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoadd DEVELOPER makefile knob to check for acknowledged warnings
Lars Schneider [Thu, 25 Feb 2016 08:42:22 +0000 (09:42 +0100)] 
add DEVELOPER makefile knob to check for acknowledged warnings

We assume Git developers have a reasonably modern compiler and recommend
them to enable the DEVELOPER makefile knob to ensure their patches are
clear of all compiler warnings the Git core project cares about.

Enable the DEVELOPER makefile knob in the Travis-CI build.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agorefs: document transaction semantics
David Turner [Thu, 25 Feb 2016 20:05:46 +0000 (15:05 -0500)] 
refs: document transaction semantics

Add some comments on ref transaction semantics to refs.h

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agouse_pack: handle signed off_t overflow
Jeff King [Thu, 25 Feb 2016 14:23:26 +0000 (09:23 -0500)] 
use_pack: handle signed off_t overflow

A v2 pack index file can specify an offset within a packfile
of up to 2^64-1 bytes. On a system with a signed 64-bit
off_t, we can represent only up to 2^63-1. This means that a
corrupted .idx file can end up with a negative offset in the
pack code. Our bounds-checking use_pack function looks for
too-large offsets, but not for ones that have wrapped around
to negative. Let's do so, which fixes an out-of-bounds
access demonstrated in t5313.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agonth_packed_object_offset: bounds-check extended offset
Jeff King [Thu, 25 Feb 2016 14:22:52 +0000 (09:22 -0500)] 
nth_packed_object_offset: bounds-check extended offset

If a pack .idx file has a corrupted offset for an object, we
may try to access an offset in the .idx or .pack file that
is larger than the file's size.  For the .pack case, we have
use_pack() to protect us, which realizes the access is out
of bounds. But if the corrupted value asks us to look in the
.idx file's secondary 64-bit offset table, we blindly add it
to the mmap'd index data and access arbitrary memory.

We can fix this with a simple bounds-check compared to the
size we found when we opened the .idx file.

Note that there's similar code in index-pack that is
triggered only during "index-pack --verify". To support
both, we pull the bounds-check into a separate function,
which dies when it sees a corrupted file.

It would be nice if we could return an error, so that the
pack code could try to find a good copy of the object
elsewhere. Currently nth_packed_object_offset doesn't have
any way to return an error, but it could probably use "0" as
a sentinel value (since no object can start there). This is
the minimal fix, and we can improve the resilience later on
top.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot5313: test bounds-checks of corrupted/malicious pack/idx files
Jeff King [Thu, 25 Feb 2016 14:21:12 +0000 (09:21 -0500)] 
t5313: test bounds-checks of corrupted/malicious pack/idx files

Our on-disk .pack and .idx files may reference other data by
offset. We should make sure that we are not fooled by
corrupt data into accessing memory outside of our mmap'd
boundaries.

This patch adds a series of tests for offsets found in .pack
and .idx files. For the most part we get this right, but
there are two tests of .idx files marked as failures: we do
not bounds-check offsets in the v2 index's extended offset
table, nor do we handle .idx offsets that overflow a signed
off_t.

With these tests, we should have good coverage of all
offsets found in these files. Note that this doesn't cover
.bitmap files, which may have similar bugs.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agogit config: report when trying to modify a non-existing repo config
Johannes Schindelin [Wed, 24 Feb 2016 12:48:11 +0000 (13:48 +0100)] 
git config: report when trying to modify a non-existing repo config

It is a pilot error to call `git config section.key value` outside of
any Git worktree. The message

error: could not lock config file .git/config: No such file or
directory

is not very helpful in that situation, though. Let's print a helpful
message instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agopush: remove "push.default is unset" warning message
Matthieu Moy [Thu, 25 Feb 2016 09:21:59 +0000 (10:21 +0100)] 
push: remove "push.default is unset" warning message

The warning was important before the 2.0 transition, and remained
important for a while after, so that new users get push.default
explicitly in their configuration and do not experience inconsistent
behavior if they ever used an older version of Git.

The warning has been there since version 1.8.0 (Oct 2012), hence we can
expect the vast majority of current Git users to have been exposed to
it, and most of them have already set push.default explicitly. The
switch from 'matching' to 'simple' was planned for 2.0 (May 2014), but
actually happened only for 2.3 (Feb 2015).

Today, the warning is mostly seen by beginners, who have not set their
push.default configuration (yet). For many of them, the warning is
confusing because it talks about concepts that they have not learned and
asks them a choice that they are not able to make yet. See for example

  http://stackoverflow.com/questions/13148066/warning-push-default-is-unset-its-implicit-value-is-changing-in-git-2-0

(1260 votes for the question, 1824 for the answer as of writing)

Remove the warning completely to avoid disturbing beginners. People who
still occasionally use an older version of Git will be exposed to the
warning through this old version.

Eventually, versions of Git without the warning will be deployed enough
and tutorials will not need to advise setting push.default anymore.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoREADME.md: move down historical explanation about the name
Matthieu Moy [Thu, 25 Feb 2016 08:37:30 +0000 (09:37 +0100)] 
README.md: move down historical explanation about the name

The explanations about why the name was chosen are secondary compared to
the description and link to the documentation.

Some consider these explanations as good computer scientists joke, but
other see it as needlessly offensive vocabulary.

This patch preserves the historical joke, but gives it less importance
by moving it to the end of the README, and makes it clear that it is a
historical explanation, that does not necessarily reflect the state of
mind of current developers.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoREADME.md: don't call git stupid in the title
Matthieu Moy [Thu, 25 Feb 2016 08:37:29 +0000 (09:37 +0100)] 
README.md: don't call git stupid in the title

"the stupid content tracker" was true in the early days of Git, but
hardly applicable these days. "fast, scalable, distributed" describes
Git more accuralety.

Also, "stupid" can be seen as offensive by some people. Let's not use it
in the very first words of the README.

The new formulation is taken from the description of the Debian package.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoREADME.md: move the link to git-scm.com up
Matthieu Moy [Thu, 25 Feb 2016 08:37:28 +0000 (09:37 +0100)] 
README.md: move the link to git-scm.com up

The documentation available on git-scm.com is nicely formatted. It's
better to point users to it than to the source code of the
documentation.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoREADME.md: add hyperlinks on filenames
Matthieu Moy [Thu, 25 Feb 2016 08:37:27 +0000 (09:37 +0100)] 
README.md: add hyperlinks on filenames

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoREADME: use markdown syntax
Matthieu Moy [Thu, 25 Feb 2016 08:37:26 +0000 (09:37 +0100)] 
README: use markdown syntax

This allows repository browsers like GitHub to display the content of
the file nicely formatted.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agotemplates/hooks: fix minor typo in the sample update-hook
Martin Amdisen [Thu, 25 Feb 2016 08:10:12 +0000 (09:10 +0100)] 
templates/hooks: fix minor typo in the sample update-hook

Signed-off-by: Martin Mosegaard Amdisen <martin.amdisen@praqma.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agosubmodule: try harder to fetch needed sha1 by direct fetching sha1
Stefan Beller [Wed, 24 Feb 2016 03:32:13 +0000 (19:32 -0800)] 
submodule: try harder to fetch needed sha1 by direct fetching sha1

When reviewing a change that also updates a submodule in Gerrit, a
common review practice is to download and cherry-pick the patch
locally to test it. However when testing it locally, the 'git
submodule update' may fail fetching the correct submodule sha1 as
the corresponding commit in the submodule is not yet part of the
project history, but also just a proposed change.

If $sha1 was not part of the default fetch, we try to fetch the $sha1
directly. Some servers however do not support direct fetch by sha1,
which leads git-fetch to fail quickly. We can fail ourselves here as
the still missing sha1 would lead to a failure later in the checkout
stage anyway, so failing here is as good as we can get.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot3034: test deprecated interface
Felipe Gonçalves Assis [Wed, 24 Feb 2016 01:41:31 +0000 (22:41 -0300)] 
t3034: test deprecated interface

--find-renames= and --rename-threshold= should be aliases.

Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot3034: test option to disable renames
Felipe Gonçalves Assis [Wed, 24 Feb 2016 01:41:30 +0000 (22:41 -0300)] 
t3034: test option to disable renames

Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot3034: add rename threshold tests
Felipe Gonçalves Assis [Wed, 24 Feb 2016 01:41:29 +0000 (22:41 -0300)] 
t3034: add rename threshold tests

10ae752 (merge-recursive: option to specify rename threshold,
2010-09-27) introduced this feature but did not include any tests.

The tests use the new option --find-renames, which replaces the then
introduced and now deprecated option --rename-threshold.

Also update name and description of t3032 for consistency:
"merge-recursive options" -> "merge-recursive space options"

Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agosubmodule helper list: respect correct path prefix
Stefan Beller [Wed, 24 Feb 2016 21:15:02 +0000 (13:15 -0800)] 
submodule helper list: respect correct path prefix

This is a regression introduced by 74703a1e4d (submodule: rewrite
`module_list` shell function in C, 2015-09-02).

Add a test to ensure we list the right submodule when giving a
specific pathspec.

Reported-By: Caleb Jorden <cjorden@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoEighth batch for 2.8
Junio C Hamano [Wed, 24 Feb 2016 21:31:57 +0000 (13:31 -0800)] 
Eighth batch for 2.8

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'jc/am-i-v-fix'
Junio C Hamano [Wed, 24 Feb 2016 21:26:01 +0000 (13:26 -0800)] 
Merge branch 'jc/am-i-v-fix'

The "v(iew)" subcommand of the interactive "git am -i" command was
broken in 2.6.0 timeframe when the command was rewritten in C.

* jc/am-i-v-fix:
  am -i: fix "v"iew
  pager: factor out a helper to prepare a child process to run the pager
  pager: lose a separate argv[]

8 years agoMerge branch 'nd/worktree-add-B'
Junio C Hamano [Wed, 24 Feb 2016 21:26:00 +0000 (13:26 -0800)] 
Merge branch 'nd/worktree-add-B'

"git worktree add -B <branchname>" did not work.

* nd/worktree-add-B:
  worktree add -B: do the checkout test before update branch
  worktree: fix "add -B"

8 years agoMerge branch 'nd/exclusion-regression-fix'
Junio C Hamano [Wed, 24 Feb 2016 21:25:59 +0000 (13:25 -0800)] 
Merge branch 'nd/exclusion-regression-fix'

Another try to add support to the ignore mechanism that lets you
say "this is excluded" and then later say "oh, no, this part (that
is a subset of the previous part) is not excluded".

* nd/exclusion-regression-fix:
  dir.c: don't exclude whole dir prematurely
  dir.c: support marking some patterns already matched
  dir.c: support tracing exclude
  dir.c: fix match_pathname()

8 years agoMerge branch 'ce/https-public-key-pinning'
Junio C Hamano [Wed, 24 Feb 2016 21:25:58 +0000 (13:25 -0800)] 
Merge branch 'ce/https-public-key-pinning'

You can now set http.[<url>.]pinnedpubkey to specify the pinned
public key when building with recent enough versions of libcURL.

* ce/https-public-key-pinning:
  http: implement public key pinning

8 years agoMerge branch 'bc/http-empty-auth'
Junio C Hamano [Wed, 24 Feb 2016 21:25:57 +0000 (13:25 -0800)] 
Merge branch 'bc/http-empty-auth'

Some authentication methods do not need username or password, but
libcurl needs some hint that it needs to perform authentication.
Supplying an empty username and password string is a valid way to
do so, but you can set the http.[<url>.]emptyAuth configuration
variable to achieve the same, if you find it cleaner.

* bc/http-empty-auth:
  http: add option to try authentication without username

8 years agoMerge branch 'sp/remote-curl-ssl-strerror'
Junio C Hamano [Wed, 24 Feb 2016 21:25:56 +0000 (13:25 -0800)] 
Merge branch 'sp/remote-curl-ssl-strerror'

Help those who debug http(s) part of the system.

* sp/remote-curl-ssl-strerror:
  remote-curl: include curl_errorstr on SSL setup failures

8 years agoMerge branch 'jk/lose-name-path'
Junio C Hamano [Wed, 24 Feb 2016 21:25:55 +0000 (13:25 -0800)] 
Merge branch 'jk/lose-name-path'

The "name_path" API was an attempt to reduce the need to construct
the full path out of a series of path components while walking a
tree hierarchy, but over time made less efficient because the path
needs to be flattened, e.g. to be compared with another path that
is already flat.  The API has been removed and its users have been
rewritten to simplify the overall code complexity.

* jk/lose-name-path:
  list-objects: pass full pathname to callbacks
  list-objects: drop name_path entirely
  list-objects: convert name_path to a strbuf
  show_object_with_name: simplify by using path_name()
  http-push: stop using name_path

8 years agoMerge branch 'ew/force-ipv4'
Junio C Hamano [Wed, 24 Feb 2016 21:25:54 +0000 (13:25 -0800)] 
Merge branch 'ew/force-ipv4'

"git fetch" and friends that make network connections can now be
told to only use ipv4 (or ipv6).

* ew/force-ipv4:
  connect & http: support -4 and -6 switches for remote operations

8 years agoMerge branch 'nd/git-common-dir-fix'
Junio C Hamano [Wed, 24 Feb 2016 21:25:53 +0000 (13:25 -0800)] 
Merge branch 'nd/git-common-dir-fix'

"git rev-parse --git-common-dir" used in the worktree feature
misbehaved when run from a subdirectory.

* nd/git-common-dir-fix:
  rev-parse: take prefix into account in --git-common-dir

8 years agoMerge branch 'nd/dwim-wildcards-as-pathspecs'
Junio C Hamano [Wed, 24 Feb 2016 21:25:52 +0000 (13:25 -0800)] 
Merge branch 'nd/dwim-wildcards-as-pathspecs'

"git show 'HEAD:Foo[BAR]Baz'" did not interpret the argument as a
rev, i.e. the object named by the the pathname with wildcard
characters in a tree object.

* nd/dwim-wildcards-as-pathspecs:
  get_sha1: don't die() on bogus search strings
  check_filename: tighten dwim-wildcard ambiguity
  checkout: reorder check_filename conditional

8 years agomerge-recursive: find-renames resets threshold
Felipe Gonçalves Assis [Sun, 21 Feb 2016 22:59:05 +0000 (19:59 -0300)] 
merge-recursive: find-renames resets threshold

Make the find-renames option follow the behaviour in git-diff, where it
resets the threshold when none is given. So, for instance,
"--find-renames=25 --find-renames" should result in the default
threshold (50%) instead of 25%.

Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot9200: avoid grep on non-ASCII data
John Keeping [Sun, 21 Feb 2016 17:32:22 +0000 (17:32 +0000)] 
t9200: avoid grep on non-ASCII data

GNU grep 2.23 detects the input used in this test as binary data so it
does not work for extracting lines from a file.  We could add the "-a"
option to force grep to treat the input as text, but not all
implementations support that.  Instead, use sed to extract the desired
lines since it will always treat its input as text.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot8005: avoid grep on non-ASCII data
John Keeping [Sun, 21 Feb 2016 17:32:21 +0000 (17:32 +0000)] 
t8005: avoid grep on non-ASCII data

GNU grep 2.23 detects the input used in this test as binary data so it
does not work for extracting lines from a file.  We could add the "-a"
option to force grep to treat the input as text, but not all
implementations support that.  Instead, use sed to extract the desired
lines since it will always treat its input as text.

While touching these lines, modernize the test style to avoid hiding the
exit status of "git blame" and remove a space following a redirection
operator.  Also swap the order of the expected and actual output
files given to test_cmp; we compare expect and actual to show how
actual output differs from what is expected.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agocredential-cache--daemon: change to the socket dir on startup
Jon Griffiths [Tue, 23 Feb 2016 07:16:04 +0000 (02:16 -0500)] 
credential-cache--daemon: change to the socket dir on startup

Changing to the socket path stops the daemon holding open
the directory the user was in when it was started,
preventing umount from working. We're already holding open a
socket in that directory, so there's no downside.

Thanks-to: Jeff King <peff@peff.net>
Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoDocumentation/git-push: document that 'simple' is the default
Matthieu Moy [Tue, 23 Feb 2016 21:04:41 +0000 (22:04 +0100)] 
Documentation/git-push: document that 'simple' is the default

The default behavior is well documented already in git-config(1), but
git-push(1) itself did not mention it at all. For users willing to learn
how "git push" works but not how to configure it, this makes the
documentation cumbersome to read.

Make the git-push(1) page self-contained by adding a short summary of
what 'push.default=simple' does, early in the page.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoxdiff/xmerge: fix memory leak in xdl_merge
Patrick Steinhardt [Tue, 23 Feb 2016 11:59:17 +0000 (12:59 +0100)] 
xdiff/xmerge: fix memory leak in xdl_merge

When building the script for the second file that is to be merged
we have already allocated memory for data structures related to
the first file. When we encounter an error in building the second
script we only free allocated memory related to the second file
before erroring out.

Fix this memory leak by also releasing allocated memory related
to the first file.

Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agocredential-cache--daemon: disallow relative socket path
Jon Griffiths [Tue, 23 Feb 2016 07:15:41 +0000 (02:15 -0500)] 
credential-cache--daemon: disallow relative socket path

Relative socket paths are dangerous since the user cannot generally
control when the daemon starts (initially, after a timeout, kill or
crash). Since the daemon creates but does not delete the socket
directory, this could lead to spurious directory creation relative
to the users cwd.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>