filebuf: make unlocking atomic

When renaming a lock file to its final location, we need to make sure
that it is replaced atomically.

We currently have a workaround for Windows by removing the target file.
This means that the target file, which may be a ref or a packfile, may
cease to exist for a short wile, which shold be avoided.

Implement the workaround only in Windows, by making sure that the file
we want to replace is writable.
treebuilder: use a map instead of vector to store the entries

Finding a filename in a vector means we need to resort it every time we
want to read from it, which includes every time we want to write to it
as well, as we want to find duplicate keys.

A hash-map fits what we want to do much more accurately, as we do not
care about sorting, but just the particular filename.

We still keep removed entries around, as the interface let you assume
they were going to be around until the treebuilder is cleared or freed,
but in this case that involves an append to a vector in the filter case,
which can now fail.

The only time we care about sorting is when we write out the tree, so
let's make that the only time we do any sorting.
treebuilder: don't keep removed entries around

If the user wants to keep a copy for themselves, they should make a
copy. It adds unnecessary complexity to make sure the returned entries
are valid until the builder is cleared.
treentry: no need for manual size book-keeping

We can simply ask the hasmap.
Update CONTRIBUTING and PROJECTS

This updates CONTRIBUTING to reflect the changes to use the
master branch and make explicit recommendations about updating
CHANGELOG.md and providing test coverage.  Also, this includes
some old updates to PROJECTS.md that I wrote to expand the list
of projects, pulling in things from old feature requests.
missing paren
Merge remote-tracking branch 'upstream/cmn/filebuf-atomic-unlock'
Add a CHANGELOG entry for the filebuf change
Share packs across repository instances

Opening the same repository multiple times will currently open the same
file multiple times, as well as map the same region of the file multiple
times. This is not necessary, as the packfile data is immutable.

Instead of opening and closing packfiles directly, introduce an
indirection and allocate packfiles globally. This does mean locking on
each packfile open, but we already use this lock for the global mwindow
list so it doesn't introduce a new contention point.
crlf: pass-through mixed EOL buffers from LF->CRLF

When checking out files, we're performing conversion into the user's
native line endings, but we only want to do it for files which have
consistent line endings. Refuse to perform the conversion for mixed-EOL
files.

The CRLF->LF filter is left as-is, as that conversion is considered to be
normalization by git and should force a conversion of the line endings.
Merge pull request #2434 from libgit2/rb/contributing-updates

Update CONTRIBUTING and PROJECTS
Merge branch 'cmn/global-mwf'
Add CHANGELOG entry for shared packs
Merge remote-tracking branch 'upstream/cmn/treebuilder-perf'
Add CHANGELOG entry for treebuilder map
Merge remote-tracking branch 'upstream/cmn/mixed-eol-passthrough'
Add CHANGELOG entry for mixed-EOL fix
Update text=auto / core.autocrlf=false behavior

Git for Windows 1.9.4 changed the behavior when the text=auto
attribute is specified and core.autocrlf=false.  Previous observed
behavior would *not* filter files when going into the working
directory, the new behavior *does* filter.  Update our behavior to match.
Export git_revert_commit
Merge pull request #2439 from ethomson/revert_export

Export git_revert_commit