OSDN Git Service

git-core/git.git
8 years agobuiltin/apply: move 'state' init into init_apply_state()
Christian Couder [Tue, 24 May 2016 08:10:46 +0000 (10:10 +0200)]
builtin/apply: move 'state' init into init_apply_state()

When the apply functionality will be libified, the 'struct apply_state'
will be used by different pieces of code.

To properly initialize a 'struct apply_state', let's provide a nice
and easy to use init_apply_state() function.

Let's also provide clear_apply_state() to release memory used by
'struct apply_state' members, so that a 'struct apply_state' instance
can be easily reused without leaking memory.

Note that clear_apply_state() does nothing for now, but it will later.

While at it, let's rename 'prefix_' parameter to 'prefix'.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agobuiltin/apply: introduce 'struct apply_state' to start libifying
Christian Couder [Wed, 11 May 2016 13:16:19 +0000 (15:16 +0200)]
builtin/apply: introduce 'struct apply_state' to start libifying

Currently commands that want to use the apply functionality have to launch
a "git apply" process which can be bad for performance.

Let's start libifying the apply functionality and to do that we first need
to get rid of the global variables in "builtin/apply.c".

This patch introduces "struct apply_state" into which all the previously
global variables will be moved. A new parameter called "state" that is a
pointer to the "apply_state" structure will come at the beginning of the
helper functions that need it and will be passed around the call chain.

To start let's move the "prefix" and "prefix_length" global variables into
"struct apply_state".

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agobuiltin/apply: move 'read_stdin' global into cmd_apply()
Christian Couder [Wed, 11 May 2016 13:16:18 +0000 (15:16 +0200)]
builtin/apply: move 'read_stdin' global into cmd_apply()

The 'read_stdin' variable doesn't need to be static and global to the
file. It can be local to cmd_apply(), so let's move it there.

This will make it easier to libify the apply functionality.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agobuiltin/apply: move 'options' variable into cmd_apply()
Christian Couder [Wed, 11 May 2016 13:16:17 +0000 (15:16 +0200)]
builtin/apply: move 'options' variable into cmd_apply()

The 'options' variable doesn't need to be static and global to the
file. It can be local to cmd_apply(), so let's move it there.

This will make it easier to libify the apply functionality.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agobuiltin/apply: extract line_by_line_fuzzy_match() from match_fragment()
Christian Couder [Wed, 11 May 2016 13:16:16 +0000 (15:16 +0200)]
builtin/apply: extract line_by_line_fuzzy_match() from match_fragment()

The match_fragment() function is very big and contains a big special case
algorithm that does line by line fuzzy matching. So let's extract this
algorithm in a separate line_by_line_fuzzy_match() function.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agobuiltin/apply: avoid local variable shadowing 'len' parameter
Christian Couder [Wed, 11 May 2016 13:16:15 +0000 (15:16 +0200)]
builtin/apply: avoid local variable shadowing 'len' parameter

This is just a cleanup to avoid errors when compiling with -Wshadow and
to make it safer to later move global variables into a "state" struct.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agobuiltin/apply: avoid parameter shadowing 'linenr' global
Christian Couder [Wed, 11 May 2016 13:16:14 +0000 (15:16 +0200)]
builtin/apply: avoid parameter shadowing 'linenr' global

Let's just rename the global 'state_linenr' as it will become
'state->linenr' in a following patch.

This also avoid errors when compiling with -Wshadow and makes
it safer to later move global variables into a "state" struct.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agobuiltin/apply: avoid parameter shadowing 'p_value' global
Christian Couder [Wed, 11 May 2016 13:16:13 +0000 (15:16 +0200)]
builtin/apply: avoid parameter shadowing 'p_value' global

Let's just rename the global 'state_p_value' as it will become
'state->p_value' in a following patch.

This also avoid errors when compiling with -Wshadow and makes
it safer to later move global variables into a "state" struct.

Helped-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agobuiltin/apply: make gitdiff_verify_name() return void
Christian Couder [Wed, 11 May 2016 13:16:12 +0000 (15:16 +0200)]
builtin/apply: make gitdiff_verify_name() return void

As the value returned by gitdiff_verify_name() is put into the
same variable that is passed as a parameter to this function,
it is simpler to pass the address of the variable and have
gitdiff_verify_name() change the variable itself.

This also makes it possible to later have this function return
-1 instead of die()ing in case of error.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoEleventh batch for 2.9
Junio C Hamano [Tue, 10 May 2016 20:46:57 +0000 (13:46 -0700)]
Eleventh batch for 2.9

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'svn/bad-ref' of git://bogomips.org/git-svn
Junio C Hamano [Tue, 10 May 2016 20:40:57 +0000 (13:40 -0700)]
Merge branch 'svn/bad-ref' of git://bogomips.org/git-svn

* 'svn/bad-ref' of git://bogomips.org/git-svn:
  Git/SVN: die when there is no commit metadata

8 years agoMerge branch 'sk/gitweb-highlight-encoding'
Junio C Hamano [Tue, 10 May 2016 20:40:33 +0000 (13:40 -0700)]
Merge branch 'sk/gitweb-highlight-encoding'

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

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

