gitlabhq/gitlabhq — pull request #6831 by pkill (2014-04-21 09:43:53+00:00)
Title: Provide better email subject lines from email on push service

## Feature: Better email subject lines from email on push service
Feature request: http://feedback.gitlab.com/forums/176466-general/suggestions/5767809-add-commit-message-to-email-on-push-subject

If one commit is pushed, display the commit message in the subject
line. Otherwise display the number of commits pushed to the repository.

### Tests
I performed my tests using the Gitlab Cookbook described here https://gitlab.com/gitlab-org/cookbook-gitlab/blob/master/doc/development.md

#### Feature test
I activated Email-on-push service for one of the projects with git@localhost as the recipient. I edited the configuration for the development environment to perform deliveries and use sendmail.

Then I installed mail-utils so I can check email. I pushed a single commit, 2 commits, and 6 commits as three separate trials. In all cases, the subject line was as I expected without introducing any regressions. I verified by checking mail with the mail command on the shell and by looking at the emails rendered in the DEBUG logs.

#### RSpec and Spinach tests
I modified two existing unit tests to account for enhanced subject lines. All tests passing.