CommitFilter / CommitSortStrategies Understanding

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

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

Đánh giá

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

Hướng nghiên cứu

Bắt đầu với các entry point CommitFilter, CommitSortStrategies và QueryBy được tham chiếu trong issue, sau đó so sánh hành vi của chúng với các ví dụ lệnh git được liệt kê. Ghi lại liệu từng phép tương đương được đề xuất có chính xác hay không và nêu rõ ngữ nghĩa sắp xếp của CommitSortStrategies.None; công việc được xem là hoàn thành khi các câu hỏi có lời giải thích có thẩm quyền.

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

Mô tả

I am trying to understand what "CommitSortStrategies" is actually doing to the commit collections that I am getting back and am just looking for clarification if this is correct.

Git, by default (cmd line app), are shown in reverse chronological order, so:

  • git (default sort) == CommitFilter/SortBy of (Undefined)
  • git --reverse != CommitFilter/SortBy of Reverse
  • git --reverse == CommitFilter/SortBy of Reverse | Time
  • git --topo-order == CommitFilter/SortBy of Topological
  • git --reverse --topo-order == CommitFilter/SortBy of Reverse | Topological
  • git --______ ?= CommitFilter/SortBy of None
  • CommitFilter/SortBy of None != CommitFilter/SortBy of (Undefined)

Is that list correct/complete?

(FYI: I have a multi-million object repo with millions of refs and have reverted to shelling to git to get the commit lists between cross-merge branches as I can not get a direct match between libgit2's ls-trees and gits, my head hurts....)

BTW: What order does CommitSortStrategies.None follow? Based on ref creation order on the file-system, maybe?

A sample for a future reader:
# Note: Piping to head as you can not use -n <number>, --max-count=<number> as that is applied before commit ordering
git log HEAD..master --format="%ci %h %s" --reverse | head -10

So based upon the equivalence list above, in libgit2sharp this becomes:

var filter = new CommitFilter {
    SortBy = CommitSortStrategies.Reverse | CommitSortStrategies.Time,
    Since = master,  // determined by a prior repo.Lookup<Tree>
    Until = head, // determined by a prior repo.Lookup<Tree>                    
};
repo.Commits.QueryBy(filter).Take(10);
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

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.

Issue khác của libgit2/libgit2sharp

Tất cả issue của libgit2/libgit2sharp

Issue tương tự

Thêm issue về C#

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.