angular/angular.js — pull request #2746 by JensRantil (2013-05-22 14:53:26+00:00)
Title: test(commit-msg-format): Script for Travis CI

This pull request introduces a Travis CI test that makes sure that commit messages are formatted according to [the commit guidelines](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y). The idea came from [this comment](https://github.com/angular/angular.js/pull/2713#issuecomment-18205283). If Travis CI immediately could have told me I broke the build, that would have been nice I thought. I also noticed that there are a fair amount of pending pull requests. Sampling them, they hold a bunch of commits that do not adhere to the commit message guidelines.

The script first extracts a range of commits based on heuristics mostly from Travis CI-exposed environment variables. If a pull request, it checks all commits in the PR, otherwise it simply checks the HEAD commit of the checked branch. This means that commits can be missed if Travis CI batches up multiple commits. Initially I checked the last 20 commits, but immediately discovered that there were some commits that did not adhere to the commit message guidelines.

I have (obviously) tested this locally, but also through Travis CI [here](https://travis-ci.org/JensRantil/angular.js).

A couple of questions:
* Is this something that you are interested in?
* The script is in Bash/AWK. I've noticed `changelog.js` is in JavaScript. Are most scripts expected to be written in JavaScript?