8 years agoMerge branch 'sb/clean-test-fix'
Junio C Hamano [Tue, 10 May 2016 20:40:32 +0000 (13:40 -0700)]
Merge branch 'sb/clean-test-fix'

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

8 years agoMerge branch 'rn/glossary-typofix'
Junio C Hamano [Tue, 10 May 2016 20:40:31 +0000 (13:40 -0700)]
Merge branch 'rn/glossary-typofix'

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

8 years agoMerge branch 'ls/travis-submitting-patches'
Junio C Hamano [Tue, 10 May 2016 20:40:30 +0000 (13:40 -0700)]
Merge branch 'ls/travis-submitting-patches'

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

8 years agoMerge branch 'js/close-packs-before-gc'
Junio C Hamano [Tue, 10 May 2016 20:40:30 +0000 (13:40 -0700)]
Merge branch 'js/close-packs-before-gc'

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

8 years agoMerge branch 'ew/normal-to-e'
Junio C Hamano [Tue, 10 May 2016 20:40:29 +0000 (13:40 -0700)]
Merge branch 'ew/normal-to-e'

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

8 years agoMerge branch 'ls/p4-lfs'
Junio C Hamano [Tue, 10 May 2016 20:40:29 +0000 (13:40 -0700)]
Merge branch 'ls/p4-lfs'

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

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

8 years agoMerge branch 'sb/misc-cleanups'
Junio C Hamano [Tue, 10 May 2016 20:40:29 +0000 (13:40 -0700)]
Merge branch 'sb/misc-cleanups'

* sb/misc-cleanups:
  submodule-config: don't shadow `cache`
  config.c: drop local variable

8 years agoMerge branch 'ew/doc-split-pack-disables-bitmap'
Junio C Hamano [Tue, 10 May 2016 20:40:28 +0000 (13:40 -0700)]
Merge branch 'ew/doc-split-pack-disables-bitmap'

Doc update.

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

8 years agoGit/SVN: die when there is no commit metadata
Christian Couder [Sat, 7 May 2016 06:58:43 +0000 (08:58 +0200)]
Git/SVN: die when there is no commit metadata

When passing a bad --trunk option to `git svn clone`, like for example the
same URL that we are cloning:

  C:\Windows\system32>git svn clone
  https://mycompany.svn.beanstalkapp.com/myproject --no-metadata -A
  c:\temp\svn_to_git_users.txt
  --trunk=https://mycompany.svn.beanstalkapp.com/myproject
  --tags=https://mycompany.svn.beanstalkapp.com/myproject/tags
  --branches=https://mycompany.svn.beanstalkapp.com/myproject/branches
  c:\code\Git_myproject

