libgit2 / libgit2/libgit2sharp
Feature request: ability to serialize & dehydrate patch changes
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 3.5k
- 派生
- 925
- PR 合并指标
- 30 天内没有已合并 PR
描述
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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
该请求涉及 Patch 和 PatchEntryChanges 类型;首先检查它们的公共结构以及当前的集合和序列化约束。为 Patch 及其条目定义一种往返表示,然后验证序列化数据是否可以连同等效更改一起恢复;issue 中未指定任何具体文件或测试。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp, git
- 领域
- devtools
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100