Skip to content

FindChangedPaths returns paths that are not changed from merge commit

Related Gitlab Issue: gitlab#23625 (closed)

When a user pushes a list of changes to gitlab we perform diff checks on the changes. If those changes include a merge commit the returned changed paths may also include changes that are already in history.

We can solve the gitlab issue linked above by using -c instead of -m in the FindChangedPaths git-diff-tree cmd. -c combines the diffs and only returns changes that are different in all parents e.g. conflict resolutions (where different from all parents) and other manual changes introduced during the merge.

I discussed this in slack with @jcaigitlab and @pks-gitlab.

@pks-gitlab pointed out that this would be a breaking change so rather than changing the flag we should introduce an enum to allow the client to specify how the output should be formatted.

Note: the output format for a merge commit when using -c is different to -m (each parent has a mode and sha and a status) so the nextPath function will need to return multiple gitalypb.ChangedPaths for each merge commit.

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