From f1e2849c239d771e2662a18d6499c8218a6f0b78 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Mon, 22 May 2023 06:36:23 -0700 Subject: [PATCH] cli: add some documentation for `jj sparse`, including examples --- src/commands/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 595efdb33..d77a1c92e 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -877,10 +877,18 @@ enum SparseArgs { } /// List the patterns that are currently present in the working copy +/// +/// By default, a newly cloned or initialized repo will have have a pattern +/// matching all files from the repo root. That pattern is rendered as `.` (a +/// single period). #[derive(clap::Args, Clone, Debug)] struct SparseListArgs {} /// Update the patterns that are present in the working copy +/// +/// For example, if all you need is the `README.md` and the `lib/` +/// directory, use `jj sparse set --clear --add README.md --add lib`. +/// If you no longer need the `lib` directory, use `jj sparse set --remove lib`. #[derive(clap::Args, Clone, Debug)] struct SparseSetArgs { /// Patterns to add to the working copy