libgit2 / libgit2/libgit2sharp

Feature request: ability to serialize & dehydrate patch changes

Aberta
#2,013 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Linguagem predominante
C#
Estrelas
3.5k
Forks
925
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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.

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

A solicitação diz respeito aos tipos Patch e PatchEntryChanges; comece revisando sua estrutura pública e as restrições atuais de coleção e serialização. Defina uma representação round-trip para um Patch e suas entradas e, em seguida, verifique se os dados serializados podem ser restaurados com alterações equivalentes; nenhum arquivo ou teste específico é mencionado na issue.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
csharp, git
Domínio
devtools
Tipo de issue
Funcionalidade
Dificuldade
5/5
Tempo estimado
Mais de uma semana
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.