Skip to content
131 changes: 131 additions & 0 deletions oxen-rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion oxen-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ mockito = "1.1.0"
mp4 = "0.14.0"
mime = "0.3.17"
minus = { version = "5.4.0", features = ["static_output", "search"] }
notify = "8.2"
notify-debouncer-full = "0.6"
num_cpus = "1.16.0"
parking_lot = "0.12.1"
par-stream = { version = "0.10.2", features = ["runtime-tokio"] }
Expand Down Expand Up @@ -132,6 +134,7 @@ sql_query_builder = { version = "2.1.0", features = ["postgresql"] }
sysinfo = "0.33.0"
tar = "0.4.44"
tempfile = "3.8.0"
thiserror = "2.0"
time = { version = "0.3.28", features = ["serde"] }
tokio = { version = "1.32.0", features = ["full"] }
tokio-stream = "0.1.17"
Expand All @@ -148,7 +151,7 @@ async-recursion = "1.1.1"


[workspace]
members = ["src/cli", "src/lib", "src/server"]
members = ["src/cli", "src/lib", "src/server", "src/watcher"]

[profile.release]
codegen-units = 1
Expand All @@ -174,6 +177,11 @@ name = "oxen-server"
path = "src/server/src/main.rs"
bench = false

[[bin]]
name = "oxen-watcher"
path = "src/watcher/src/main.rs"
bench = false

[package.metadata.docs.rs]
default-target = "x86_64-unknown-linux-gnu"
features = ["duckdb"] # this is without "duckdb/bundled"
Expand Down
17 changes: 16 additions & 1 deletion oxen-rust/src/cli/src/cmd/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ impl RunCmd for StatusCmd {
.help("If present, does not truncate the output of status at all.")
.action(clap::ArgAction::SetTrue),
)
.arg(
Arg::new("no-cache")
.long("no-cache")
.help("Skip filesystem cache and perform full scan")
.action(clap::ArgAction::SetTrue),
)
.arg(
Arg::new("paths")
.num_args(0..)
Expand All @@ -74,6 +80,7 @@ impl RunCmd for StatusCmd {
.parse::<usize>()
.expect("limit must be a valid integer.");
let print_all = args.get_flag("print_all");
let no_cache = args.get_flag("no-cache");

let repository = LocalRepository::from_current_dir()?;
check_repo_migration_needed(&repository)?;
Expand All @@ -93,7 +100,15 @@ impl RunCmd for StatusCmd {
};
log::debug!("status opts: {:?}", opts);

let repo_status = repositories::status::status_from_opts(&repository, &opts)?;
// Use the watcher-enabled status function unless --no-cache is specified
let repo_status = if no_cache {
log::debug!("Using direct scan (--no-cache specified)");
repositories::status::status_from_opts(&repository, &opts)?
} else {
// Try to use watcher cache by default
log::debug!("Attempting to use watcher cache");
liboxen::core::v_latest::status::status_with_cache(&repository, &opts, true).await?
};

if let Some(current_branch) = repositories::branches::current_branch(&repository)? {
println!(
Expand Down
1 change: 1 addition & 0 deletions oxen-rust/src/lib/src/core/v_latest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub mod revisions;
pub mod rm;
pub mod stats;
pub mod status;
pub mod watcher_client;
pub mod workspaces;

pub use add::add;
Expand Down
Loading
Loading