Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd: status examples #1952

Merged
merged 15 commits into from
Dec 4, 2020
8 changes: 4 additions & 4 deletions content/docs/command-reference/commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ First verification:
$ dvc status
featurize:
changed outs:
not in cache: data/features
not in cache: data/features
train:
changed outs:
not in cache: model.pkl
Expand Down Expand Up @@ -257,9 +257,9 @@ $ git status -s
M src/train.py

$ dvc status
train.dvc:
changed deps:
modified: src/train.py
train:
changed deps:
modified: src/train.py
```

Let's edit one of the source code files. It doesn't matter which one. You'll see
Expand Down
4 changes: 2 additions & 2 deletions content/docs/command-reference/fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ into our local <abbr>cache</abbr>.
```dvc
$ dvc status --cloud
...
deleted: data/features/train.pkl
deleted: model.pkl
deleted: data/features/train.pkl
deleted: model.pkl

$ dvc fetch

Expand Down
8 changes: 4 additions & 4 deletions content/docs/command-reference/pull.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ such that the data in some of these stages should be updated in the
```dvc
$ dvc status -c
...
deleted: data/features/test.pkl
deleted: data/features/train.pkl
deleted: model.pkl
...
deleted: data/features/test.pkl
deleted: data/features/train.pkl
deleted: model.pkl
...
```

One could do a simple `dvc pull` to get all the data, but what if you only want
Expand Down
6 changes: 3 additions & 3 deletions content/docs/command-reference/push.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ Imagine the <abbr>project</abbr> has been modified such that the
```dvc
$ dvc status --cloud
...
new: data/model.p
new: data/matrix-test.p
new: data/matrix-train.p
new: data/model.p
new: data/matrix-test.p
new: data/matrix-train.p
```

One could do a simple `dvc push` to share all the data, but what if you only
Expand Down
67 changes: 34 additions & 33 deletions content/docs/command-reference/status.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,44 +157,45 @@ that.

```dvc
$ dvc status
bar.dvc:
changed deps:
modified: bar
changed outs:
not in cache: foo
foo.dvc:
changed outs:
deleted: foo
changed checksum
prepare.dvc:
changed outs:
new: bar
always changed
foo:
changed deps:
modified: bar
changed outs:
not in cache: foo
bar:
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
changed outs:
deleted: bar
changed checksum
baz.dvc:
changed outs:
new: baz
always changed
```

This shows that for stage `bar.dvc`, the dependency `foo` and the
<abbr>output</abbr> `bar` have changed. Likewise for `foo.dvc`, the dependency
`foo` has changed, but no output has changed.
This shows that for stage `foo`, the dependency `bar` and the
<abbr>output</abbr> `foo` have changed, and for stage `bar`, the output `bar`
has changed, but no dependency has changed. Likewise for `baz.dvc`, the output
`baz` tracked by it has changed.

## Example: Specific files or directories

`dvc status` only checks the tracked data corresponding to any given `targets`:

```dvc
$ dvc status foo.dvc dobar
foo.dvc:
changed outs:
deleted: foo
changed checksum
$ dvc status dofoo.dvc dobar
dofoo.dvc:
changed outs:
deleted: dofoo
changed checksum
dobar:
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
changed deps:
modified: bar
changed outs:
not in cache: foo
changed deps:
modified: bar
changed outs:
not in cache: foo
```

> In this case, the target `foo.dvc` is a `.dvc` file to track the `foo` file,
> while `dobar` is the name of a stage defined in `dvc.yaml`.
> In this case, the target `dofoo.dvc` is a `.dvc` file to track the `dofoo`
> file, while `dobar` is the name of a stage defined in `dvc.yaml`.

Note that you can check data within directories tracked, such as the `data/raw`
directory (tracked with `data/raw.dvc`):
Expand Down Expand Up @@ -223,8 +224,8 @@ Data and pipelines are up to date.

$ dvc status model.p --with-deps
matrix-train.p:
changed deps:
modified: code/featurization.py
changed deps:
modified: code/featurization.py
```

The `dvc status` command may be limited to a target that had no changes, but by
Expand All @@ -246,10 +247,10 @@ remote yet:
```dvc
$ dvc status --remote storage
...
new: data/model.p
new: data/eval.txt
new: data/matrix-train.p
new: data/matrix-test.p
new: data/model.p
new: data/eval.txt
new: data/matrix-train.p
new: data/matrix-test.p
```

The output shows where the location of the remote storage is, as well as any
Expand Down