s/Causes/Overcommit in prep for gem release

First step in decoupling the functionality from Causes, since it's
mostly unrelated.

Next steps:

  - Create bin/overcommit command which will be installed for the gem,
    supplanting the Rakefile.
  - Reorganize files for sanity
  - Gemspec
  - ???
  - Profit

Change-Id: I0da05b4c56a1309dd0e26f314f58ce58cbfd710d
Reviewed-on: https://gerrit.causes.com/22311
Reviewed-by: Shane da Silva <shane@causes.com>
Tested-by: Aiden Scandella <aiden@causes.com>
First stab at new gem/binary integration

It's not hooked up yet, but we can now build a gem that installs an
`overcommit` binary. That binary uses the newly-created Overcommit::CLI
class, whose implementation is strikingly similar to that of
`scss-lint`. I think Shane did a great job architecting that project, so
I'll be following many of the same patterns.

Change-Id: I9a2d7bc9c042e5c28385bca3647e4c9e4491350f
Reviewed-on: https://gerrit.causes.com/22314
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Separate email from name checking in pre-commit

The causes_email check is now a separate lint, since it's specific to
Causes and should not be installed by default when this is publicly
released.

Piggybacking: remove Causes-specific comment in `hooks/post-checkout`

Change-Id: Ic15b85908b475c08f3c1bc5aa303e0f19fd0117a
Reviewed-on: https://gerrit.causes.com/22319
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Use default date in gemspec

As suggested by Mr. da Salva. Cleaning up my copy pasta.

Change-Id: I6fd7c5064a3305add5e36bb1227a9b421cade4cf
Reviewed-on: https://gerrit.causes.com/22320
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Massive reorganization

Approaching sanity.

Change-Id: I38d8076af33822c18e4dbe78b17859de3ff3f3d0
Reviewed-on: https://gerrit.causes.com/22332
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Reviewed-by: Joe Lencioni <joe.lencioni@causes.com>
Fix 'copy' support

Up until this point, we've been keeping all engineers up-to-date by
symlink'ing everything into a canonical 'git_hooks' repo that is updated
via Chef runs.

For public release, I want 'copy' to be the default install option,
making this project more self-contained. While it would save a few bytes
to symlink into the gem's source directory, it feels much cleaner to me
to just copy the relevant bits.

Change-Id: Ibc59ba5a02fec6d56c059d3555b0ecc38b54f32b
Reviewed-on: https://gerrit.causes.com/22340
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Remove errant `require 'rubygems'`

Not needed or appreciated, especially since this file is not loading any
other libraries.

Change-Id: Ia09fd400797dc46027e38269729e797bdabceb06
Reviewed-on: https://gerrit.causes.com/22347
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Reviewed-by: Joe Lencioni <joe.lencioni@causes.com>
Clean up git_hook style

  - Removing a helper method of dubious value
  - Adding newline for readability
  - Breaking on 80 characters

Change-Id: I02299ade1122d5c53aa3bf866122e0d849cbcf8d
Reviewed-on: https://gerrit.causes.com/22342
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Address style cleanups in Utils

As pointed out by Joe on
https://gerrit.causes.com/#/c/22332/2/lib/overcommit/utils.rb

Change-Id: I5cc01a344f2b9ca9098969b72ff21ad3c91eb430
Reviewed-on: https://gerrit.causes.com/22356
Reviewed-by: Aiden Scandella <aiden@causes.com>
Tested-by: Aiden Scandella <aiden@causes.com>
Skip ctags on stock OS X

The `ctags` binary provided by Apple isn't sufficient, and doesn't
support any of the arguments we try to send it. It also doesn't respond
to --version, making it easy to fail fast.

Will add to documentation that this requires installing a 'normal'
ctags, e.g. via homebrew, for tagging to work on OS X.

Change-Id: Icd16919458c1734f95b28c17468282e9a477e2f7
Reviewed-on: https://gerrit.causes.com/22354
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Fail gracefully on error loading plugin

Rather than crashing, show the user a big red message and `exit 0` so
that the linter halts, but git continues. Useful so that a bad
repo-specific hook doesn't stop developers from committing.

Change-Id: I55d3f435bdf0a795b8cf75d02f33f8491ebc40df
Reviewed-on: https://gerrit.causes.com/22355
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Move `require's to where they're actually needed

E.g. in the checks that actually need the things, so we're not requiring
code if the user wants to skip these checks.

Change-Id: Ieb4e4b9b0b433240cf85b0b60ad770cfa05fb02e
Reviewed-on: https://gerrit.causes.com/22362
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Extract `Reporter' class

Slimming down classes, separating concerns. Next step is to get all
'puts'-ing out of the GitHook class.

Change-Id: I21b91f4a7c020e33354c197f75d97c9611061d05
Reviewed-on: https://gerrit.causes.com/22363
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Extract more printing logic into Reporter

`GitHook` is no longer printing anything from inside the class (except
for load errors). This significantly simplifies #run.

Change-Id: I51aba00b2c45d1b33a643637ae43006b150ed55c
Reviewed-on: https://gerrit.causes.com/22374
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Move hook registration to Utils

This didn't belong in the 'GitHook' module, leading to some awkward
asymmetry when loading/running hooks.

Change-Id: I95f6660e200fde95918d10ff106c086051317c0a
Reviewed-on: https://gerrit.causes.com/22376
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Make Reporter#print_incremental_result private

It's internally used but should not be exposed.

Change-Id: If185945292e3350ea9693d0fc05fa0a39663b4b1
Reviewed-on: https://gerrit.causes.com/22653
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Add back missing hook registration

Was moved in 8ad3ecbae but I forgot to commit the changes to this file.

Change-Id: Ibe5c4a8a772488e11386754b83b90b9e75869bb0
Reviewed-on: https://gerrit.causes.com/22654
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Remove StagedFile and FileMethods

In the interest of locality and sanity. Discovered that StagedFile was
being used as nothing more than a wrapper for a path, so I killed it.
Moved FileMethods onto the objects that used them, with shared
functionlity in Utils.

Change-Id: Iff5afc8c95809b5de6eb9b1526267bf05294bdf4
Reviewed-on: https://gerrit.causes.com/22667
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Support empty hook state

I want to allow for a future where this utility can be used even without
installing any of the 'default' checks (the ones in this repo). This
way, the hook infrastructure remains dormant until repo-specific hooks
are added (e.g. myproject.git:.githooks/pre_commit/custom_hook.rb).

Change-Id: I6393e4c02ba569799d816598d03a6ed6cb2d8014
Reviewed-on: https://gerrit.causes.com/22670
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Add spacing to match block style

Change-Id: I3b6e02dad039391a3d58427715d8ac65a88c1fed
Reviewed-on: https://gerrit.causes.com/22696
Tested-by: Aiden Scandella <aiden@causes.com>
Reviewed-by: Joe Lencioni <joe.lencioni@causes.com>