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