Initial version
init: skip git reset if HEAD doesn't exist

This could happen if repo is brand-new with no files.
Create key file with umask of 077
Improve comments about the encryption scheme
When encrypting, use temporary file if file gets too big
Add README and copyright notices
New website URL in README
Set a safe umask before creating temporary files

Although glibc's implementation of mkstemp creates temporary files with
a safe (i.e. 0600) mode, POSIX does not mandate any particular mode.  So
to ensure maximum cross-platform safety, we must set a umask of 0077
before calling mkstemp.
Use arpa/inet.h functions instead of endian.h

Even though arpa/inet.h is "networky" and this isn't a network
application, arpa/inet.h is in POSIX whereas endian.h is non-standard.

This should let git-crypt build on Mac OS X.
Compile with 'c++' instead of 'g++'

We're not relying on any g++-specific features.
Restore original umask after running keygen
Include unistd.h for gcc 4.7

In gcc 4.7, some includes were removed. This fixes the build.

Signed-off-by: Andrew Ayer <agwa@andrewayer.name>
Fix gitattributes example in README

There should NOT be a colon after the pattern.
Improve 'git-crypt init' usability

  * Correctly check for existence of HEAD (use 'git rev-parse' instead
    of 'git show-ref').  Fixes bug where hard reset might be skipped
    after running 'git init'.
  * Don't require working directory to be clean if HEAD doesn't exist.
    (If HEAD doesn't exist, we won't be hard resetting so the working
    directory doesn't need to be clean.)
  * Overwrite existing git config values (instead of --add'ing them) so
    'git-crypt init' can be idempotent.
  * In the error message for a disrty working directory, advise user to
    commit changes or 'git stash' them.
Add 'make install' target
Add AUTHORS file
Update copyright notice to include OpenSSL linking exception
git-crypt init: Ignore untracked files when running git status

Untracked files are not touched by git reset, so git-crypt init
is safe even with untracked files present.

This relies on the -u option to git-status, which was added in Git
1.6.0, which was released in 2008.  Add Git 1.6.0 as a requirement in
the README.
Fix 'git-crypt init' for newer versions of Git

At some point between Git 1.7.1 and Git 1.8.1.3, both 'git reset' and
'git status' stopped noticing that files were modified after their
smudge filter changed.  Consequentially, 'git reset --hard HEAD' would
not decrypt existing encrypted files in the repo.

This commit changes 'git-crypt init' to use 'git checkout -f HEAD
/top/of/repo' instead, which does the job.
Escape arguments to filter commands

This will allow both the path to git-crypt and the path to the key file
to contain arbitrary characters, notably spaces.