3

Is it possible right now, programatically to get a list of commits on an AWS CodeCommit repository?

I understand I can use the git command, but I am trying to get the repository information by using CodeCommit's API. Is that possible, or des the API not exist?

Community
  • 1
  • 1
chrisrhyno2003
  • 3,906
  • 8
  • 53
  • 102

2 Answers2

4

You can use:

aws codecommit get-branch --repository-name MyRepo --branch-name MyBranch

In order to get the commit ID of the branch.

Then you can call:

aws codecommit get-commit --repository-name MyRepo --commitId MyCommitID

to get the comment, author and parent commit ID. Iterating through the parent IDs you can get the history.

david.perez
  • 6,090
  • 4
  • 34
  • 57
2

An API to directly get commit history is not currently available.

As a general rule, we don't comment on the future direction of the service, but we'd be interested in hearing the details of your use case.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Paige Phillips
  • 287
  • 2
  • 3
  • @LoicTheAztec I disagree, it answers the question "Is there an API" with "No". – Mark Rotteveel Jun 11 '16 at 10:10
  • Well, its more like using the git log command to see the list of commits to a file. If our server is failing, perhaps take a look at who committed what. The getCommit needs a commitID which seems tedious – chrisrhyno2003 Jun 14 '16 at 21:49