Break out code to write integrity-checked file

The index is integrity-checked with SHA1.  Break the code to write the
index while computing the SHA1 out into a separate file, so that it's
easier for other code to use.

Signed-off-by: David Turner <dturner@twitter.com>
Optionally use VMAC for index integrity checking

Using SHA-1 to check the index integrity takes up about 5% of the
runtime of git status (depending on the repository). We can do better
by using VMAC instead.  VMAC isn't really intended for integrity
checking, but it has the correct properties.  It is also approximately
5 times faster than SHA-1 on my machine.

Signed-off-by: David Turner <dturner@twitter.com>
After chdir to run grep, return to old directory

Signed-off-by: David Turner <dturner@twitter.com>
Add filesystem view caching

Cache a cache for git's view of the working tree.  This can be used to
reduce the number of syscalls to opendir, readdir, and lstat.

Signed-off-by: David Turner <dturner@twitter.com>
Watchman support

Add support for filesystem view caching and updating via Facebook's
Watchman daemon.

Signed-off-by: David Turner <dturner@twitter.com>
hashmap: Remove unused functions

Remove str(i?)hash functions from hashmap.c as they are unused

Signed-off-by: David Turner <dturner@twitter.com>
hashmap: Use SSE to speed up hashmap

The original FNV hashing algorithm processes one byte at a time.  SSE
lets us process more.  This is a lackadaisically tuned implementation;
in my tests, it was the fastest by a hair.  It is about twice as fast
as the original FNV, for about a 5-10% speedup on git status (with
watchman).

Note that you are unlikely to see speed improvements in test-hashmap,
since it uses very short, very similar strings.

Signed-off-by: David Turner <dturner@twitter.com>