libgit2 / libgit2/libgit2sharp
Add branch querying/filtering feature
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ả
The git-branch doc states
With --contains, shows only the branches that contain the named commit (in other
words, the branches whose tip commits are descendants of the named commit).
With --merged, only branches merged into the named commit (i.e. the branches whose
tip commits are reachable from the named commit) will be listed.
With --no-merged only branches not merged into the named commit will be listed.
If the <commit> argument is missing it defaults to HEAD (i.e. the tip of the
current branch).
A potential API design might rely on the following
- Add a
QueryBy()method to theBranchCollectionin a similar way to theCommitCollection.QueryBy()method. - Rename the current
Filtertype toCommitFilter, in order to allow the creation of aBranchFIlter
Binding the following method might also be helpful. Related libgit2 tests can be found here.
/**
* Find a merge base between two commits
*
* @param out the OID of a merge base between 'one' and 'two'
* @param repo the repository where the commits exist
* @param one one of the commits
* @param two the other commit
*/
GIT_EXTERN(int) git_merge_base(
git_oid *out,
git_repository *repo,
git_oid *one,
git_oid *two);
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với BranchCollection và so sánh API QueryBy() được đề xuất của nó với CommitCollection.QueryBy(). Xem xét kiểu Filter hiện tại trước khi cân nhắc việc đổi tên được đề xuất, sau đó kiểm tra các test của revwalk/mergebase.c trong libgit2 và binding git_merge_base. Công việc được xem là hoàn tất khi các truy vấn branch contains/merged/not-merged và API merge-base liên quan được định nghĩa cùng với các test tương ứng, đồng thời thiết kế API đã được thống nhất.
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
- backend-api-design
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 25/100