我一直在研究将要集成Git功能的基于Java的产品。使用其中一个Git特性,我通过登台将10多个文件添加到Git存储库中,然后在单次提交中提交它们。如何获得提交的文件列表JGit
上述过程可能与上述过程相反吗? I.e查找作为提交一部分提交的文件列表。
我与git.log()
命令的帮助犯,但我不知道如何获得提交的文件列表。
示例代码:
Git git = (...);
Iterable<RevCommit> logs = git.log().call();
for(RevCommit commit : logs) {
String commitID = commit.getName();
if(commitID != null && !commitID.isEmpty()) {
TableItem item = new TableItem(table, SWT.None);
item.setText(commitID);
// Here I want to get the file list for the commit object
}
}
请说明'Git功能'是什么。您是指[Eclipse JGit](https://eclipse.org/jgit/),还是指Eclipse IDE Git集成,或者其他的东西? –
是的你是对的赫尔曼。我在谈论JGit。我需要一个函数调用,用于获取作为提交一部分提交的文件列表。 –
然后向我们展示一些代码,到目前为止您尝试过了什么? –