Loading
listCommits: Add the --follow flag to the RPC
This MR adds a follow flag to ListCommitsRequest which enables Git's --follow for the path filter. This allows to list commits for a path across file renames.
However, git-rev-list(1) does not support --follow, so the revision pipeline falls back to git-log(1) whenever the flag is set. When git-log(1) is used, we specify --format=%H so that it prints only the commit hashes, to keep the same behaviour as git-rev-list(1).
Git can only follow a single path, and it stops detecting renames when the history is walked in reverse chronological order. Both combinations are thus rejected with InvalidArgument instead of returning a truncated history.
Closes gitlab#595517 (closed)
Edited by Olivier Campeau