Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do you get commits? #39

Open
kevinchugh opened this issue Mar 4, 2015 · 6 comments
Open

how do you get commits? #39

kevinchugh opened this issue Mar 4, 2015 · 6 comments

Comments

@kevinchugh
Copy link

I can instantiate an instance of Bitbucket, I can authenticate, I can get repos, but given an authenticated bitbucket instance, how do you actually retrieve a list of commits? I have tried setting the repo attribute to a repo name (returned from .repos.list) and I've tried setting the repo attribute to a repo object, and have tried bitbucket.repo.commits but always get nil. Can you give me some guidance? Thanks for any help.

@mlainez
Copy link

mlainez commented May 25, 2015

Same problem here. Did you manage to fix this?

@seemywingz
Copy link

I'm experiencing this as well. I know it's been some time since there has been any work on tis repo, but I think you have a good thing going here. I'd like to see this working

@mmontalvo
Copy link

Maybe a bit late but I would like to share what I found.
Once you have your Oauth credentials set, you can do something like this:
comm = BitBucket::Repos::Commits.new
@commits = comm.get(bitbucket_user_name, bitbucket_repo_name)

@mmontalvo
Copy link

Sorry, also you need to get a forked version of the gem (as commits resource is found in 2.0 Bitbucket API version, not 1.0)

@ghost ghost mentioned this issue Mar 24, 2016
@ghost
Copy link

ghost commented Mar 24, 2016

I've made a PR for this. If it gets merged you should just be able to run:

BitBucket::Repos::Commits.new.get('username', 'repo_name')

from your app, provided you are authenticated.

@atchyut-re
Copy link

@alfredoliverwillder Firstly Thanks for that pull request. I had used
BitBucket::Repos::Commits.new.get('username', 'repo_name') but there is an error saying

BitBucket::Error::NotFound: GET https://bitbucket.org/api/1.0/repositories/atchyut_re/ruby/commits: 404 {"error": {"message": "Resource not found", "detail": "There is no API hosted at this URL.\n\nFor information about our API's, please refer to the documentation at: https://confluence.atlassian.com/x/IYBGDQ"}}

But the changes in the code are getting the url of version 2.0
get_request("/2.0/repositories/#{user}/#{repo.downcase}/commits")

So, can you please once look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants