tsuru / gandalf

Gandalf is an HTTP API for managing Git repositories.
https://gandalf.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
267 stars 55 forks source link

Create a handler to return log message and textual diff for a given ref of a repository #164

Open scorphus opened 10 years ago

scorphus commented 10 years ago

Something like:

GET /repository/:name/show/:ref

That returns:

[
    {
        "ref": "f0a0b3e8e8d3f3f0a9a6e6e3e4a9d4e2d9a0c9c7",
        "parent": "e2e9e4a1d3d9e3a0c8c3e1a4e9d2a3e0e6e1a8e6",
        "title": "Do something",
        "diff": "…", # The actual diff
        "author": {
            "name": "Doge Dog",
            "email": "doge.dog@gmail.com"
        },
        "committer": {
            "name": "Dog Doge",
            "email": "dog.doge@gmail.com"
        },
        "created_at": "Thu Sep 4 20:48:18 2014 -0300"
    }
]
scorphus commented 10 years ago

To fulfill this feature, one should choose to use the following:

git show <ref> --pretty="format:%H%x09%an%x09%ae%x09%ad%x09%cn%x09%ce%x09%cd%x09%P%x09%s"