sort out Repo API for individual commits & their diffs #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
X-Ref: #56.
I'm not entirely sure having both
/commits/<thing>.diff
and/commits/<thing>
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/<almost-arbitrary-string>
endpoint, and then have the view function figure out whether it should serve a diff or JSON, but:/commits/<thing>.diff
(rather than/commits/<thing>.diff/
) and/commits/<thing>/
(rather than/commits/<thing>
) be the respective canonical URLs/commit/<thing>.diff
is the only version that GitHub recognizes anywayTherefore, this pull request implements the endpoints GitHub-style (i.e.
/commits/<thing>/
and/commit/<thing>.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 😄 )