xdiff: remove XDL_PATCH_* macros

These are not used anywhere in our codebase, and the bit assignment
definition is merely confusing.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
xdiff: PATIENCE/HISTOGRAM are not independent option bits

Because the default Myers, patience and histogram algorithms cannot be in
effect at the same time, XDL_PATIENCE_DIFF and XDL_HISTOGRAM_DIFF are not
independent bits.  Instead of wasting one bit per algorithm, define a few
macros to access the few bits they occupy and update the code that access
them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t7503: does pre-commit-hook learn authorship?

When "--author" option is used to lie the authorship to "git commit"
command, hooks should learn the author name and email just like when
GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL environment variables are used
to lie the authorship.  Test this.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit: pass author/committer info to hooks

When lying the author name via GIT_AUTHOR_NAME environment variable
to "git commit", the hooks run by the command saw it and could act
on the name that will be recorded in the final commit. When the user
uses the "--author" option from the command line, the command should
give the same information to the hook, and back when "git command"
was a scripted Porcelain, it did set the environment variable and
hooks can learn the author name from it.

However, when the command was reimplemented in C, the rewritten code
was not very faithful to the original, and hooks stopped getting the
authorship information given with "--author".  Fix this by exporting
the necessary environment variables.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
run_hook(): enhance the interface to pass arbitrary environment

Originally "run_hook()" that used to live in builtin/commit.c had a
perfectly appropriate API and name for a private function to spawn a
hook from "git commit" command. The only necessary tweak in the
context was to optionally specify which file to use as the index
file.

But then we stupidly moved this private API to run-command.c without
making the interface suitable for general consumption, and there is
no way to tweak environment variables other than GIT_INDEX_FILE when
running a hook.

Correct this mistake by adding run_hook_e() that takes an array of
environment variables.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
config: report errors at the EOL with correct line number

A section in a config file with a missing "]" reports the next line
as bad, same goes to a value with a missing end quote.

This happens because the error is not detected until the end of the
line, when line number is already increased. Fix this by decreasing
line number by one for these cases.

Signed-off-by: Martin Stenberg <martin@gnutiken.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
index-pack: support multithreaded delta resolving

This puts delta resolving on each base on a separate thread, one base
cache per thread. Per-thread data is grouped in struct thread_local.
When running with nr_threads == 1, no pthreads calls are made. The
system essentially runs in non-thread mode.

An experiment on a Xeon 24 core machine with linux-2.6.git shows that
performance does not increase proportional to the number of cores. So
by default, we use maximum 3 cores. Some numbers with --threads from 1
to 16:

1..4
real    1m16.310s  0m48.183s  0m37.866s  0m32.834s
user    1m13.773s  1m15.537s  1m15.781s  1m16.233s
sys     0m2.480s   0m3.936s   0m4.448s   0m4.852s

5..8
real    0m33.170s  0m30.369s  0m28.406s  0m26.968s
user    1m31.474s  1m30.322s  1m29.562s  1m28.694s
sys     0m6.096s   0m6.268s   0m6.684s   0m7.172s

9..12
real    0m26.288s  0m26.207s  0m26.239s  0m24.945s
user    1m29.530s  1m36.146s  1m43.134s  1m34.182s
sys     0m8.129s   0m8.437s   0m9.697s   0m10.201s

13..16
real    0m25.110s  0m25.043s  0m23.955s  0m25.746s
user    1m39.262s  1m43.598s  1m38.350s  1m59.775s
sys     0m10.997s  0m11.553s  0m11.949s  0m13.689s

Thanks to Ramsay Jones for troubleshooting on MinGW platform.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'dg/test-from-elsewhere' into pu

By David A. Greene
* dg/test-from-elsewhere:
  Support out-of-tree Valgrind tests
  Allow overriding GIT_BUILD_DIR
Merge branch 'nl/http-proxy-more' into pu

By Nelson Benitez Leon
* nl/http-proxy-more:
  http: handle proxy authentication failure (error 407)
  http: handle proxy proactive authentication
  http: try http_proxy env var when http.proxy config option is not set
Merge branch 'jc/advise-push-default' into pu

By Junio C Hamano
* jc/advise-push-default:
  push: hint to use push.default=upstream when appropriate
Merge branch 'ss/git-svn-prompt-sans-terminal' into pu

By Sven Strickroth (2) and Junio C Hamano (1)
* ss/git-svn-prompt-sans-terminal:
  fixup! 15eaaf4
  git-svn, perl/Git.pm: extend Git::prompt helper for querying users
  perl/Git.pm: "prompt" helper to honor GIT_ASKPASS and SSH_ASKPASS
Merge branch 'hv/submodule-recurse-push' into pu

By Heiko Voigt
* hv/submodule-recurse-push:
  : The bottom one was not clearly explained.
  push: teach --recurse-submodules the on-demand option
  Refactor submodule push check to use string list instead of integer
  Teach revision walking machinery to walk multiple times sequencially

Conflicts:
	transport.h
Merge branch 'nd/columns' into pu

By Nguyễn Thái Ngọc Duy
* nd/columns:
  tag: add --column
  column: support piping stdout to external git-column process
  status: add --column
  branch: add --column
  help: reuse print_columns() for help -a
  column: add column.ui for default column output settings
  column: add dense layout support
  column: add columnar layout
  Stop starting pager recursively
  Add git-column for columnar display
Merge branch 'nd/optim-connected' into pu

By Nguyễn Thái Ngọc Duy
* nd/optim-connected:
  Perform cheaper connectivity check when pack is used as medium
Merge branch 'jc/split-blob' into pu

By Junio C Hamano
* jc/split-blob:
  fixup?
  chunked-object: streaming checkout
  chunked-object: fallback checkout codepaths
  bulk-checkin: support chunked-object encoding
  bulk-checkin: allow the same data to be multiply hashed
  new representation types in the packstream
  varint-in-pack: refactor varint encoding/decoding

Conflicts:
	t/t1050-large.sh
Merge branch 'jh/trace-use-startup-info' into pu

By Jared Hance
* jh/trace-use-startup-info:
  Use startup_info->prefix rather than prefix.
Merge branch 'jh/apply-free-patch' into pu

By Jared Hance
* jh/apply-free-patch:
  apply: do not leak patches and fragments
Merge branch 'ph/rerere-doc' into pu

By Phil Hord
* ph/rerere-doc:
  rerere: Document 'rerere remaining'
Merge branch 'jc/maint-undefined-i18n-observation-test' into pu

By Junio C Hamano
* jc/maint-undefined-i18n-observation-test:
  t0204: clarify the "observe undefined behaviour" test
Merge branch 'sl/customize-sane-tool-path' into pu

By Stefano Lattarini
* sl/customize-sane-tool-path:
  configure: allow user to prevent $PATH "sanitization" on Solaris