hulu/restfulgit — pull request #63 by cvrebert (2013-12-17 02:24:07+00:00)
Title: sort out Repo API for individual commits & their diffs

X-Ref: #56.

I'm not entirely sure having both `/commits/.diff` and `/commits/` ever worked completely properly with Flask/Werkzeug's routing system. When I started unit testing, some gremlins exposed themselves.

Another alternative is to merge them into a single `/commits/` endpoint, and then have the view function figure out whether it should serve a diff or JSON, but:
* that guessing logic is annoying to write
* it seems difficult/impossible to have Flask make `/commits/.diff` (rather than `/commits/.diff/`) and `/commits//` (rather than `/commits/`) be the respective canonical URLs
* and `/commit/.diff` is the only version that GitHub recognizes anyway

Therefore, this pull request implements the endpoints GitHub-style (i.e. `/commits//` and `/commit/.diff`). (Yes, their scheme is inconsistent in that all other related APIs are under `/commits/*`.)

CC: @rajivm @dlindquist @kainswor for review

(P.S.: @rajivm, You seem to have outdone GitHub by managing to support diff-ing the initial commit :smile: )