Monday, 15 July 2013

json - How to fetch number of commits at Bitbucket using its API -



json - How to fetch number of commits at Bitbucket using its API -

is there way fetch number of commits through bitbucket api , utilize in program? don't want show message or number of commits programmers in section.

i've looked @ api documentation still wasn't able it.

you can utilize next url query number of changesets:

https://bitbucket.org/api/1.0/repositories/{account}/{repo}/changesets?limit=0

you have alter {account} , {repo} business relationship repository want know. homecoming json count field denoting number of commits in repository. remember set limit=0 parameter (which provides general info without listing commits themselves).

example

to know number of commits in atlassian-plugins repo atlassian using curl command line tool:

$ curl "https://bitbucket.org/api/1.0/repositories/atlassian/atlassian-plugins/changesets?limit=0" {"count": 4449, "start": null, "limit": 0, "changesets": []}

check first field, count, shows repository has 1234 commits.

json rest bitbucket bitbucket-api

No comments:

Post a Comment