Skip to content

Commit d2734d3

Browse files
Byronweihanglo
andcommitted
Update unstable.md with new gitoxide options for shallow clones
Co-authored-by: Weihang Lo <[email protected]>
1 parent 3bd08d9 commit d2734d3

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/doc/src/reference/unstable.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,10 +1260,20 @@ to run with `gitoxide` with the `-Zgitoxide=operation[,operationN]` syntax.
12601260
Valid operations are the following:
12611261

12621262
* `fetch` - All fetches are done with `gitoxide`, which includes git dependencies as well as the crates index.
1263-
* `shallow-index` *(planned)* - perform a shallow clone of the index.
1264-
* `shallow-deps` *(planned)* - perform a shallow clone of git dependencies.
1263+
* `shallow-index` - perform a shallow clone of the index.
1264+
* `shallow-deps` - perform a shallow clone of git dependencies.
12651265
* `checkout` *(planned)* - checkout the worktree, with support for filters and submodules.
12661266

1267+
**Details on shallow clones**
1268+
1269+
* To enable shallow clones, add `-Zgitoxide=fetch,shallow_deps` for fetching git dependencies or `-Zgitoxide=fetch,shallow_index` for fetching registry index.
1270+
* Shallow-cloned and shallow-checked-out git repositories reside at their own `-shallow` suffixed directories, i.e,
1271+
- `~/.cargo/registry/index/*-shallow`
1272+
- `~/.cargo/git/db/*-shallow`
1273+
- `~/.cargo/git/checkouts/*-shallow`
1274+
* When the unstable feature is on, fetching/cloning a git repository is always a shallow fetch. This roughly equals to `git fetch --depth 1` everywhere.
1275+
* Even with the presence of `Cargo.lock` or specifying a commit `{ rev = "…" }`, gitoxide is still smart enough to shallow fetch without unshallowing the existing repository.
1276+
12671277
## Stabilized and removed features
12681278

12691279
### Compile progress

0 commit comments

Comments
 (0)