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: update diff examples for dvc 1.0 #1965

Merged
merged 3 commits into from
Nov 23, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions content/docs/command-reference/diff.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ for example when `dvc init` was used with the `--no-scm` option.

## Examples

For these examples we can use the [Get Started](/doc/tutorials/get-started)
project.
For these examples we can use the [Get Started](/doc/start) project.

<details>

Expand Down Expand Up @@ -111,19 +110,18 @@ $ dvc diff

Let's checkout the
[2-track-data](https://github.com/iterative/example-get-started/releases/tag/2-track-data)
tag, corresponding to the
[tracking data](/doc/tutorials/get-started/data-versioning#tracking-data) _Get
tag, corresponding to the [data versioning](/doc/start/data-versioning) _Get
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
Started_ chapter, right after we added `data.xml` file with DVC:

```dvc
$ git checkout 2-track-data
$ dvc pull
$ dvc checkout
```

</details>

To see the difference between the very previous commit of the project and the
workspace, we can use `HEAD^` as `a_ref`:
workspace, we can use `HEAD^` as `a_rev`:

```dvc
$ dvc diff HEAD^
Expand Down Expand Up @@ -158,14 +156,16 @@ $ dvc checkout
$ dvc diff baseline-experiment bigrams-experiment
Modified:
data/features/
data/features/test.pkl
data/features/train.pkl
model.pkl
prc.json
scores.json
model.pkl

files summary: 0 added, 0 deleted, 3 modified
files summary: 0 added, 0 deleted, 5 modified
```

The output from this command confirms that there's a difference in 4 files
The output from this command confirms that there's a difference in 5 files
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
between the tags `baseline-experiment` and `bigrams-experiment`.

## Example: Using different output formats
Expand All @@ -185,20 +185,22 @@ It outputs:
"added": [],
"deleted": [],
"modified": [
...{
{
"path": "data/features/",
"hash": {
"old": "3338d2c21bdb521cda0ba4add89e1cb0.dir",
"new": "42c7025fc0edeb174069280d17add2d4.dir"
}
},
...{
...
{
"path": "model.pkl",
"hash": {
"old": "43630cce66a2432dcecddc9dd006d0a7",
"new": "662eb7f64216d9c2c1088d0a5e2c6951"
}
}
...
]
}
```