One gets an "Use of uninitialized value $u in substitution (s///)" error:

  [...]
  W: +empty_dir: branches/20080918_DBDEPLOY/vendor/src/csharp/MS WCSF
  Contrib/src/Services
  W: +empty_dir: branches/20080918_DBDEPLOY/vendor/src/csharp/RealWorldControls/References
  r530 = c276e3b039d8e38759c6fb17443349732552d7a2 (refs/remotes/origin/trunk)
  Found possible branch point:
  https://mycompany.svn.beanstalkapp.com/myproject/trunk =>
  https://mycompany.svn.beanstalkapp.com/myproject/branches/20080918_DBDEPLOY,
  529
  Use of uninitialized value $u in substitution (s///) at
  /mingw32/share/perl5/site_perl/Git/SVN.pm line 101.
  Use of uninitialized value $u in concatenation (.) or string at
  /mingw32/share/perl5/site_perl/Git/SVN.pm line 101.
  refs/remotes/origin/trunk:
  'https://mycompany.svn.beanstalkapp.com/myproject' not found in ''
  C:\Windows\system32>

Let's fix that by just die()ing when we have an uninitialized value because we
cannot get commit metadata from a ref.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Eric Wong <e@80x24.org>
8 years agoSync with maint
Junio C Hamano [Fri, 6 May 2016 21:53:45 +0000 (14:53 -0700)]
Sync with maint

* maint:
  Almost ready for 2.8.3

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

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'sb/submodule-path-misc-bugs' into maint
Junio C Hamano [Fri, 6 May 2016 21:53:24 +0000 (14:53 -0700)]
Merge branch 'sb/submodule-path-misc-bugs' into maint

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

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

8 years agoMerge branch 'ky/imap-send-openssl-1.1.0' into maint
Junio C Hamano [Fri, 6 May 2016 21:53:24 +0000 (14:53 -0700)]
Merge branch 'ky/imap-send-openssl-1.1.0' into maint

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

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

8 years agoMerge branch 'js/replace-edit-use-editor-configuration' into maint
Junio C Hamano [Fri, 6 May 2016 21:53:24 +0000 (14:53 -0700)]
Merge branch 'js/replace-edit-use-editor-configuration' into maint

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

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

8 years agoMerge branch 'cc/apply' into maint
Junio C Hamano [Fri, 6 May 2016 21:53:23 +0000 (14:53 -0700)]
Merge branch 'cc/apply' into maint

Minor code clean-up.

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

8 years agoMerge branch 'kn/for-each-tag-branch' into maint
Junio C Hamano [Fri, 6 May 2016 21:53:23 +0000 (14:53 -0700)]
Merge branch 'kn/for-each-tag-branch' into maint

A minor documentation update.

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

8 years agoTenth batch for 2.9
Junio C Hamano [Fri, 6 May 2016 21:48:26 +0000 (14:48 -0700)]
Tenth batch for 2.9

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'jk/diff-compact-heuristic'
Junio C Hamano [Fri, 6 May 2016 21:45:46 +0000 (14:45 -0700)]
Merge branch 'jk/diff-compact-heuristic'

Patch output from "git diff" and friends has been tweaked to be
more readable by using a blank line as a strong hint that the
contents before and after it belong to a logically separate unit.

* jk/diff-compact-heuristic:
  diff: undocument the compaction heuristic knobs for experimentation
  xdiff: implement empty line chunk heuristic
  xdiff: add recs_match helper function

8 years agoMerge branch 'ls/p4-lfs-test-fix-2.7.0'
Junio C Hamano [Fri, 6 May 2016 21:45:45 +0000 (14:45 -0700)]
Merge branch 'ls/p4-lfs-test-fix-2.7.0'

Fix a broken test.

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

8 years agoMerge branch 'bc/object-id'
Junio C Hamano [Fri, 6 May 2016 21:45:44 +0000 (14:45 -0700)]
Merge branch 'bc/object-id'

Move from unsigned char[20] to struct object_id continues.

* bc/object-id:
  match-trees: convert several leaf functions to use struct object_id
  tree-walk: convert tree_entry_extract() to use struct object_id
  struct name_entry: use struct object_id instead of unsigned char sha1[20]
  match-trees: convert shift_tree() and shift_tree_by() to use object_id
  test-match-trees: convert to use struct object_id
  sha1-name: introduce a get_oid() function

8 years agoMerge branch 'bw/rebase-merge-entire-branch'
Junio C Hamano [Fri, 6 May 2016 21:45:44 +0000 (14:45 -0700)]
Merge branch 'bw/rebase-merge-entire-branch'

"git rebase -m" could be asked to rebase an entire branch starting
from the root, but failed by assuming that there always is a parent
commit to the first commit on the branch.

* bw/rebase-merge-entire-branch:
  git-rebase--merge: don't include absent parent as a base

8 years agoMerge branch 'jc/drop-git-spec-in'
Junio C Hamano [Fri, 6 May 2016 21:45:44 +0000 (14:45 -0700)]
Merge branch 'jc/drop-git-spec-in'

As nobody maintains our in-tree git.spec.in and distros use their
own spec file, we stopped pretending that we support "make rpm".

* jc/drop-git-spec-in:
  Makefile: remove dependency on git.spec
  Makefile: stop pretending to support rpmbuild

8 years agoMerge branch 'js/http-custom-headers'
Junio C Hamano [Fri, 6 May 2016 21:45:43 +0000 (14:45 -0700)]
Merge branch 'js/http-custom-headers'

HTTP transport clients learned to throw extra HTTP headers at the
server, specified via http.extraHeader configuration variable.

* js/http-custom-headers:
  http: support sending custom HTTP headers

8 years agoMerge branch 'sb/clone-shallow-passthru'
Junio C Hamano [Fri, 6 May 2016 21:45:43 +0000 (14:45 -0700)]
Merge branch 'sb/clone-shallow-passthru'

"git clone" learned "--shallow-submodules" option.

* sb/clone-shallow-passthru:
  clone: add `--shallow-submodules` flag

8 years agoMerge branch 'ld/p4-test-py3'
Junio C Hamano [Fri, 6 May 2016 21:45:42 +0000 (14:45 -0700)]
Merge branch 'ld/p4-test-py3'

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

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

8 years agoMerge branch 'sb/config-exit-status-list'
Junio C Hamano [Fri, 6 May 2016 21:45:42 +0000 (14:45 -0700)]
Merge branch 'sb/config-exit-status-list'

Doc update.

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

8 years agoSync with maint
Junio C Hamano [Tue, 3 May 2016 21:52:30 +0000 (14:52 -0700)]
Sync with maint

* maint:
  git-multimail: update to release 1.3.0

8 years agoNinth batch for 2.9
Junio C Hamano [Tue, 3 May 2016 21:15:10 +0000 (14:15 -0700)]
Ninth batch for 2.9

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'nf/mergetool-prompt'
Junio C Hamano [Tue, 3 May 2016 21:08:17 +0000 (14:08 -0700)]
Merge branch 'nf/mergetool-prompt'

UI consistency improvements.

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

8 years agoMerge branch 'jd/send-email-to-whom'
Junio C Hamano [Tue, 3 May 2016 21:08:16 +0000 (14:08 -0700)]
Merge branch 'jd/send-email-to-whom'

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

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

8 years agoMerge branch 'rt/string-list-lookup-cleanup'
Junio C Hamano [Tue, 3 May 2016 21:08:15 +0000 (14:08 -0700)]
Merge branch 'rt/string-list-lookup-cleanup'

Code cleanup.

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

8 years agoMerge branch 'jk/fix-attribute-macro-in-2.5'
Junio C Hamano [Tue, 3 May 2016 21:08:15 +0000 (14:08 -0700)]
Merge branch 'jk/fix-attribute-macro-in-2.5'

Code fixup.

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

8 years agoMerge branch 'sg/test-lib-simplify-expr-away'
Junio C Hamano [Tue, 3 May 2016 21:08:14 +0000 (14:08 -0700)]
Merge branch 'sg/test-lib-simplify-expr-away'

Code cleanup.

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

8 years agoMerge branch 'nd/remove-unused'
Junio C Hamano [Tue, 3 May 2016 21:08:13 +0000 (14:08 -0700)]
Merge branch 'nd/remove-unused'

Code cleanup.

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

8 years agoMerge branch 'js/name-rev-use-oldest-ref'
Junio C Hamano [Tue, 3 May 2016 21:08:13 +0000 (14:08 -0700)]
Merge branch 'js/name-rev-use-oldest-ref'

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

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

8 years agoMerge branch 'jd/p4-jobs-in-commit'
Junio C Hamano [Tue, 3 May 2016 21:08:12 +0000 (14:08 -0700)]
Merge branch 'jd/p4-jobs-in-commit'

"git p4" learned to record P4 jobs in Git commit that imports from
the history in Perforce.

* jd/p4-jobs-in-commit:
  git-p4: add P4 jobs to git commit message
  git-p4: clean-up code style in tests

8 years agoMerge branch 'en/merge-fixes'
Junio C Hamano [Tue, 3 May 2016 21:08:12 +0000 (14:08 -0700)]
Merge branch 'en/merge-fixes'

"merge-recursive" strategy incorrectly checked if a path that is
involved in its internal merge exists in the working tree.

* en/merge-fixes:
  merge-recursive: do not check working copy when creating a virtual merge base
  merge-recursive: remove duplicate code

8 years agogit-multimail: update to release 1.3.0
Matthieu Moy [Tue, 3 May 2016 08:31:42 +0000 (10:31 +0200)]
git-multimail: update to release 1.3.0

The changes are described in CHANGES.

Contributions-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Contributions-by: Stefan Tatschner <rumpelsepp@sevenbyte.org>
Contributions-by: Simon P <simon.git@le-huit.fr>
Contributions-by: Leander Hasty <leander@1stplayable.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot7300: mark test with SANITY
Stefan Beller [Tue, 3 May 2016 18:54:32 +0000 (11:54 -0700)]
t7300: mark test with SANITY

The test runs `chmod 0` on a file to test a case where Git fails to
read it, but that would not work if it is run as root.

Reported-by: Jan Keromnes <janx@linux.com>
Fix-proposed-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 agogitweb: apply fallback encoding before highlight
Shin Kojima [Tue, 3 May 2016 13:00:51 +0000 (22:00 +0900)]
gitweb: apply fallback encoding before highlight

Some multi-byte character encodings (such as Shift_JIS and GBK) have
characters whose final bytes is an ASCII '\' (0x5c), and they
will be displayed as funny-characters even if $fallback_encoding is
correct.  This is because `highlight` command always expects UTF-8
encoded strings from STDIN.

    $ echo 'my $v = "申";' | highlight --syntax perl | w3m -T text/html -dump
    my $v = "申";

    $ echo 'my $v = "申";' | iconv -f UTF-8 -t Shift_JIS | highlight \
        --syntax perl | iconv -f Shift_JIS -t UTF-8 | w3m -T text/html -dump

    iconv: (stdin):9:135: cannot convert
    my $v = "

This patch prepare git blob objects to be encoded into UTF-8 before
highlighting in the manner of `to_utf8` subroutine.

Signed-off-by: Shin Kojima <shin@kojima.org>
Reviewed-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoSync with maint
Junio C Hamano [Mon, 2 May 2016 22:50:34 +0000 (15:50 -0700)]
Sync with maint

* maint:
  Start preparing for 2.8.3

8 years agoStart preparing for 2.8.3
Junio C Hamano [Mon, 2 May 2016 21:23:48 +0000 (14:23 -0700)]
Start preparing for 2.8.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'jk/use-write-script-more' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:14 +0000 (14:24 -0700)]
Merge branch 'jk/use-write-script-more' into maint

