libgit2 / libgit2/libgit2sharp

Last Commit message per treeEntry

オープン
#1,733 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

tree-entry の例と _repository.Commits.QueryBy(item.Path) の使用から始め、次に LibGit2Sharp で tree entry と commit query がどのように表現されているかを確認します。要求された最後の commit SHA またはメッセージを、現在の遅い動作および空のシーケンスでの失敗と比較します。Done では、各ファイルまたはフォルダーのエントリを最後の関連する commit に関連付ける、信頼性と効率性のある方法を定義する必要があります。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, git
領域
devtools
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。