うーん。このニーズにすぐに対応できるものはありません。
ただし、リビジョン履歴をさかのぼって追加と変更を特定することで、調査対象のコミットに存在する各ファイルの最新の変更日を収集できます。
これはどう?
public void LetUsTryThis()
{
using (var repo = new Repository(StandardTestRepoPath))
{
var referenceCommit = repo.Head.Tip;
IEnumerable<KeyValuePair<string, DateTimeOffset>> res = LatestChanges(repo, referenceCommit);
foreach (KeyValuePair<string, DateTimeOffset> kvp in res)
{
Console.WriteLine(string.Format("{0} - {1}", kvp.Key, kvp.Value));
}
}
}
private IEnumerable<KeyValuePair<string, DateTimeOffset>> LatestChanges(Repository repo, Commit referenceCommit)
{
IDictionary<string, DateTimeOffset> dic = new Dictionary<string, DateTimeOffset>();
var commitLog = repo.Commits.QueryBy(new CommitFilter { Since = referenceCommit })
.Concat(new[] { default(Commit) })
.Skip(1);
var mostRecent = referenceCommit;
foreach (Commit current in commitLog)
{
IEnumerable<KeyValuePair<string, DateTimeOffset>> res = ExtractAdditionsAndModifications(repo, mostRecent, current);
AddLatest(dic, res);
mostRecent = current;
}
return dic.OrderByDescending(kvp => kvp.Value);
}
private IEnumerable<KeyValuePair<string, DateTimeOffset>> ExtractAdditionsAndModifications(Repository repo, Commit next, Commit current)
{
IDictionary<string, DateTimeOffset> dic = new Dictionary<string, DateTimeOffset>();
var tc = repo.Diff.Compare(current == null ? null : current.Tree, next.Tree);
foreach (TreeEntryChanges treeEntryChanges in tc.Added)
{
dic.Add(treeEntryChanges.Path, next.Committer.When);
}
foreach (TreeEntryChanges treeEntryChanges in tc.Modified)
{
dic.Add(treeEntryChanges.Path, next.Committer.When);
}
return dic;
}
private void AddLatest(IDictionary<string, DateTimeOffset> main, IEnumerable<KeyValuePair<string, DateTimeOffset>> latest)
{
foreach (var kvp in latest)
{
if (main.ContainsKey(kvp.Key))
{
continue;
}
main.Add(kvp);
}
}