Code clean-up.

* jk/use-write-script-more:
  t3404: use write_script
  t1020: do not overuse printf and use write_script
  t5532: use write_script

8 years agoMerge branch 'jc/xstrfmt-null-with-prec-0' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:14 +0000 (14:24 -0700)]
Merge branch 'jc/xstrfmt-null-with-prec-0' into maint

Code cleanup.

* jc/xstrfmt-null-with-prec-0:
  setup.c: do not feed NULL to "%.*s" even with precision 0

8 years agoMerge branch 'ew/send-email-drop-data-dumper' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:13 +0000 (14:24 -0700)]
Merge branch 'ew/send-email-drop-data-dumper' into maint

Code clean-up.

* ew/send-email-drop-data-dumper:
  send-email: do not load Data::Dumper

8 years agoMerge branch 'ad/cygwin-wants-rename' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:11 +0000 (14:24 -0700)]
Merge branch 'ad/cygwin-wants-rename' into maint

On Cygwin, object creation uses the "create a temporary and then
rename it to the final name" pattern, not "create a temporary,
hardlink it to the final name and then unlink the temporary"
pattern.

This is necessary to use Git on Windows shared directories, and is
already enabled for the MinGW and plain Windows builds.  It also
has been used in Cygwin packaged versions of Git for quite a while.
See http://thread.gmane.org/gmane.comp.version-control.git/291853
($gmane/275680, $gmane/291853).

