Skip to content
Snippets Groups Projects
Commit b5e96533 authored by Georges Racinet's avatar Georges Racinet
Browse files

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
2 merge requests!176Making Heptapod 0.38 the new stable,!171CommitService.FindCommits: implement 'include_referenced_by'
Pipeline #69280 passed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment