The FindChangedPaths RPC should return the associated commit ID for each entry
The FindChangedPaths RPC returns raw diff output from git-diff-tree(1). RPC input maybe a combination of commit IDs and tree-ish pairs that get passed to the Git command on stdin. If many commits are provided on stdin, there is not a good way to know which raw diff entries are associated with a given commit.
When input consists of only commits the output looks like the following:
$ git diff-tree --stdin <<EOF
> 080ca5c9868bed9168cabde1919e8a341f63171d
> 95524bb30914c2521fdfc18225b8f0bf1b87e57d
> 350b6d78111e00cfa0aab051914803ef4ae4ee88
> 275d31cd75bf4219ad1814207bcdcd019c2b0436
> EOF
080ca5c9868bed9168cabde1919e8a341f63171d
:100644 100644 8649c69aa7eb8e8d5bf9318c6504fa3465f95ec8 9f00cc141d77a01d1dea48a0dc35fc3785b30d3e M .tool-versions
95524bb30914c2521fdfc18225b8f0bf1b87e57d
:100644 100644 d51de294d3f2b96aab10206352f1becd094e57af 23d94e425dcaf809d9fb0e3604e7a4e72fdb475b M README.md
350b6d78111e00cfa0aab051914803ef4ae4ee88
:040000 040000 bb6ac121088cdbd88c2a08e9aa1e8e58c8a7adf8 231d1d766c63347022dc66a362fe372a056ae0ec M bin
:040000 040000 abfb4658e5efe93d00c2d186a7873eeab57d1357 3c582d9e1e90ac5a3e90f2f140fe1cefba4c61ec M lib
275d31cd75bf4219ad1814207bcdcd019c2b0436
:100644 100644 5f913ebf2722e9e7a18a91f7a3ddc7fcd1fe0f48 eef302acdd6fc572da455e4671faf63eb4ec67c3 M README.md
A commit ID is printing prior to the associated raw diff entries. The diff-tree output parser in Gitaly currently ignores this information. If requested by the called, we should instead return it instead.
Note that when tree-ish pairs are provided as input, this commit ID header is not provided. This somewhat complicates things for us as it becomes impossible to know the boundaries between requested input. For now, we can add an RPC request option that requires all input to be a CommitRequest if the client wants associated commit IDs returned.