* ad/cygwin-wants-rename:
  config.mak.uname: Cygwin needs OBJECT_CREATION_USES_RENAMES

8 years agoMerge branch 'jk/do-not-printf-NULL' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:10 +0000 (14:24 -0700)]
Merge branch 'jk/do-not-printf-NULL' into maint

"git config" had a codepath that tried to pass a NULL to
printf("%s"), which nobody seems to have noticed.

* jk/do-not-printf-NULL:
  git_config_set_multivar_in_file: handle "unset" errors
  git_config_set_multivar_in_file: all non-zero returns are errors
  config: lower-case first word of error strings

8 years agoMerge branch 'jc/http-socks5h' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:10 +0000 (14:24 -0700)]
Merge branch 'jc/http-socks5h' into maint

The socks5:// proxy support added back in 2.6.4 days was not aware
that socks5h:// proxies behave differently.

* jc/http-socks5h:
  http: differentiate socks5:// and socks5h://

8 years agoMerge branch 'ky/imap-send' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:09 +0000 (14:24 -0700)]
Merge branch 'ky/imap-send' into maint

Support for CRAM-MD5 authentication method in "git imap-send" did
not work well.

* ky/imap-send:
  imap-send: fix CRAM-MD5 response calculation
  imap-send: check for NOLOGIN capability only when using LOGIN command

8 years agoMerge branch 'ad/commit-have-m-option' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:09 +0000 (14:24 -0700)]
Merge branch 'ad/commit-have-m-option' into maint

"git commit" misbehaved in a few minor ways when an empty message
is given via -m '', all of which has been corrected.

* ad/commit-have-m-option:
  commit: do not ignore an empty message given by -m ''
  commit: --amend -m '' silently fails to wipe message

8 years agoMerge branch 'sb/submodule-helper-clone-regression-fix' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:08 +0000 (14:24 -0700)]
Merge branch 'sb/submodule-helper-clone-regression-fix' into maint

A partial rewrite of "git submodule" in the 2.7 timeframe changed
the way the gitdir: pointer in the submodules point at the real
repository location to use absolute paths by accident.  This has
been corrected.

* sb/submodule-helper-clone-regression-fix:
  submodule--helper, module_clone: catch fprintf failure
  submodule--helper: do not borrow absolute_path() result for too long
  submodule--helper, module_clone: always operate on absolute paths
  submodule--helper clone: create the submodule path just once
  submodule--helper: fix potential NULL-dereference
  recursive submodules: test for relative paths

8 years agoMerge branch 'jk/branch-shortening-funny-symrefs' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:07 +0000 (14:24 -0700)]
Merge branch 'jk/branch-shortening-funny-symrefs' into maint

