commit/commit-tree: correct latin1 to utf-8

When a line in the message is not a valid utf-8, "git mailinfo"
attempts to convert it to utf-8 assuming the input is latin1 (and
punt if it does not convert cleanly).  Using the same heuristics in
"git commit" and "git commit-tree" lets the editor output be in
latin1 to make the overall system more consistent.
Add config variable to set HTML path for git-help --web

If set in git-config, help.htmlpath overrides system_path(GIT_HTML_PATH)
which was compiled in. This allows users to repoint system-wide git at
their own copy of the documentation without recompiling.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Allow help.htmlpath to be a URL prefix

Setting this to a URL prefix instead of a path to a local directory allows
git-help --web to work even when HTML docs aren't locally installed, by
pointing the browser at a copy accessible on the web. For example,

    [help]
      format = html
      htmlpath = http://git-scm.com/docs

will use the publicly available documentation on the git homepage.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'hv/remote-end-hung-up' into jch

When we get disconnected while expecting a response from the remote
side because authentication failed, we issued an error message "The
remote side hung up unexpectedly."  Give hint that it may be a
permission problem in the message when we can reasonably suspect it.

Will merge to 'master'.

* hv/remote-end-hung-up:
  remove the impression of unexpectedness when access is denied

Conflicts:
	t/t5512-ls-remote.sh
Merge branch 'mm/push-default-switch-warning' into jch

Hopefully we can have a solidly tested series early in 1.7.12 or
1.7.13 at the latest.

# By Matthieu Moy
* mm/push-default-switch-warning:
  push: start warning upcoming default change for push.default
Merge branch 'th/diff-no-index-fixes' into jch

"git diff --no-index" did not correctly handle relative paths and
did not correctly give exit codes when run under "--quiet" option.

Will merge to 'master'.

# By Jeff King (1) and Tim Henigan (1)
* th/diff-no-index-fixes:
  diff-no-index: exit(1) if 'diff --quiet <repo file> <external file>' finds changes
  diff: handle relative paths in no-index
Merge branch 'nd/clone-single-fix' into jch

"git clone --single-branch" to clone a single branch did not limit
the cloning to the specified branch.

Will merge to 'master'.

# By Nguyễn Thái Ngọc Duy
* nd/clone-single-fix:
  clone: fix ref selection in --single-branch --branch=xxx
Merge branch 'jn/perl-makemaker-leading-paths' into jch

Will merge to 'next' after waiting for a few more days.

# By Jonathan Nieder
* jn/perl-makemaker-leading-paths:
  perl/Makefile: move "mkdir -p" to module installation loop for maintainability
Merge branch 'mm/config-xdg' into jch

Teach git to read various information from $XDG_CONFIG_HOME/git/ to allow
the user to avoid cluttering $HOME.

Will merge to 'next'.

# By Huynh Khoi Nguyen Nguyen
* mm/config-xdg:
  config: write to $XDG_CONFIG_HOME/git/config file when appropriate
  Let core.attributesfile default to $XDG_CONFIG_HOME/git/attributes
  Let core.excludesfile default to $XDG_CONFIG_HOME/git/ignore
  config: read (but not write) from $XDG_CONFIG_HOME/git/config file
Merge branch 'mm/credential-plumbing' into jch

Expose the credential API to scripted Porcelain writers.

Will merge to 'next'.

# By Matthieu Moy (2) and Javier Roucher Iglesias (1)
* mm/credential-plumbing:
  git-remote-mediawiki: add credential support
  git credential fill: output the whole 'struct credential'
  add 'git credential' plumbing command
Merge branch 'rj/platform-pread-may-be-thread-unsafe' into jch

On Cygwin, the platform pread(3) is not thread safe, just like our
own compat/ emulation, and cannot be used in the index-pack program.

Will merge to 'next'.

* rj/platform-pread-may-be-thread-unsafe:
  index-pack: Disable threading on cygwin
Merge branch 'cw/no-detaching-an-unborn' into jch

"git checkout --detach" when you are still on an unborn branch
should be forbidden, but it wasn't.

Will merge to 'next'.

# By Chris Webb
* cw/no-detaching-an-unborn:
  git-checkout: disallow --detach on unborn branch
Merge branch 'cw/rebase-i-root' into jch

