Skip to content

Commit

Permalink
Merge pull request #1965 from iterative/cmd-diff-examples
Browse files Browse the repository at this point in the history
cmd: update diff examples for dvc 1.0
  • Loading branch information
jorgeorpinel authored Nov 23, 2020
2 parents 49859c1 + 002c990 commit faee109
Showing 1 changed file with 13 additions and 11 deletions.
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
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
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"
}
}
...
]
}
```

0 comments on commit faee109

Please sign in to comment.