libgit2 / libgit2/libgit2sharp

Last Commit message per treeEntry

Đang mở
#1,733 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
C#
Star
3.5k
Fork
925
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với ví dụ về tree-entry và việc sử dụng _repository.Commits.QueryBy(item.Path), sau đó xem xét cách các mục tree và các truy vấn commit được biểu diễn trong LibGit2Sharp. So sánh SHA hoặc thông báo commit cuối cùng được yêu cầu với hành vi chậm hiện tại và lỗi khi chuỗi rỗng. Done cần xác định một cách đáng tin cậy và hiệu quả để liên kết mỗi mục tệp hoặc thư mục với commit liên quan cuối cùng của nó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp, git
Lĩnh vực
devtools
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.