Skip to content

Commit 24edf36

Browse files
committed
feat: add Status iterator.
TBD
1 parent 401347e commit 24edf36

File tree

7 files changed

+311
-18
lines changed

7 files changed

+311
-18
lines changed

gix/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ comfort = ["gix-features/progress-unit-bytes", "gix-features/progress-unit-human
6565
command = ["dep:gix-command"]
6666

6767
## Obtain information similar to `git status`.
68-
status = ["gix-status"]
68+
status = ["gix-status", "dirwalk"]
6969

7070
## Utilities for interrupting computations and cleaning up tempfiles.
7171
interrupt = ["dep:signal-hook", "gix-tempfile/signals"]
@@ -131,12 +131,12 @@ blocking-http-transport-curl-rustls = ["blocking-http-transport-curl", "dep:curl
131131
## Stacks with `blocking-network-client` to provide support for HTTP/S using **reqwest**, and implies blocking networking as a whole, making the `https://` transport available.
132132
blocking-http-transport-reqwest = ["blocking-network-client", "gix-transport/http-client-reqwest"]
133133
## Stacks with `blocking-http-transport-reqwest` and enables `https://` via the `rustls` crate.
134-
blocking-http-transport-reqwest-rust-tls = ["blocking-http-transport-reqwest", "reqwest-for-configuration-only/rustls-tls" ]
134+
blocking-http-transport-reqwest-rust-tls = ["blocking-http-transport-reqwest", "reqwest-for-configuration-only/rustls-tls"]
135135
## Stacks with `blocking-http-transport-reqwest` and enables `https://` via the `rustls` crate.
136136
## This also makes use of `trust-dns` to avoid `getaddrinfo`, but note it comes with its own problems.
137137
blocking-http-transport-reqwest-rust-tls-trust-dns = ["blocking-http-transport-reqwest", "reqwest-for-configuration-only/rustls-tls", "reqwest-for-configuration-only/trust-dns"]
138138
## Stacks with `blocking-http-transport-reqwest` and enables `https://` via the `native-tls` crate.
139-
blocking-http-transport-reqwest-native-tls = ["blocking-http-transport-reqwest", "reqwest-for-configuration-only/default-tls" ]
139+
blocking-http-transport-reqwest-native-tls = ["blocking-http-transport-reqwest", "reqwest-for-configuration-only/default-tls"]
140140

141141

142142
#! #### Performance
@@ -186,11 +186,11 @@ pack-cache-lru-dynamic = ["gix-pack/pack-cache-lru-dynamic"]
186186

187187
## Activate other features that maximize performance, like usage of threads, `zlib-ng` and access to caching in object databases.
188188
## Note that some platforms might suffer from compile failures, which is when `max-performance-safe` should be used.
189-
max-performance = [ "max-performance-safe", "zlib-ng", "fast-sha1" ]
189+
max-performance = ["max-performance-safe", "zlib-ng", "fast-sha1"]
190190

191191
## If enabled, use assembly versions of sha1 on supported platforms.
192192
## This might cause compile failures as well which is why it can be turned off separately.
193-
fast-sha1 = [ "gix-features/fast-sha1" ]
193+
fast-sha1 = ["gix-features/fast-sha1"]
194194

195195
## Use the C-based zlib-ng backend, which can compress and decompress significantly faster.
196196
## Note that this will cause duplicate symbol errors if the application also depends on `zlib` - use `zlib-ng-compat` in that case.
@@ -215,7 +215,7 @@ zlib-stock = ["gix-features/zlib-stock"]
215215
verbose-object-parsing-errors = ["gix-object/verbose-object-parsing-errors"]
216216

217217
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
218-
serde = [ "dep:serde",
218+
serde = ["dep:serde",
219219
"gix-pack/serde",
220220
"gix-object/serde",
221221
"gix-protocol?/serde",
@@ -286,7 +286,7 @@ gix-hashtable = { version = "^0.5.1", path = "../gix-hashtable" }
286286
gix-commitgraph = { version = "^0.24.1", path = "../gix-commitgraph" }
287287
gix-pathspec = { version = "^0.7.0", path = "../gix-pathspec", optional = true }
288288
gix-submodule = { version = "^0.9.0", path = "../gix-submodule", optional = true }
289-
gix-status = { version = "^0.6.0", path = "../gix-status", optional = true }
289+
gix-status = { version = "^0.6.0", path = "../gix-status", optional = true, features = ["worktree-rewrites"] }
290290
gix-command = { version = "^0.3.5", path = "../gix-command", optional = true }
291291

292292
gix-worktree-stream = { version = "^0.10.0", path = "../gix-worktree-stream", optional = true }
@@ -301,7 +301,7 @@ prodash = { workspace = true, optional = true, features = ["progress-tree"] }
301301
once_cell = "1.14.0"
302302
signal-hook = { version = "0.3.9", default-features = false, optional = true }
303303
thiserror = "1.0.26"
304-
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
304+
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"] }
305305
smallvec = "1.9.0"
306306
async-std = { version = "1.12.0", optional = true }
307307

gix/src/config/cache/access.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl Cache {
112112
}
113113

114114
#[cfg(feature = "blob-diff")]
115-
pub(crate) fn diff_renames(&self) -> Result<Option<crate::diff::Rewrites>, crate::diff::new_rewrites::Error> {
115+
pub(crate) fn diff_renames(&self) -> Result<Option<gix_diff::Rewrites>, crate::diff::new_rewrites::Error> {
116116
self.diff_renames
117117
.get_or_try_init(|| crate::diff::new_rewrites(&self.resolved, self.lenient_config))
118118
.copied()

gix/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ pub use gix_ref as refs;
133133
pub use gix_refspec as refspec;
134134
pub use gix_revwalk as revwalk;
135135
pub use gix_sec as sec;
136-
#[cfg(feature = "status")]
137-
pub use gix_status as status;
138136
pub use gix_tempfile as tempfile;
139137
pub use gix_trace as trace;
140138
pub use gix_traverse as traverse;
@@ -317,6 +315,10 @@ pub mod init;
317315
/// Not to be confused with 'status'.
318316
pub mod state;
319317

318+
///
319+
#[cfg(feature = "status")]
320+
pub mod status;
321+
320322
///
321323
pub mod shallow;
322324

gix/src/pathspec.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ impl<'repo> Pathspec<'repo> {
6767
)?,
6868
)?;
6969
let cache = needs_cache.then(make_attributes).transpose()?;
70+
71+
gix_trace::debug!(
72+
longest_prefix = ?search.longest_common_directory(),
73+
prefix_dir = ?search.prefix_directory(),
74+
patterns = ?search.patterns().map(gix_pathspec::Pattern::path).collect::<Vec<_>>()
75+
);
76+
7077
Ok(Self {
7178
repo,
7279
search,

gix/src/repository/dirwalk.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub enum Error {
99
#[error(transparent)]
1010
Walk(#[from] gix_dir::walk::Error),
1111
#[error("A working tree is required to perform a directory walk")]
12-
MissinWorkDir,
12+
MissingWorkDir,
1313
#[error(transparent)]
1414
Excludes(#[from] config::exclude_stack::Error),
1515
#[error(transparent)]
@@ -57,7 +57,7 @@ impl Repository {
5757
delegate: &mut dyn gix_dir::walk::Delegate,
5858
) -> Result<Outcome<'_>, Error> {
5959
let _span = gix_trace::coarse!("gix::dirwalk");
60-
let workdir = self.work_dir().ok_or(Error::MissinWorkDir)?;
60+
let workdir = self.work_dir().ok_or(Error::MissingWorkDir)?;
6161
let mut excludes = self.excludes(
6262
index,
6363
None,
@@ -70,11 +70,6 @@ impl Repository {
7070
index,
7171
crate::worktree::stack::state::attributes::Source::WorktreeThenIdMapping,
7272
)?;
73-
gix_trace::debug!(
74-
longest_prefix = ?pathspec.search.longest_common_directory(),
75-
prefix_dir = ?pathspec.search.prefix_directory(),
76-
patterns = ?pathspec.search.patterns().map(gix_pathspec::Pattern::path).collect::<Vec<_>>()
77-
);
7873

7974
let git_dir_realpath =
8075
crate::path::realpath_opts(self.git_dir(), self.current_dir(), crate::path::realpath::MAX_SYMLINKS)?;

0 commit comments

Comments
 (0)