Merge branch 'cc/replace-with-the-same-type' into jch

Using the replace mechanism to swap an object with another object
of a different type can introduce inconsistency (e.g. a tree
expects an object name to refer to a blob, but the blob object can
be mistakenly or maliciously replaced with an object with a
different type). Attempt to forbid such.

* cc/replace-with-the-same-type:
  Doc: 'replace' merge and non-merge commits
  t6050-replace: use some long option names
  replace: allow long option names
  Documentation/replace: add Creating Replacement Objects section
  t6050-replace: add test to clean up all the replace refs
  t6050-replace: test that objects are of the same type
  Documentation/replace: state that objects must be of the same type
  replace: forbid replacing an object with one of a different type

# Conflicts:
# 	builtin/replace.c
Merge branch 'kb/msvc-compile' into jch

Build updates for Windows port.

* kb/msvc-compile:
  Windows: do not redefine _WIN32_WINNT
  MinGW: Fix stat definitions to work with MinGW runtime version 4.0
  MSVC: fix stat definition hell
  MSVC: fix compile errors due to macro redefinitions
  MSVC: fix compile errors due to missing libintl.h
Merge branch 'lc/filter-branch-too-many-refs' into jch

"git filter-branch" in a repository with many refs blew limit of
command line length.

* lc/filter-branch-too-many-refs:
  Allow git-filter-branch to process large repositories with lots of branches.
Merge branch 'nd/unpack-entry-optim-in-pack-objects' into jch

The codepath to use data from packfiles that is only exercised in
pack-objects unnecessarily checked crc checksum of the pack data,
even when it ends up using in-core copy that it got by reading from
the pack (at which point the checksum was validated).

* nd/unpack-entry-optim-in-pack-objects:
  pack-objects: no crc check when the cached version is used
Merge branch 'jk/trailing-slash-in-pathspec' into jch

Code refactoring.

* jk/trailing-slash-in-pathspec:
  reset: handle submodule with trailing slash
  rm: re-use parse_pathspec's trailing-slash removal
Merge branch 'bc/submodule-status-ignored' into jch

* bc/submodule-status-ignored:
  Improve documentation concerning the status.submodulesummary setting
  submodule: don't print status output with ignore=all
  submodule: fix confusing variable name
Merge branch 'jc/checkout-detach-doc' into jch

"git checkout [--detach] <commit>" was listed poorly in the
synopsis section of its documentation.

* jc/checkout-detach-doc:
  checkout: update synopsys and documentation on detaching HEAD
Merge branch 'jk/format-patch-from' into jch

"format-patch --from=<whom>" forgot to omit unnecessary in-body
from line, i.e. when <whom> is the same as the real author.

* jk/format-patch-from:
  format-patch: print in-body "From" only when needed
Merge branch 'jc/push-cas' into jch

* jc/push-cas:
  t5541: mark passing c-a-s test as success
Merge branch 'jc/strcasecmp-pure-inline' into jch

Work around MinGW <string.h> header that does not declare strcasecmp
whose address cannot be taken.

* jc/strcasecmp-pure-inline:
  mailmap: work around implementations with pure inline strcasecmp
Merge branch 'po/dot-url' into jch

Explain how '.' can be used to refer to the "current repository"
in the documentation.

* po/dot-url:
  config doc: update dot-repository notes
  doc: command line interface (cli) dot-repository dwimmery
Merge branch 'es/name-hash-no-trailing-slash-in-dirs' into jch

Clean up the internal of the name-hash mechanism used to work
around case insensitivity on some filesystems to cleanly fix a
long-standing API glitch where the caller of cache_name_exists()
that ask about a directory with a counted string was required to
have '/' at one location past the end of the string.

* es/name-hash-no-trailing-slash-in-dirs:
  dir: revert work-around for retired dangerous behavior
  name-hash: stop storing trailing '/' on paths in index_state.dir_hash
  employ new explicit "exists in index?" API
  name-hash: refactor polymorphic index_name_exists()
Merge branch 'es/contacts-in-subdir' into jch

Allow the contacts (in contrib/) script to run from inside a
subdirectory.

* es/contacts-in-subdir:
  contacts: fix to work in subdirectories
Merge branch 'nd/fetch-pack-error-reporting-fix' into jch

When "fetch-pack" detected an error from spawned "index-pack" or
"unpack-objects", it did not report the failed program name
correctly when a shallow repository is involved.

* nd/fetch-pack-error-reporting-fix:
  fetch-pack.c: show correct command name that fails

# Conflicts:
# 	fetch-pack.c
Merge branch 'sg/complete-untracked-filter' into jch

* sg/complete-untracked-filter:
  completion: improve untracked directory filtering for filename completion
Merge branch 'jk/shortlog-tolerate-broken-commit' into jch

* jk/shortlog-tolerate-broken-commit:
  shortlog: ignore commits with missing authors
### match next
Merge branch 'jc/upload-pack-send-symref' into jch

One long-standing flaw in the pack transfer protocol used by "git
clone" was that there was no way to tell the other end which branch
"HEAD" points at, and the receiving end needed to guess.  A new
capability has been defined in the pack protocol to convey this
information so that cloning from a repository with more than one
branches pointing at the same commit where the HEAD is at now
reliably sets the initial branch in the resulting repository.

* jc/upload-pack-send-symref:
  clone: test the new HEAD detection logic
  connect: annotate refs with their symref information in get_remote_head()
  connect.c: make parse_feature_value() static
  upload-pack: send non-HEAD symbolic refs
  upload-pack: send symbolic ref information as capability
  upload-pack.c: do not pass confusing cb_data to mark_our_ref()
  t5505: fix "set-head --auto with ambiguous HEAD" test
Merge branch 'sb/repack-in-c' into jch

Rerolled, and I think it is in a reasonably good shape.

* sb/repack-in-c:
  repack: improve warnings about failure of renaming and removing files
  repack: retain the return value of pack-objects
  repack: rewrite the shell script in C
Merge branch 'jk/clone-progress-to-stderr' into jch

Some progress and diagnostic messages from "git clone" were
incorrectly sent to the standard output stream, not to the standard
error stream.

* jk/clone-progress-to-stderr:
  clone: always set transport options
  clone: treat "checking connectivity" like other progress
  clone: send diagnostic messages to stderr