CommitService.FindCommits: implement 'include_referenced_by'
The implementation itself is more general than `FindCommits`: we make it an option in `message.commit()`. For this, we need to read all state files. Because `FindCommits` may return lots of commits, we do it once and cache the reverse mapping on the repository object. Of course this is somewhat heavy if only one commit is being queried, especially if the pattern is about only one type of refs (e.g. branch refs, whose numbers are much less than all past special refs). An improvement would be to remember which type of file has been read already, and load the files on-demand. Another improvement would be to have an efficient format allowing to have all refs in one single db file. Since it is unlikely that keep-arounds would be asked in this way, we omit them for the time being. Most of the actual testing is done as a Gitaly Comparison test. We don't have a formal definition of the matching at the time being, so this is defined by the examples in the test (reading Git source code should provide better answers). Finally, RHGitaly should grow the `message.commit` equivalent, but it would not be useful right now. However, if `FindCommit` would turn out to also get this option, we'd have to do the Rust version. Closes #136
parent
5db72c4e
No related branches found
No related tags found
Showing
- hgitaly/gitlab_ref.py 40 additions, 0 deletionshgitaly/gitlab_ref.py
- hgitaly/message.py 25 additions, 1 deletionhgitaly/message.py
- hgitaly/service/commit.py 3 additions, 0 deletionshgitaly/service/commit.py
- hgitaly/service/tests/test_commit.py 41 additions, 1 deletionhgitaly/service/tests/test_commit.py
- tests_with_gitaly/test_commit.py 36 additions, 0 deletionstests_with_gitaly/test_commit.py
Loading
Please register or sign in to comment