libgit2 / libgit2/libgit2sharp
Feature request: ability to serialize & dehydrate patch changes
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ả
This isn't a bug - this is a feature request for an app I've written, using libgit2sharp: diff-buddy (https://github.com/fluffynuts/diff-buddy) which aims to help on larger reviews which are difficult to impossible on GitHub - the page just falls over.
diff-buddy is able to give an overview, show the diff for one file, or run in review mode where someone can go through the files of interest, store commentary, and copy that to the PR once done. diff-buddy stores state so a review doesn't have to be completed all at once.
Currently, for review purposes, the review UI steps through each file, applying exclusions (eg ignore files with a certain path, ignore files where the only changes are added / removed using statements, etc) to get the review down to the most interesting files. Stepping through files is slow, and the most time is spent, expecially on a really large diff, in re-diffing the tree every time we step - as the actual diff work is done in a sub-process. This is not a criticism of libgit2sharp - the whole reason for using diff-buddy is that the overall changes are vast - too vast for the GH web interface to provide a useful review interface to.
Yes, I could re-work the architecture a bit - call directly in and apply some in-memory caching, but a seemingly simple way was to just save a JSON blob of the Patch state somewhere in a cache folder & re-use that - however, I can't because Patch implements the read-only collection IEnumerable interface. I wouldn't even mind if I had to some of the lifting - enumerate through all diffs, store & re-hydrate manually, but I can't do that either as PatchEntryChanges aren't individually serializable.
The ability to serialize and deserialize this info may also be useful for other client-server operations (eg where a server could do the actual diffing and a client could do work with it) - which was another approach I considered, but, of course, if I can't serialize/deserialize, I can't pass that across the wire either.
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
Yêu cầu này liên quan đến các kiểu Patch và PatchEntryChanges; trước tiên, hãy xem xét cấu trúc công khai của chúng cùng các ràng buộc hiện tại về collection và serialization. Xác định một biểu diễn round-trip cho một Patch và các entry của nó, sau đó xác minh rằng dữ liệu đã serialize có thể được khôi phục với các thay đổi tương đương; issue không nêu tệp hoặc bài kiểm tra cụ thể nào.
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ó
- 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
- 35/100