Add githook.py, an analog to hghook.py.

It does mostly the same stuff, but doesn't check for merge commits,
because I don't think the commit hooks run for those in git.  If they
do, we can easily add that support later (cf.
   http://stackoverflow.com/questions/3824050/telling-if-a-git-commit-is-a-merge-revert-commit
)

Test plan:
I have a lint error in githook.py.  If this commit succeeds, then the
code doesn't work.  If it fails, I'll fix the lint error and try
committing again; if it succeeds then, then I'll call it good!

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	new file:   githook.py
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   githook.py
#
Add githook.py, an analog to hghook.py.

Summary:
It does mostly the same stuff, but doesn't check for merge commits,
because I don't think the commit hooks run for those in git.  If they
do, we can easily add that support later (cf.
   http://stackoverflow.com/questions/3824050/telling-if-a-git-commit-is-a-merge-revert-commit
)

Add githook.py, an analog to hghook.py.

It does mostly the same stuff, but doesn't check for merge commits,
because I don't think the commit hooks run for those in git.  If they
do, we can easily add that support later (cf.
   http://stackoverflow.com/questions/3824050/telling-if-a-git-commit-is-a-merge-revert-commit
)

Correctly handle the case where there are no edited files in the commit.

Because of the way we do parsing, when there are no files to edit,
files_to_lint ends up as [''], rather than [].  This causes the linter
to lint everything.  We check for that case now.

Test Plan:
I have a lint error in githook.py.  If this commit succeeds, then the
code doesn't work.  If it fails, I'll fix the lint error and try
committing again; if it succeeds then, then I'll call it good!

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	new file:   githook.py
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   githook.py
#

I have a lint error in githook.py.  If this commit succeeds, then the
code doesn't work.  If it fails, I'll fix the lint error and try
committing again; if it succeeds then, then I'll call it good!

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	new file:   githook.py
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   githook.py
#

Ran
   git commit --amend
and saw it caused no linting, rather than linting of everything.

Reviewers: benkomalo, alpert

Differential Revision: http://phabricator.khanacademy.org/D2180