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 ref: get: document --show-url flag #936

Merged
merged 8 commits into from
Jan 24, 2020
10 changes: 5 additions & 5 deletions public/static/docs/command-reference/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ reproducible.

## Options

- `-R`, `--recursive` - `targets` is expected to contain one or more directories
for this option to have effect. Determines the files to add by searching each
target directory and its subdirectories for data files. For each file found, a
new DVC-file is created using the process described in this command's
description.
- `-R`, `--recursive` - determines the files to add by searching each target
directory and its subdirectories for data files. For each file found, a new
DVC-file is created using the process described in this command's description.
`targets` is expected to contain one or more directories for this option to
have effect.

- `--no-commit` - do not save outputs to cache. A DVC-file is created, and an
entry is added to `.dvc/state`, while nothing is added to the cache. (The
Expand Down
6 changes: 3 additions & 3 deletions public/static/docs/command-reference/fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ specified in DVC-files currently in the project are considered by `dvc fetch`
searches backward from the target stages in the corresponding pipelines. This
means DVC will not fetch files referenced in later stages than the `targets`.

- `-R`, `--recursive` - `targets` is expected to contain one or more directories
for this option to have effect. Determines the files to fetch by searching
each target directory and its subdirectories for DVC-files to inspect.
- `-R`, `--recursive` - determines the files to fetch by searching each target
directory and its subdirectories for DVC-files to inspect. `targets` is
expected to contain one or more directories for this option to have effect.

- `-j JOBS`, `--jobs JOBS` - number of threads to run simultaneously to handle
the downloading of files from the remote. Using more jobs may improve the
Expand Down
29 changes: 24 additions & 5 deletions public/static/docs/command-reference/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,16 @@ name.
an existing directory is specified, then the output will be placed inside of
it.

- `--rev` - `url` is expected to represent a Git repository for this option to
have an effect. Specific
- `--rev` - specific
[Git revision](https://git-scm.com/book/en/v2/Git-Internals-Git-References)
(such as a branch name, a tag, or a commit hash) of the repository to download
the file or directory from. The tip of the default branch is used by default
when this option is not specified.

- `--show-url` - instead of downloading the file or directory, just print the
storage location (URL) of the target data. `path` is expected to represent a
cached, DVC-tracked file for this option to have effect.

- `-h`, `--help` - prints the usage/help message, and exit.

- `-q`, `--quiet` - do not write anything to standard output. Exit with 0 if no
Expand Down Expand Up @@ -119,15 +122,31 @@ $ ls
install.sh
```

### Example: Getting the storage URL of a DVC-tracked file

We can use `dvc get --show-url` to get the actual location where the final model
file from our
[get started example repo](https://github.com/iterative/example-get-started) is
stored:

```dvc
$ dvc get https://github.com/iterative/example-get-started model.pkl --show-url
https://remote.dvc.org/get-started/66/2eb7f64216d9c2c1088d0a5e2c6951
```

`remote.dvc.org/get-started` is an HTTP
[DVC remote](/doc/command-reference/remote), whereas
`662eb7f64216d9c2c1088d0a5e2c6951` is the file's checksum.

## Example: Compare different versions of data or model

`dvc get` has the `--rev` option, to specify which version of the repository to
download a <abbr>data artifact</abbr> from. It also has the `--out` option to
`dvc get` provides the `--rev` option to specify which version of the repository
to download a <abbr>data artifact</abbr> from. It also has the `--out` option to
specify the location to place the artifact within the workspace. Combining these
two options allows us to do something we can't achieve with the regular
`git checkout` + `dvc checkout` process – see for example the
[Get Older Data Version](/doc/get-started/older-versions) chapter of our _Get
Started_ section.
Started_.

Let's use the
[get started example repo](https://github.com/iterative/example-get-started)
Expand Down
3 changes: 1 addition & 2 deletions public/static/docs/command-reference/import.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ data artifact from the source project.
an existing directory is specified, then the output will be placed inside of
it.

- `--rev` - `url` is expected to represent a Git repository for this option to
have an effect. Specific
- `--rev` - specific
[Git revision](https://git-scm.com/book/en/v2/Git-Internals-Git-References)
(such as a branch name, a tag, or a commit hash) of the repository to download
the file or directory from. The tip of the default branch is used by default
Expand Down
7 changes: 3 additions & 4 deletions public/static/docs/command-reference/metrics/show.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,9 @@ extension.)
Similar to `-a` above. Note that both options can be combined, for example
using the `-aT` flag.

- `-R`, `--recursive` - `targets` is expected to contain one or more directories
for this option to have effect. Determines the metric files to show by
searching each target directory and its subdirectories for DVC-files to
inspect.
- `-R`, `--recursive` - determines the metric files to show by searching each
target directory and its subdirectories for DVC-files to inspect. `targets` is
expected to contain one or more directories for this option to have effect.

- `-h`, `--help` - prints the usage/help message, and exit.

Expand Down
6 changes: 3 additions & 3 deletions public/static/docs/command-reference/pull.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ reflinks or hardlinks to put it in the workspace without copying. See
searches backward from the target stages in the corresponding pipelines. This
means DVC will not pull files referenced in later stages than the `targets`.

- `-R`, `--recursive` - `targets` is expected to contain one or more directories
for this option to have effect. Determines the files to pull by searching each
target directory and its subdirectories for DVC-files to inspect.
- `-R`, `--recursive` - determines the metric files to show by searching each
target directory and its subdirectories for DVC-files to inspect. `targets` is
expected to contain one or more directories for this option to have effect.
skshetry marked this conversation as resolved.
Show resolved Hide resolved

- `-f`, `--force` - does not prompt when removing workspace files, which occurs
when these file no longer match the current DVC-file references. This option
Expand Down
6 changes: 3 additions & 3 deletions public/static/docs/command-reference/push.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ to push.
searches backward from the target stages in the corresponding pipelines. This
means DVC will not push files referenced in later stages than the `targets`.

- `-R`, `--recursive` - `targets` is expected to contain one or more directories
for this option to have effect. Determines the files to push by searching each
target directory and its subdirectories for DVC-files to inspect.
- `-R`, `--recursive` - determines the metric files to show by searching each
target directory and its subdirectories for DVC-files to inspect. `targets` is
expected to contain one or more directories for this option to have effect.
skshetry marked this conversation as resolved.
Show resolved Hide resolved

- `-j JOBS`, `--jobs JOBS` - specifies number of jobs to run simultaneously
while uploading files to the remote. The effect is to control the number of
Expand Down
7 changes: 3 additions & 4 deletions public/static/docs/command-reference/repro.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ and only execute the final stage.
reproduced as part of the pipeline in the parent directory, or as an
independent unit.

- `-R`, `--recursive` - `targets` is expected to contain one or more directories
for this option to have effect. Determines the stages to reproduce by
searching each target directory and its subdirectories for DVC-files to
inspect.
- `-R`, `--recursive` - determines the stages to reproduce by searching each
target directory and its subdirectories for DVC-files to inspect. `targets` is
expected to contain one or more directories for this option to have effect.

- `--no-commit` - do not save outputs to cache. (See `dvc run`.) Useful when
running different experiments and you don't want to fill up the cache with
Expand Down
16 changes: 8 additions & 8 deletions public/static/docs/command-reference/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@ data pipeline (e.g. random numbers, time functions, hardware dependency, etc.)
determined by the logic described in the `-f` option) without asking for
confirmation.

- `--ignore-build-cache` - This options has an effect if an equivalent stage
file exists (same dependencies, outputs, and `command` to execute), that has
been already executed, and is up to date. In this case, `dvc run` won't
normally execute the `command` again. The exception is when the existing stage
is considered always changed (see `--always-changed` option). This option
gives a way to forcefully execute the `command` anyway. Useful if the
command's code is non-deterministic (meaning it produces different outputs
from the same list of inputs).
- `--ignore-build-cache` - has an effect if an equivalent stage file exists
(same dependencies, outputs, and `command` to execute), that has been already
executed, and is up to date. In this case, `dvc run` won't normally execute
the `command` again. The exception is when the existing stage is considered
always changed (see `--always-changed` option). This option gives a way to
forcefully execute the `command` anyway. Useful if the command's code is
non-deterministic (meaning it produces different outputs from the same list of
inputs).

- `--remove-outs` (_deprecated_) - remove stage outputs before executing the
`command`. If `--no-exec` specified outputs are removed anyway. See
Expand Down