Implement DiffService.GetPatchID
This is a new gRPC method introduced with Gitaly v15.8.
It does not seem to be used in GitLab Rails v15.8.0-rc42, but it will perhaps in later versions.
The point is to be able to compare patches in different commits (to detect duplication of changes).
See also git-patch-id(1)
.
A tricky part is the case of binary files: the Golang implementation uses git diff --full-index
to
get unique hashes of the file before and after, but our own blob OIDs are not hashed-based and hence we
will have to inject the actual file Node ID in there instead on relying on the blob OID.