Skip to content

Client Implementation: Gitlab::Git::Repository#diff for migration

~Conversation: #565 (closed)

https://gitlab.com/gitlab-org/gitlab-ce/blob/d5d249764350b07340ed45068361d7249b3cf641/lib/gitlab/git/repository.rb#L926-935

Gitlab::Git::Repository#diff_patches: This method returns a Rugged iterator that we later loop over in Gitlab::Git::DiffCollection. DiffCollection lazily wraps the rugged patches into Gitlab::Git::Diff objects.

What we need instead is either to:

  • change #diff_patches so that it returns an iterator of Gitlab::Git::Diff instances (assuming that Gitlab::Git::Diff is suitable for protobuf serialization), so that we can have an RPC that returns a stream of diff objects that we can plug into DiffCollection
  • find a way to serialize a DiffCollection instance, so that we can build the DiffCollection in Gitaly and set it down the wire back to gitlab-ce

Related

Edited by Andrew Newdigate
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information