* perf: prevent repeated status fetches in large repos
Replace time-based cache invalidation with a generation counter.
The old `StatusParams` included a millisecond timestamp (tick) in its
hash, causing the cache to invalidate on every UI tick. For large repos
with millions of files, this led to repeated index loading and 5+ minute load times.
This change uses a different strategy to manage cache invalidation:
- Remove tick from StatusParams hash
- Add generation counter that increments after each fetch completes
- Include generation in cache hash
This ensures:
- No repeated fetches while one is already pending, making gitui usable
in large repos
- New fetch starts immediately after completion, keeping gitui responsive
in small repos
- External file changes will still be detected on the next fetch cycle
* fix changelog
---------
Co-authored-by: Daniel Stoll <dstoll@radix.trade>
Co-authored-by: extrawurst <776816+extrawurst@users.noreply.github.com>
Co-authored-by: extrawurst <mail@rusticorn.com>
* Update gix from 0.71.0 to 0.74.1
* Bump MSRC from 1.81 to 1.82
This is required by `gitoxide` 0.74.
* Address clippy issues
* Add getrandom and rustix to deny.toml
* Document reasons for ignoring duplicates
* Resolve core.hooksPath relative to GIT_WORK_TREE
git supports relative values in core.hooksPath.
`man git-config`:
> A relative path is taken as relative to the directory where the hooks are
> run (see the "DESCRIPTION" section of githooks[5]).
`man githooks`:
> Before Git invokes a hook, it changes its working directory to either
> $GIT_DIR in a bare repository or the root of the working tree in a >
> non-bare repository.
I.e. relative paths in core.hooksPath in non-bare repositories are always
relative to GIT_WORK_TREE.
There is a further exception; I believe this is not considered for path
resolution:
> An exception are hooks triggered during a push (pre-receive, update,
> post-receive, post-update, push-to-checkout) which are always executed
> in $GIT_DIR.
* Favor Repository::workdir() over path().parent()
This more clearly errors in case of bare repositories instead of using
the parent directory of the bare repository.
---------
Co-authored-by: Naseschwarz <naseschwarz@0x53a.de>
Co-authored-by: extrawurst <776816+extrawurst@users.noreply.github.com>
The algorithm for computing marked_consecutive assumes that commits are
consecutive in the commit graph if they are consecutive in the
linearized log used in` commitlist.rs`. That is not universally correct,
as siblings may also be displayed consecutively in this list.
For now, this just removes generating commit lists in dotted range
notation.
Co-authored-by: Naseschwarz <naseschwarz@0x53a.de>
* Bump git2 from 0.20.0 to 0.20.1
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.20.0 to 0.20.1.
- [Changelog](https://github.com/rust-lang/git2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/git2-rs/compare/git2-0.20.0...git2-0.20.1)
---
updated-dependencies:
- dependency-name: git2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
* Avoid passing reference into struct
git2-rs changed the lifetime of the result of Patch::hunk() to reference
the patch struct:
https://github.com/rust-lang/git2-rs/pull/1141
Thus, returning a patch struct and a reference into it is flagged by the
borrow checker upon move when returning.
This patch avoids returning both alltogether by separating retrieving
and retrieving the patch.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Naseschwarz <naseschwarz@0x53a.de>