Introduce core.safecrlf handling
Determine crlf safety by statistics, not literal reversibility
cred: tighten username rules

The ssh-specific credentials allow the username to be missing. The idea
being that the ssh transport will then use the username provided in the
url, if it's available. There are two main issues with this.

The credential callback already knows what username was provided by the
url and needs to figure out whether it wants to ask the user for it or
it can reuse it, so passing NULL as the username means the credential
callback is suspicious.

The username provided in the url is not in fact used by the
transport. The only time it even considers it is for the user/pass
credential, which asserts the existence of a username in its
constructor. For the ssh-specific ones, it passes in the username stored
in the credential, which is NULL. The libssh2 macro we use runs strlen()
against this value (which is no different from what we would be doing
ourselves), so we then crash.

As the documentation doesn't suggest to leave out the username, assert
the need for a username in the code, which removes this buggy behavior
and removes implicit state.

git_cred_has_username() becomes a blacklist of credential types that do
not have a username. The only one at the moment is the 'default' one,
which is meant to call up some Microsoft magic.
Merge pull request #2274 from libgit2/cmn/ssh-expect-username

cred: tighten username rules
Introduce git_cred_ssh_interactive_new()

This allows for keyboard-interactive based SSH authentication
Make git_cred_ssh_custom_new() naming more consistent
Replace void * with proper callback types
Merge pull request #2213 from ethomson/safecrlf

Introduce core.safecrlf handling
Fix inconsistent use of lower-case and upper-case names for macros
Use CHECK_C_COMPILER_FLAG to determine if the compiler supports a flag

This simplifies platform/compiler dependent checks where we optionally
enable features or disable warnings.
Only disable deprecation warnings on Apple for OpenSSL
Pop ignore only if whole relative path matches

When traversing the directory structure, the iterator pushes and
pops ignore files using a vector.  Some directories don't have
ignore files, so it uses a path comparison to decide when it is
right to actually pop the last ignore file.  This was only
comparing directory suffixes, though, so a subdirectory with the
same name as a parent could result in the parent's .gitignore
being popped off the list ignores too early.  This changes the
logic to compare the entire relative path of the ignore file.
Cleanup tests with helper functions
Only zero sensitive information on destruction (and memory actually allocated by us)
Preload attribute files that may contain macros

There was a latent bug where files that use macro definitions
could be parsed before the macro definitions were loaded.  Because
of attribute file caching, preloading files that are going to be
used doesn't add a significant amount of overhead, so let's always
preload any files that could contain macros before we assemble the
actual vector of files to scan for attributes.
Fix ignore difference from git with trailing /*

Ignore patterns that ended with a trailing '/*' were still needing
to match against another actual '/' character in the full path.
This is not the same behavior as core Git.

Instead, we strip a trailing '/*' off of any patterns that were
matching and just take it to imply the FNM_LEADING_DIR behavior.
Minor fixes

Only apply LEADING_DIR pattern munging to patterns in ignore and
attribute files, not to pathspecs used to select files to operate
on.  Also, allow internal macro definitions to be evaluated before
loading all external ones (important so that external ones can
make use of internal `binary` definition).
Merge pull request #2279 from libgit2/rb/moar-eegnöre-fîxés

Fix several ignore and attribute file behavior bugs
Merge pull request #2273 from jacquesg/ssh-interactive

Add support for SSH keyboard-interactive authentication
Introduce AddCFlagIfSupported CMake macro