Java Jgit-从分支获取所有提交
你好 伙计们,我有点问题 我尝试从分支获取所有提交,但Jgit跳过了一半提交 提交时间:2019年11月26日星期二15:26:19 EET 提交时间:2019年11月26日星期二14:28:01 EET 提交时间:2019年11月13日星期三15:44:40 EET 提交时间:2019年11月12日星期二16:27:27 EET 从11月26日到13日,我有一个很大的承诺范围 这是我的密码Java Jgit-从分支获取所有提交,java,automation,jgit,Java,Automation,Jgit,你好 伙计们,我有点问题 我尝试从分支获取所有提交,但Jgit跳过了一半提交 提交时间:2019年11月26日星期二15:26:19 EET 提交时间:2019年11月26日星期二14:28:01 EET 提交时间:2019年11月13日星期三15:44:40 EET 提交时间:2019年11月12日星期二16:27:27 EET 从11月26日到13日,我有一个很大的承诺范围 这是我的密码 RevWalk walk = new RevWalk(repo); walk.markStart(w
RevWalk walk = new RevWalk(repo);
walk.markStart(walk.parseCommit(repo.resolve(Constants.HEAD)));
walk.sort(RevSort.TOPO);// chronological order
walk.setRevFilter(RevFilter.ALL);
for(RevCommit commit : walk ) {
System.out.println(commit.getAuthorIdent().getWhen());
}
如果我们检查gitLab,skip之前的最后一次提交是11月26日
在该提交中,开发人员将“当前分支”合并到“某个测试分支”
在那次承诺之后,我们有一个大的跳跃
我希望你们中的一些人已经遇到了这个问题,可以帮助我)在中看到这一点,基本上您可以使用“Log”命令来实现这一点:
try (Git git = new Git(repository)) {
ObjectId branchId = repository.resolve("somebranch");
Iterable<RevCommit> commits = git.log().add(branchId).call();
int count = 0;
for (RevCommit commit : commits) {
System.out.println("LogCommit: " + commit);
count++;
}
}
try(Git-Git=new-Git(存储库)){
ObjectId branchId=repository.resolve(“somebranch”);
Iterable commits=git.log().add(branchId.call();
整数计数=0;
for(RevCommit:commit){
System.out.println(“LogCommit:+commit”);
计数++;
}
}