libgit2 / libgit2/libgit2sharp
Last Commit message per treeEntry
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 3.5k
- 派生
- 925
- PR 合并指标
- 30 天内没有已合并 PR
描述
Hi i dont know it is implemented now but i want retrieve treeeObject from repository with last commit message in which commit current file / folder was changed. I trying to solve this for 2 days but didnt find any usefull on forums or on docummentation here. Thanks for help.
Reproduction steps
what i tried
var xxx = tree[path];
// For tree
if (xxx.TargetType == TreeEntryTargetType.Tree)
{
foreach (var item in (Tree)xxx.Target)
{
var CommitMessages = _repository.Commits.QueryBy(item.Path);
string commitMessage = null;
if (CommitMessages != null)
{
commitMessage = CommitMessages.Take(1).Last().Commit.MessageShort;
}
treeObjects.Add(new TreeObject {
Name = item.Name,
Sha = item.Target.Sha,
Type = item.TargetType.ToString(),
Path = item.Path,
CommitMessage = commitMessage
});
}
}
But its very slow and not every time it return InvalidOperationException: Sequence contains no elements and its take too much time ... (17secs till error?)
Expected behavior
To retireive treeEntries with at least commit sha Or better with commit itself
Actual behavior
I can retireve treeEntries and then look for Commits but there is problem it stilll pulling tree in commit and it is so slow,
Version of LibGit2Sharp (release number or SHA1)
commit 8950f498511d9e4cc1756193682ac3bb08581166
Operating system(s) tested; .NET runtime tested
.Net core 3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 tree-entry 示例和 _repository.Commits.QueryBy(item.Path) 的使用开始,然后检查 tree entry 和 commit 查询在 LibGit2Sharp 中的表示方式。将请求的最后一个 commit SHA 或消息与当前缓慢的行为以及空序列失败进行比较。Done 应定义一种可靠且高效的方式,将每个文件或文件夹条目与其最后一个相关 commit 关联起来。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp, git
- 领域
- devtools
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100