errbit/errbit — pull request #625 by boblail (2013-12-15 20:01:44+00:00)
Title: When linking backtrace lines to GitHub, link to the exact version of the source code that generated the error

When `GIT_COMMIT` is present in a notice's environment variables, it is used in place of `App#repo_branch` to create links from the backtrace to source code.

Applications can send `GIT_COMMIT` to Errbit by adding something like this to `config/initializers`:

```ruby
# Inform Errbit of the version of the codebase checked out

GIT_COMMIT = ENV.fetch('COMMIT_HASH', `git log -n1 --format='%H'`.chomp).freeze

module SendCommitWithNotice
def cgi_data
super.merge("GIT_COMMIT" => GIT_COMMIT)
end
end

Airbrake::Notice.send :prepend, SendCommitWithNotice
```

This PR depends on #623. The relevant commits in _this_ PR are [66770ac...f27367d](https://github.com/errbit/errbit/compare/66770ac...f27367d).