A change back in version 2.7 to "git branch" broke display of a
symbolic ref in a non-standard place in the refs/ hierarchy (we
expect symbolic refs to appear in refs/remotes/*/HEAD to point at
the primary branch the remote has, and as .git/HEAD to point at the
branch we locally checked out).

* jk/branch-shortening-funny-symrefs:
  branch: fix shortening of non-remote symrefs

8 years agoMerge branch 'es/format-patch-doc-hide-no-patch' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:06 +0000 (14:24 -0700)]
Merge branch 'es/format-patch-doc-hide-no-patch' into maint

"git format-patch --help" showed `-s` and `--no-patch` as if these
are valid options to the command.  We already hide `--patch` option
from the documentation, because format-patch is about showing the
diff, and the documentation now hides these options as well.

* es/format-patch-doc-hide-no-patch:
  git-format-patch.txt: don't show -s as shorthand for multiple options

8 years agoMerge branch 'ky/branch-m-worktree' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:05 +0000 (14:24 -0700)]
Merge branch 'ky/branch-m-worktree' into maint

When "git worktree" feature is in use, "git branch -m" renamed a
branch that is checked out in another worktree without adjusting
the HEAD symbolic ref for the worktree.

* ky/branch-m-worktree:
  set_worktree_head_symref(): fix error message
  branch -m: update all per-worktree HEADs
  refs: add a new function set_worktree_head_symref

8 years agoMerge branch 'ky/branch-d-worktree' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:05 +0000 (14:24 -0700)]
Merge branch 'ky/branch-d-worktree' into maint

When "git worktree" feature is in use, "git branch -d" allowed
deletion of a branch that is checked out in another worktree

* ky/branch-d-worktree:
  branch -d: refuse deleting a branch which is currently checked out

8 years agoMerge branch 'jk/check-repository-format' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:04 +0000 (14:24 -0700)]
Merge branch 'jk/check-repository-format' into maint

The repository set-up sequence has been streamlined (the biggest
change is that there is no longer git_config_early()), so that we
do not attempt to look into refs/* when we know we do not have a
Git repository.

* jk/check-repository-format:
  verify_repository_format: mark messages for translation
  setup: drop repository_format_version global
  setup: unify repository version callbacks
  init: use setup.c's repo version verification
  setup: refactor repo format reading and verification
  config: drop git_config_early
  check_repository_format_gently: stop using git_config_early
  lazily load core.sharedrepository
  wrap shared_repository global in get/set accessors
  setup: document check_repository_format()

8 years agoMerge branch 'ew/send-email-readable-message-id' into maint
Junio C Hamano [Mon, 2 May 2016 21:24:04 +0000 (14:24 -0700)]
Merge branch 'ew/send-email-readable-message-id' into maint

"git send-email" now uses a more readable timestamps when
formulating a message ID.

* ew/send-email-readable-message-id:
  send-email: more meaningful Message-ID

8 years ago.mailmap: update to my shorter email address
Eric Wong [Mon, 2 May 2016 19:31:21 +0000 (19:31 +0000)]
.mailmap: update to my shorter email address

Following f916ab0ccc ("send-email: more meaningful Message-ID"),
my own email address is too long :x

While I could have an even shorter address by one character with
"yhbt.net", "80x24.org" is more representative of my
hacking-related pursuits.

Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoDocumentation: fix typo 'In such these cases'
René Nyffenegger [Mon, 2 May 2016 07:38:20 +0000 (09:38 +0200)]
Documentation: fix typo 'In such these cases'

Signed-off-by: René Nyffenegger <mail@renenyffenegger.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoDocumentation: add setup instructions for Travis CI
Lars Schneider [Mon, 2 May 2016 08:12:12 +0000 (10:12 +0200)]
Documentation: add setup instructions for Travis CI

Also change UK english "behaviour" to US english "behavior".

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot5510: run auto-gc in the foreground
SZEDER Gábor [Sun, 1 May 2016 15:37:43 +0000 (17:37 +0200)]
t5510: run auto-gc in the foreground

The last test added to 't5510-fetch' in 0898c9628104 (fetch: release
pack files before garbage-collecting, 2016-01-13) may sporadically
trigger following error message from the test harness:

  rm: cannot remove 'trash directory.t5510-fetch/auto-gc/.git': Directory not empty

The test in question forces an auto-gc, which, if the system supports
it, runs in the background by default, and occasionally takes long
enough for the test to finish and for 'test_done' to start
housekeeping.  This can lead to the test's 'git gc --auto' in the
background and 'test_done's 'rm -rf $trash' in the foreground racing
each other to create and delete files and directories.  It might just
happen that 'git gc' re-creates a directory that 'rm -rf' already
visited and removed, which ultimately triggers the above error.

Disable detaching the auto-gc process to ensure that it finishes
before the test can continue, thus avoiding this racy situation.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agodiff: undocument the compaction heuristic knobs for experimentation
Junio C Hamano [Mon, 2 May 2016 17:36:36 +0000 (10:36 -0700)]
diff: undocument the compaction heuristic knobs for experimentation

It seems that people around here are all happy with the updated
heuristics used to decide where the hunks are separated.  Let's keep
that as the default.  Even though we do not expect too much trouble
from the difference between the old and the new algorithms, just in
case let's leave the implementation of the knobs to turn it off for
emergencies.  There is no longer need for documenting them, though.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoEighth batch for 2.9
Junio C Hamano [Fri, 29 Apr 2016 20:03:27 +0000 (13:03 -0700)]
Eighth batch for 2.9

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoSync with 2.8.2
Junio C Hamano [Fri, 29 Apr 2016 21:20:47 +0000 (14:20 -0700)]
Sync with 2.8.2

8 years agoGit 2.8.2 v2.8.2
Junio C Hamano [Fri, 29 Apr 2016 21:18:16 +0000 (14:18 -0700)]
Git 2.8.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'js/mingw-tests-2.8' into maint
Junio C Hamano [Fri, 29 Apr 2016 21:16:01 +0000 (14:16 -0700)]
Merge branch 'js/mingw-tests-2.8' into maint

Code clean-up.

* js/mingw-tests-2.8:
  Windows: shorten code by re-using convert_slashes()

8 years agoMerge branch 'ep/trace-doc-sample-fix' into maint
Junio C Hamano [Fri, 29 Apr 2016 21:16:00 +0000 (14:16 -0700)]
Merge branch 'ep/trace-doc-sample-fix' into maint

Fix a typo in an example in the trace API documentation.

* ep/trace-doc-sample-fix:
  api-trace.txt: fix typo

8 years agoMerge branch 'jc/makefile-redirection-stderr' into maint
Junio C Hamano [Fri, 29 Apr 2016 21:15:59 +0000 (14:15 -0700)]
Merge branch 'jc/makefile-redirection-stderr' into maint

A minor fix in the Makefile.

* jc/makefile-redirection-stderr:
  Makefile: fix misdirected redirections

8 years agoMerge branch 'ak/use-hashmap-iter-first-in-submodule-config' into maint
Junio C Hamano [Fri, 29 Apr 2016 21:15:58 +0000 (14:15 -0700)]
Merge branch 'ak/use-hashmap-iter-first-in-submodule-config' into maint

Minor code cleanup.

* ak/use-hashmap-iter-first-in-submodule-config:
  submodule-config: use hashmap_iter_first()

8 years agoMerge branch 'tb/blame-force-read-cache-to-workaround-safe-crlf' into maint
Junio C Hamano [Fri, 29 Apr 2016 21:15:58 +0000 (14:15 -0700)]
Merge branch 'tb/blame-force-read-cache-to-workaround-safe-crlf' into maint

When running "git blame $path" with unnormalized data in the index
for the path, the data in the working tree was blamed, even though
"git add" would not have changed what is already in the index, due
to "safe crlf" that disables the line-end conversion.  It has been
corrected.

* tb/blame-force-read-cache-to-workaround-safe-crlf:
  correct blame for files commited with CRLF

8 years agoMerge branch 'sk/send-pack-all-fix' into maint
Junio C Hamano [Fri, 29 Apr 2016 21:15:56 +0000 (14:15 -0700)]
Merge branch 'sk/send-pack-all-fix' into maint

"git send-pack --all <there>" was broken when its command line
option parsing was written in the 2.6 timeframe.

* sk/send-pack-all-fix:
  git-send-pack: fix --all option when used with directory

8 years agoMerge branch 'sg/diff-multiple-identical-renames' into maint
Junio C Hamano [Fri, 29 Apr 2016 21:15:55 +0000 (14:15 -0700)]
Merge branch 'sg/diff-multiple-identical-renames' into maint

"git diff -M" used to work better when two originally identical
files A and B got renamed to X/A and X/B by pairing A to X/A and B
to X/B, but this was broken in the 2.0 timeframe.

* sg/diff-multiple-identical-renames:
  diffcore: fix iteration order of identical files during rename detection

8 years agoMerge branch 'ss/msvc' into maint
Junio C Hamano [Fri, 29 Apr 2016 21:15:54 +0000 (14:15 -0700)]
Merge branch 'ss/msvc' into maint

Build updates for MSVC.

* ss/msvc:
  MSVC: use shipped headers instead of fallback definitions
  MSVC: vsnprintf in Visual Studio 2015 doesn't need SNPRINTF_SIZE_CORR any more

8 years agoMerge branch 'st/verify-tag'
Junio C Hamano [Fri, 29 Apr 2016 19:59:09 +0000 (12:59 -0700)]
Merge branch 'st/verify-tag'

Unify internal logic between "git tag -v" and "git verify-tag"
commands by making one directly call into the other.

* st/verify-tag:
  tag -v: verify directly rather than exec-ing verify-tag
  verify-tag: move tag verification code to tag.c
  verify-tag: prepare verify_tag for libification
  verify-tag: update variable name and type
  t7030: test verifying multiple tags
  builtin/verify-tag.c: ignore SIGPIPE in gpg-interface

8 years agoMerge branch 'js/win32-mmap'
Junio C Hamano [Fri, 29 Apr 2016 19:59:08 +0000 (12:59 -0700)]
Merge branch 'js/win32-mmap'

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

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

8 years agoMerge branch 'jc/merge-refuse-new-root'
Junio C Hamano [Fri, 29 Apr 2016 19:59:08 +0000 (12:59 -0700)]
Merge branch 'jc/merge-refuse-new-root'

"git pull" has been taught to pass --allow-unrelated-histories
option to underlying "git merge".

* jc/merge-refuse-new-root:
  pull: pass --allow-unrelated-histories to "git merge"
  t3033: avoid 'ambiguous refs' warning

8 years agoMerge branch 'jk/push-client-deadlock-fix'
Junio C Hamano [Fri, 29 Apr 2016 19:59:08 +0000 (12:59 -0700)]
Merge branch 'jk/push-client-deadlock-fix'

"git push" from a corrupt repository that attempts to push a large
number of refs deadlocked; the thread to relay rejection notices
for these ref updates blocked on writing them to the main thread,
after the main thread at the receiving end notices that the push
failed and decides not to read these notices and return a failure.

* jk/push-client-deadlock-fix:
  t5504: drop sigpipe=ok from push tests
  fetch-pack: isolate sigpipe in demuxer thread
  send-pack: isolate sigpipe in demuxer thread
  run-command: teach async threads to ignore SIGPIPE
  send-pack: close demux pipe before finishing async process

8 years agoMerge branch 'js/replace-edit-use-editor-configuration'
Junio C Hamano [Fri, 29 Apr 2016 19:59:07 +0000 (12:59 -0700)]
Merge branch 'js/replace-edit-use-editor-configuration'

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

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

8 years agoMerge branch 'sb/mv-submodule-fix'
Junio C Hamano [Fri, 29 Apr 2016 19:59:07 +0000 (12:59 -0700)]
Merge branch 'sb/mv-submodule-fix'

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

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

8 years agoMerge branch 'nd/test-helpers'
Junio C Hamano [Fri, 29 Apr 2016 19:59:06 +0000 (12:59 -0700)]
Merge branch 'nd/test-helpers'

Sources to many test helper binaries (and the generated helpers)
have been moved to t/helper/ subdirectory to reduce clutter at the
top level of the tree.

* nd/test-helpers:
  test helpers: move test-* to t/helper/ subdirectory
  Makefile: clean *.o files we create

8 years agoMerge branch 'da/user-useconfigonly'
Junio C Hamano [Fri, 29 Apr 2016 19:59:06 +0000 (12:59 -0700)]
Merge branch 'da/user-useconfigonly'

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

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

8 years agot9824: fix wrong reference value
Lars Schneider [Fri, 29 Apr 2016 15:57:02 +0000 (15:57 +0000)]
t9824: fix wrong reference value

0492eb48 (t9824: fix broken &&-chain in a subshell, 2016-04-24)
revealed a test that was broken from the beginning, as it expected a
wrong size.  The expected size of the file under test is 39
bytes. The test checked that the size is 13 bytes, but this was not
noticed because it was breaking the &&-chain.

Fix the reference value to make the test pass.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agogit-p4: fix Git LFS pointer parsing
Lars Schneider [Thu, 28 Apr 2016 06:26:33 +0000 (08:26 +0200)]
git-p4: fix Git LFS pointer parsing

Git LFS 1.2.0 removed a preamble from the output of the 'git lfs pointer'
command [1] which broke the parsing of this output. Adjust the parser
to support the old and the new format.

Please note that this patch slightly changes the second return parameter
from a list of LF terminated strings to a single string that contains
a number of LF characters.

[1] https://github.com/github/git-lfs/commit/da2935d9a739592bc775c98d8ef4df9c72ea3b43

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Helped-by: Sebastian Schuberth <sschuberth@gmail.com>
Helped-by: Ben Woosley <ben.woosley@gmail.com>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agotravis-ci: express Linux/OS X dependency versions more clearly
Lars Schneider [Thu, 28 Apr 2016 06:26:32 +0000 (08:26 +0200)]
travis-ci: express Linux/OS X dependency versions more clearly

The Git Travis CI OSX build always installs the latest versions of Git LFS and
Perforce via brew and the Linux build installs fixed versions. Consequently new
LFS/Perforce versions can break the OS X build even if there is no change in
Git.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agopack-objects: warn on split packs disabling bitmaps
Eric Wong [Thu, 28 Apr 2016 07:28:55 +0000 (07:28 +0000)]
pack-objects: warn on split packs disabling bitmaps

It can be tempting for a server admin to want a stable set of
long-lived packs for dumb clients; but also want to enable bitmaps
to serve smart clients more quickly.

Unfortunately, such a configuration is impossible; so at least warn
users of this incompatibility since commit 21134714 (pack-objects:
turn off bitmaps when we split packs, 2014-10-16).

Tested the warning by inspecting the output of:

make -C t t5310-pack-bitmaps.sh GIT_TEST_OPTS=-v

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agosubmodule-config: don't shadow `cache`
Stefan Beller [Wed, 27 Apr 2016 21:30:40 +0000 (14:30 -0700)]
submodule-config: don't shadow `cache`

Lots of internal functions in submodule-confic.c have a first parameter
`struct submodule_cache *cache`, which currently always refers to the
global variable `cache` in the file. To avoid confusion rename the
global `cache` variable.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoconfig.c: drop local variable
Stefan Beller [Wed, 27 Apr 2016 21:30:39 +0000 (14:30 -0700)]
config.c: drop local variable

As `ret` is not used for anything except determining an early return,
we don't need a variable for that. Drop it.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agohttp: support sending custom HTTP headers
Johannes Schindelin [Wed, 27 Apr 2016 12:20:37 +0000 (14:20 +0200)]
http: support sending custom HTTP headers

We introduce a way to send custom HTTP headers with all requests.

This allows us, for example, to send an extra token from build agents
for temporary access to private repositories. (This is the use case that
triggered this patch.)

This feature can be used like this:

git -c http.extraheader='Secret: sssh!' fetch $URL $REF

Note that `curl_easy_setopt(..., CURLOPT_HTTPHEADER, ...)` takes only
a single list, overriding any previous call. This means we have to
collect _all_ of the headers we want to use into a single list, and
feed it to cURL in one shot. Since we already unconditionally set a
"pragma" header when initializing the curl handles, we can add our new
headers to that list.

For callers which override the default header list (like probe_rpc),
we provide `http_copy_default_headers()` so they can do the same
trick.

Big thanks to Jeff King and Junio Hamano for their outstanding help and
patient reviews.

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