"git rebase [-i] --root $tip" can now be used to rewrite all the
history down to the root.

Will merge to 'next'.

* cw/rebase-i-root:
  Add tests for rebase -i --root without --onto
  rebase -i: support --root without --onto

Conflicts:
	Documentation/git-rebase.txt
	git-rebase.sh
	t/t3404-rebase-interactive.sh
Merge branch 'mz/rebase-no-mbox' into jch

Teach "am --rebasing" codepath to grab authorship, log message and
the patch text directly out of existing commits.

Will merge to 'next'.

* mz/rebase-no-mbox:
  am: don't call mailinfo if $rebasing
  am --rebasing: get patch body from commit, not from mailbox
  rebase --root: print usage on too many args
  rebase: don't source git-sh-setup twice

Conflicts:
	t/t3412-rebase-root.sh
Merge branch 'js/fast-export-paths-with-spaces' into jch

"git fast-export" produced an input stream for fast-import without
properly quoting pathnames when they contain SPs in them.

Will merge to 'next'.

# By Jay Soffian
* js/fast-export-paths-with-spaces:
  fast-export: quote paths with spaces
Merge branch 'mm/mediawiki-file-attachments' into jch

"mediawiki" remote helper (in contrib/) learned to handle file
attachments.

Will merge to 'next'.

# By Matthieu Moy (3) and others
* mm/mediawiki-file-attachments:
  git-remote-mediawiki: import "File:" attachments
  git-remote-mediawiki: split get_mw_pages into smaller functions
  git-remote-mediawiki: send "File:" attachments to a remote wiki
  git-remote-mediawiki: don't "use encoding 'utf8';"
  git-remote-mediawiki: don't compute the diff when getting commit message
Merge branch 'pw/git-p4-tests' into jch

More "git p4" tests.

Will merge to 'next'.

# By Pete Wyckoff
* pw/git-p4-tests:
  git p4 test: fix badp4dir test
  git p4 test: split up big t9800 test
  git p4 test: cleanup_git should make a new $git
  git p4 test: copy source indeterminate
  git p4 test: check for error message in failed test
  git p4 test: rename some "git-p4 command" strings
  git p4 test: never create default test repo
  git p4 test: simplify quoting involving TRASH_DIRECTORY
  git p4 test: use real_path to resolve p4 client symlinks
  git p4 test: wait longer for p4d to start and test its pid
Merge branch 'mz/empty-rebase-test' into jch

We did not have test to make sure "git rebase" without extra options
filters out an empty commit in the original history.

Will merge to 'next'.

# By Martin von Zweigbergk
* mz/empty-rebase-test:
  add test case for rebase of empty commit
Merge branch 'tb/sanitize-decomposed-utf-8-pathname' into jch

Teaches git to normalize pathnames read from readdir(3) and all
arguments from the command line into precomposed UTF-8 (assuming
that they come as decomposed UTF-8) to work around issues on Mac OS.

I think there still are other places that need conversion
(e.g. paths that are read from stdin for some commands), but this
should be a step in the right direction.

Will merge to 'next'.

# By Torsten Bögershausen
* tb/sanitize-decomposed-utf-8-pathname:
  git on Mac OS and precomposed unicode
Merge branch 'jc/apply-3way' into jch

"git apply" learns to wiggle the base version and perform three-way merge
when a patch does not exactly apply to the version you have.

Waiting for comments.

* jc/apply-3way:
  apply --3way: tests
  apply: document --3way option
  apply: allow rerere() upon --3way results
  apply: register conflicted stages to the index
  apply: --3way with add/add conflict
  apply: move verify_index_match() higher
  apply: plug the three-way merge logic in
  apply: fall back on three-way merge
  apply: accept -3/--3way command line option
  apply: move "already exists" logic to check_to_create()
  apply: move check_to_create_blob() closer to its sole caller
  apply: further split load_preimage()
  apply: refactor "previous patch" logic
  apply: split load_preimage() helper function out
  apply: factor out checkout_target() helper function
  apply: refactor read_file_or_gitlink()
  apply: clear_image() clears things a bit more
  apply: a bit more comments on PATH_TO_BE_DELETED
  apply: fix an incomplete comment in check_patch()

Conflicts:
	builtin/apply.c