0
我使用此代码从Guthub获取所有提交。我只想从今天起获得提交。从今天获取所有提交
public void listCommits(String user_name, String password) throws IOException
{
GitHubClient client = new GitHubClient();
client.setCredentials(user_name, password);
RepositoryService service = new RepositoryService(client);
List<Repository> repositories = service.getRepositories();
for (int i = 0; i < repositories.size(); i++)
{
Repository get = repositories.get(i);
System.out.println("Repository Name: " + get.getName());
CommitService commitService = new CommitService(client);
for (RepositoryCommit commit : commitService.getCommits(get))
{
System.out.println("Repository commit: " + commit.getCommit().getMessage());
System.out.println("Repository commit date : " + commit.getCommit().getCommitter().getDate());
}
}
}
有没有什么办法只从今天开始提交?
看起来我不能过滤的结果呢?或者我错了? –
我没有从egit-github库中找到“since”和“until”参数,但Kohsuke拥有它们:https://github.com/kohsuke/github-api/blob/master/src/main/java/org /kohsuke/github/GHCommitQueryBuilder.java –
你能举一些例子说明我可以如何与Kohsuke做到这一点? –