I have been working on a Java based product for which the Git features are going to be integrated. Using one of the Git features, I have done adding 10+ files into the Git repository by staging followed by committing them in a single commit.
Is the reverse of the above process possible? I.e Finding the list of files committed as part of a commit.
I got the commit with the help of the git.log()
command but I am not sure how to get the file list for the commit.
Example Code:
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
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…