Expand description
This crate includes the various diffs git can do between different representations
of the repository state, like comparisons between…
- index and working tree
- tree and index
…while also being able to check if the working tree is dirty, quickly, by instructing the operation to stop once the first change was found.
§Tree-Index Status
This status is not actually implemented here as it’s not implemented directly. Instead, one creates an Index from a tree
and then diffs two indices with gix_diff::index(index_from_tree, usually_dot_git_index). This adds about 15% to the runtime
and comes at the cost of another index in memory.
Once there are generators implementing depth-first tree iteration should become trivial, but for now it’s very hard if one
wants to return referenced state of the iterator (which is not possible).
§Difference to gix-diff
Technically, status is just another form of diff between different kind of sides, i.e. an index and a working tree.
This is the difference to gix-diff, which compares only similar items.
§Feature Flags
worktree-rewrites— Add support for tracking rewrites along with checking for worktree modifications.
Modules§
- index_
as_ worktree - Changes between an index and a worktree.
- index_
as_ worktree_ with_ renames worktree-rewrites - Changes between the index and the worktree along with optional rename tracking.
Structs§
- Symlink
Check - A stack that validates we are not going through a symlink in a way that is read-only.
Functions§
- index_
as_ worktree - Calculates the changes that need to be applied to an
indexto match the state of theworktreeand makes them observable incollector, along with information produced bycomparewhich gets to see blobs that may have changes, andsubmodulewhich can take a look at submodules in detail to produce status information (BASE version if its conflicting).optionsare used to configure the operation. - index_
as_ worktree_ with_ renames worktree-rewrites - Similar to
index_as_worktree(…), except that it will automatically track renames if enabled, while additionally providing information about untracked files (or more, depending on the configuration).