2

I have a database of the links to GitHub commits (or hashes) of some projects. I want to do a sentiment analysis of commit comments (messages). I need to print the commit message of one given commit but from a big set of the projects.

However, how can I do this without cloning all of the projects and retrieving the information from the specific commits individually?

1

1 Answer 1

1

You can use the official GitHub REST API v3, specifically the commits endpoint of the Git database API and retrieve the commit as a JSON object. The syntax is the following:

GET /repos/:owner/:repo/git/commits/:commit_sha

Replace :owner, :repo and :commit_sha by correct values. For example:

GET https://api.github.com/repos/torvalds/linux/git/commits/8dc765d438f1e42b3e8227b3b09fad7d73f4ec9a

is the JSON representation of this commit: https://github.com/torvalds/linux/commit/8dc765d438f1e42b3e8227b3b09fad7d73f4ec9a

with a field message containing the commit message.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.