Skip to content

Commit 8d0d8e0

Browse files
committed
Merge branch 'worktree-organization'
2 parents ef54aab + e5717e1 commit 8d0d8e0

File tree

93 files changed

+425
-253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+425
-253
lines changed

Cargo.lock

Lines changed: 38 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ members = [
235235
"gix-index",
236236
"gix-bitmap",
237237
"gix-worktree",
238+
"gix-worktree-state",
239+
"gix-status",
238240
"gix-revision",
239241
"gix-packetline",
240242
"gix-packetline-blocking",

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ is usable to some extent.
9595
* [gix-worktree-stream](https://github.com/Byron/gitoxide/blob/main/crate-status.md#gix-worktree-stream)
9696
* [gix-archive](https://github.com/Byron/gitoxide/blob/main/crate-status.md#gix-archive)
9797
* [gix-submodule](https://github.com/Byron/gitoxide/blob/main/crate-status.md#gix-submodule)
98+
* [gix-status](https://github.com/Byron/gitoxide/blob/main/crate-status.md#gix-status)
99+
* [gix-worktree-state](https://github.com/Byron/gitoxide/blob/main/crate-status.md#gix-worktree-state)
98100
* `gitoxide-core`
99101
* **very early** _(possibly without any documentation and many rough edges)_
100102
* [gix-date](https://github.com/Byron/gitoxide/blob/main/crate-status.md#gix-date)

crate-status.md

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -453,28 +453,36 @@ Make it the best-performing implementation and the most convenient one.
453453
### gix-glob
454454
* [x] parse pattern
455455
* [x] a type for pattern matching of paths and non-paths, optionally case-insensitively.
456-
457-
### gix-worktree
456+
457+
### gix-status
458+
* [x] differences between index and worktree to turn index into worktree
459+
* [ ] differences between tree and index to turn tree into index
460+
* [ ] untracked files
461+
* [ ] fast answer to 'is it dirty'.
462+
*
463+
### gix-worktree-state
458464
* handle the working **tree/checkout**
459-
- [x] checkout an index of files, executables and symlinks just as fast as git
460-
- [x] forbid symlinks in directories
461-
- [ ] handle submodules
462-
- [ ] handle sparse directories
463-
- [ ] handle sparse index
464-
- [x] linear scaling with multi-threading up to IO saturation
465-
- supported attributes to affect working tree and index contents
466-
- [ ] eol
467-
- [ ] working-tree-encoding
468-
- …more
469-
- **filtering**
470-
- [ ] `text`
471-
- [ ] `ident`
472-
- [ ] filter processes
473-
- [ ] single-invocation clean/smudge filters
474-
* manage multiple worktrees
465+
- [x] checkout an index of files, executables and symlinks just as fast as git
466+
- [x] forbid symlinks in directories
467+
- [ ] handle submodules
468+
- [ ] handle sparse directories
469+
- [ ] handle sparse index
470+
- [x] linear scaling with multi-threading up to IO saturation
471+
- supported attributes to affect working tree and index contents
472+
- [x] eol
473+
- [x] working-tree-encoding
474+
- …more
475+
- **filtering**
476+
- [x] `text`
477+
- [x] `ident`
478+
- [x] filter processes
479+
- [x] single-invocation clean/smudge filters
475480
* access to per-path information, like `.gitignore` and `.gitattributes` in a manner well suited for efficient lookups
476-
* [x] _exclude_ information
477-
* [ ] attributes
481+
* [x] _exclude_ information
482+
* [x] attributes
483+
484+
### gix-worktree
485+
* [x] A stack to to efficiently generate attribute lists for matching paths against.
478486

479487
### gix-revision
480488
* [x] `describe()` (similar to `git name-rev`)

etc/gix-components.monopic

7.74 KB
Binary file not shown.

etc/gix-components.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
╔════════════════╗
2+
║ gix-submodule ║
3+
╚════════════════╝

gitoxide-core/src/hours/core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ pub fn spawn_tree_delta_threads<'scope>(
101101
repo.index_or_load_from_head().map_err(Into::into).and_then(|index| {
102102
repo.attributes(
103103
&index,
104-
gix::worktree::cache::state::attributes::Source::IdMapping,
105-
gix::worktree::cache::state::ignore::Source::IdMapping,
104+
gix::worktree::stack::state::attributes::Source::IdMapping,
105+
gix::worktree::stack::state::ignore::Source::IdMapping,
106106
None,
107107
)
108108
.map_err(Into::into)

gitoxide-core/src/index/checkout.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::{
44
};
55

66
use anyhow::bail;
7-
use gix::{odb::FindExt, worktree::checkout, Progress};
7+
use gix::{odb::FindExt, worktree::state::checkout, Progress};
88

99
use crate::{
1010
index,
@@ -55,7 +55,7 @@ pub fn checkout_exclusive(
5555
progress.info(format!("Skipping {num_skipped} DIR/SYMLINK/COMMIT entries"));
5656
}
5757

58-
let opts = gix::worktree::checkout::Options {
58+
let opts = gix::worktree::state::checkout::Options {
5959
fs: gix::fs::Capabilities::probe(dest_directory),
6060

6161
destination_is_initially_empty: true,
@@ -86,7 +86,7 @@ pub fn checkout_exclusive(
8686
delayed_paths_unknown,
8787
delayed_paths_unprocessed,
8888
} = match repo {
89-
Some(repo) => gix::worktree::checkout(
89+
Some(repo) => gix::worktree::state::checkout(
9090
&mut index,
9191
dest_directory,
9292
{
@@ -109,7 +109,7 @@ pub fn checkout_exclusive(
109109
should_interrupt,
110110
opts,
111111
),
112-
None => gix::worktree::checkout(
112+
None => gix::worktree::state::checkout(
113113
&mut index,
114114
dest_directory,
115115
|_, buf| {

gitoxide-core/src/repository/attributes/query.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@ pub(crate) mod function {
8989

9090
pub(crate) fn attributes_cache(
9191
repo: &gix::Repository,
92-
) -> anyhow::Result<(gix::worktree::Cache, IndexPersistedOrInMemory)> {
92+
) -> anyhow::Result<(gix::worktree::Stack, IndexPersistedOrInMemory)> {
9393
let index = repo.index_or_load_from_head()?;
9494
let cache = repo.attributes(
9595
&index,
9696
if repo.is_bare() {
97-
gix::worktree::cache::state::attributes::Source::IdMapping
97+
gix::worktree::stack::state::attributes::Source::IdMapping
9898
} else {
99-
gix::worktree::cache::state::attributes::Source::WorktreeThenIdMapping
99+
gix::worktree::stack::state::attributes::Source::WorktreeThenIdMapping
100100
},
101-
gix::worktree::cache::state::ignore::Source::IdMapping,
101+
gix::worktree::stack::state::ignore::Source::IdMapping,
102102
None,
103103
)?;
104104
Ok((cache, index))

gitoxide-core/src/repository/clone.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ pub(crate) mod function {
111111
}
112112
};
113113

114-
if let Some(gix::worktree::checkout::Outcome { collisions, errors, .. }) = outcome {
114+
if let Some(gix::worktree::state::checkout::Outcome { collisions, errors, .. }) = outcome {
115115
if !(collisions.is_empty() && errors.is_empty()) {
116116
let mut messages = Vec::new();
117117
if !errors.is_empty() {

0 commit comments

Comments
 (0)