thanks!
could you please add a log_path_budget_ms or something like last_commits does? a malicious repo could dump 20000 commits and currently we'll just wait N time. i guess while clamping down we could also memoize the lookups too.
the behavior here is git log --full-history -- path right? if we want git log -- path I think we should do some more interesting traversal. though i think it's fine keeping the full-hist mode here and naming as such, up to you 🤷
on knot2/crates/knot-xrpc/src/reads.rs:406 I believe we could just
let (commits, total) = repo.log_window_path(start, path, skip, limit, log_deadline)?;
if total == 0 && commits.is_empty() {
return Err(path_not_found());
}
right? that way a deleted path will still get history while a wrong one will 404
knot2/crates/knot-git/src/reads.rs:197-200 how about
commit
.parents
.iter()
.try_fold(false, |changed, parent| {
Ok(changed || self.entry_at(*parent, path)? != current)
})
Regarding tests, could you please add something that shows the code going over a fixture with a merge, a delete, and a rename?