Add LogWalkerWithoutFilter, using gitoxide #2275
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is split from #2269. It is focuces on the single use case of walking the log when there is no filter.
The current
LogWalker
implementation accepts afilter
of typeOption<SharedCommitFilterFn>
withtype SharedCommitFilterFn = Arc<Box<dyn Fn(&Repository, &CommitId) -> Result<bool> + Send + Sync>
. As you can see, this function takes agit2::Repository
as an option. Unfortunately, this does not work withgix
.When using
gitx
to walk the log, we open the repository throughgix::open
which returns agix::Repository
, a struct that is incompatible withgit2::Repository
. In order to make filtering work withgix
, we would have to rewrite quite a bit of code incommit_filter
. In particular, we would have to makeget_commit_diff
work withgix::Repository
.In order to limit this PR’s impact as well as the implementation effort, I thought it might be better to postpone this work and focus on the case of searching without a filter first.
It changes the following:
LogWalkerWithoutFilter
, capable of walking the log usinggix
.I followed the checklist:
make check
without errors