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

Ability to specify both branch and sha parameters at same time in GHCommitQueryBuilder #90

Closed
vr100 opened this issue May 12, 2014 · 2 comments

Comments

@vr100
Copy link
Contributor

vr100 commented May 12, 2014

Github allows you to specify "sha" parameter multiple times while querying for commits. For eg., the case where we need commits from branch x from commit sha y, we could specify sha query parameter twice in the github api url. The current code has no way to achieve this scenario.

(This is related to Merge of pull request #86 . Commit : a409b4f)

@vr100 vr100 closed this as completed May 12, 2014
@vr100 vr100 reopened this May 12, 2014
@vr100
Copy link
Contributor Author

vr100 commented May 12, 2014

Sorry for the confusion.
Here is the details of what works and what does not work

Works:
gitHub.getUser("kohsuke").getRepository("github-api").queryCommits().from("gh-pages")
=> Shows all 45 commits in branch gh-pages

Works:
gitHub.getUser("kohsuke").getRepository("github-api").queryCommits().from("5c6267b37624540c568a18ae7ee337a00a2d992c")
=> Shows the three commits starting from the given commit sha

Works:
gitHub.getUser("kohsuke").getRepository("github-api").queryCommits().from("gh-pages").from("5c6267b37624540c568a18ae7ee337a00a2d992c")
=> Shows three commits from the given commit number. Actually ignores the branch option given
and takes only the sha option. (This was the case I tested first and closed the issue :( )

Doesn't work:
gitHub.getUser("kohsuke").getRepository("github-api").queryCommits().from("5c6267b37624540c568a18ae7ee337a00a2d992c").from("gh-pages")
=> Shows all 45 commits in branch gh-pages. It ignores the sha option we have specified.
Expected: Show only 3 commits from given sha from the given branch

@vr100
Copy link
Contributor Author

vr100 commented May 28, 2014

Tested the corresponding two apis with Github REST calss:
https://api.github.com/repos/kohsuke/github-api/commits?sha=5c6267b37624540c568a18ae7ee337a00a2d992c&sha=gh-pages
https://api.github.com/repos/kohsuke/github-api/commits?sha=gh-pages&sha=5c6267b37624540c568a18ae7ee337a00a2d992c

The github-api is working the same way the REST api does. Hence closing the issue. Sorry for any inconvenience caused.

@vr100 vr100 closed this as completed May 28, 2014
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

1 participant