git clone: is an URL local or ssh

Commit 8d3d28f5 added test cases for URLs which should be ssh.

Add more tests testing all the combinations:
 -IPv4 or IPv6
 -path starting with "/" or with "/~"
 -with and without the ssh:// scheme

Add tests for ssh:// with port number.

When a git repository "foo:bar" exist, git clone will call
absolute_path() and git_connect() will be called with
something like "/home/user/projects/foo:bar"

Tighten the test and use "foo:bar" instead of "./foo:bar",
refactor clear_ssh() and expect_ssh() into test_clone_url().

"git clone foo/bar:baz" should not be ssh:
  Make the rule
  "if there is a slash before the first colon, it is not ssh"
  more strict by using the same is_local() in both connect.c
  and transport.c. Add a test case.

Bug fixes for corner cases:
- Handle clone of [::1]:/~repo correctly (2e7766655):
  Git should call "ssh ::1 ~repo", not ssh ::1 /~repo
  This was caused by looking at (host != url), which never
  worked for host names with literal IPv6 adresses, embedded by []
  Support for the [] URLs was introduced in 356bece0a.

- Do not tamper local URLs starting with '[' which have a ']'

Bug fix for msygit in t5601 : use $PWD insted of $(pwd)

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'jk/robustify-parse-commit' into jch

* jk/robustify-parse-commit:
  checkout: do not die when leaving broken detached HEAD
  use parse_commit_or_die instead of custom message
  use parse_commit_or_die instead of segfaulting
  assume parse_commit checks for NULL commit
  assume parse_commit checks commit->object.parsed
  log_tree_diff: die when we fail to parse a commit
Merge branch 'jh/loose-object-dirs-creation-race' into jch

* jh/loose-object-dirs-creation-race:
  sha1_file.c:create_tmpfile(): Fix race when creating loose object dirs
Merge branch 'nd/liteal-pathspecs' into jch

* nd/liteal-pathspecs:
  pathspec: stop --*-pathspecs impact on internal parse_pathspec() uses

# Conflicts:
# 	revision.c
Merge branch 'jk/replace-perl-in-built-scripts' into jch

* jk/replace-perl-in-built-scripts:
  use @@PERL@@ in built scripts
Merge branch 'jc/merge-base-reflog' into jch

Code the logic in "pull --rebase" that figures out a fork point
from reflog entries in C.

* jc/merge-base-reflog:
  merge-base: teach "--fork-point" mode
  merge-base: use OPT_CMDMODE and clarify the command line parsing
Merge branch 'bc/http-100-continue' into jch

Issue "100 Continue" responses to help use of GSS-Negotiate
authentication scheme over HTTP transport when needed.

* bc/http-100-continue:
  remote-curl: fix large pushes with GSSAPI
  remote-curl: pass curl slot_results back through run_slot
  http: return curl's AUTHAVAIL via slot_results

# Conflicts:
# 	remote-curl.c
Merge branch 'nv/parseopt-opt-arg' into jch

Enhance "rev-parse --parseopt" mode to help parsing options with
an optional parameter.

* nv/parseopt-opt-arg:
  rev-parse --parseopt: add the --stuck-long mode
  Use the word 'stuck' instead of 'sticked'
Merge branch 'fc/trivial' into jch

A random collection of style fixes and minor doc updates.

* fc/trivial:
  setup: trivial style fixes
  run-command: trivial style fixes
  diff: trivial style fix
  revision: trivial style fixes
  pretty: trivial style fix
  describe: trivial style fixes
  transport-helper: trivial style fix
  sha1-name: trivial style cleanup
  branch: trivial style fix
  revision: add missing include
  doc/pull: clarify the illustrations
  t: replace pulls with merges
  merge: simplify ff-only option
Merge branch 'jc/ref-excludes' into jch

People often wished a way to tell "git log --branches" (and "git
log --remotes --not --branches") to exclude some local branches
from the expansion of "--branches" (similarly for "--tags", "--all"
and "--glob=<pattern>").  Now they have one.

* jc/ref-excludes:
  rev-parse: introduce --exclude=<glob> to tame wildcards
  rev-list --exclude: export add/clear-ref-exclusion and ref-excluded API
  rev-list --exclude: tests
  document --exclude option
  revision: introduce --exclude=<glob> to tame wildcards

# Conflicts:
# 	Documentation/git-rev-parse.txt
# 	builtin/rev-parse.c
Merge branch 'jk/two-way-merge-corner-case-fix' into jch

Fix a rather longstanding corner-case bug in twoway "reset to
there" merge, which is most often seen in "git am --abort".

* jk/two-way-merge-corner-case-fix:
  t1005: add test for "read-tree --reset -u A B"
  t1005: reindent
  unpack-trees: fix "read-tree -u --reset A B" with conflicted index
Merge branch 'cc/remote-remove-redundant-postfixcmp' into jch

Minor code clean-up.

* cc/remote-remove-redundant-postfixcmp:
  builtin/remote: remove postfixcmp() and use suffixcmp() instead
Merge branch 'th/reflog-annotated-tag' into jch

"git log -g $annotated_tag", when there is no reflog history, should
have produced a single output entry (i.e. the ref creation event),
but instead showed the history leading to the tag.

Broken at the design level.  Any reflog entry that points at a non
commit needs to be handled with new code that does not exist yet,
and lifting the "this code handles only commits" without adding
such code does not solve anything.

* th/reflog-annotated-tag:
  reflog: handle lightweight and annotated tags equally
### hold
Merge branch 'jc/hold-diff-remove-q-synonym-for-no-deletion' into jch

* jc/hold-diff-remove-q-synonym-for-no-deletion:
  diff: remove "diff-files -q" in a version of Git in a distant future

# Conflicts:
# 	diff.c
Merge branch 'ak/submodule-foreach-quoting' into jch

A behavior change, but a worthwhile one: "git submodule foreach"
was treating its arguments as part of a single command to be
concatenated and passed to a shell, making writing buggy
scripts too easy.

This patch preserves the old "just pass it to the shell" behavior
when a single argument is passed to 'git submodule foreach' and
moves to a new "skip the shell and use the arguments passed
unmolested" behavior when more than one argument is passed.

The old behavior (always concatenating and passing to the shell)
was similar to the 'ssh' command, while the new behavior (switching
on the number of arguments) is what 'xterm -e' does.

May need more thought to make sure this change is advertised well
so that scripts that used multiple arguments but added their own
extra layer of quoting are not broken.

* ak/submodule-foreach-quoting:
  submodule foreach: skip eval for more than one argument
Merge branch 'jc/push-2.0-default-to-simple' into jch

* jc/push-2.0-default-to-simple:
  push: switch default from "matching" to "simple"

# Conflicts:
# 	Documentation/config.txt
# 	Documentation/git-push.txt
# 	builtin/push.c
Merge branch 'jn/add-2.0-u-A-sans-pathspec' into jch

* jn/add-2.0-u-A-sans-pathspec:
  git add: -u/-A now affects the entire working tree

# Conflicts:
# 	builtin/add.c
Merge branch 'jc/add-2.0-ignore-removal' into jch

Updated endgame for "git add <pathspec>" that defaults to "--all"
aka "--no-ignore-removal".

* jc/add-2.0-ignore-removal:
  git add <pathspec>... defaults to "-A"

# Conflicts:
# 	builtin/add.c
Merge branch 'jc/core-checkstat-2.0' into jch

* jc/core-checkstat-2.0:
  core.statinfo: remove as promised in Git 2.0