Clarify dep ensure -update behavior for imports.

This commit is contained in:
Matt Braymer-Hayes 2018-02-20 15:25:16 -08:00 коммит произвёл Matt Braymer-Hayes
Родитель 103c77564e
Коммит 0d0b23bb3e
2 изменённых файлов: 11 добавлений и 7 удалений

Просмотреть файл

@ -22,6 +22,7 @@ The FAQ predated the introduction of the rest of the documentation. If something
## Behavior
* [How does `dep` decide what version of a dependency to use?](#how-does-dep-decide-what-version-of-a-dependency-to-use)
* [What is the default `dep ensure -update` behavior for dependencies that are imported but not included as a `[[Constraint]]` in `Gopkg.toml`?](#what-is-the-default-dep-ensure--update-behavior-for-dependencies-that-are-imported-but-not-included-as-a-constraint-in-gopkgtoml)
* [What external tools are supported?](#what-external-tools-are-supported)
* [Why is `dep` ignoring a version constraint in the manifest?](#why-is-dep-ignoring-a-version-constraint-in-the-manifest)
* [Why did `dep` use a different revision for package X instead of the revision in the lock file?](#why-did-dep-use-a-different-revision-for-package-x-instead-of-the-revision-in-the-lock-file)
@ -241,6 +242,9 @@ trying to figure out why `dep` is doing what it does, understanding that its
basic action is to attempt versions in this order should help you to reason
about what's going on.
## What is the default `dep ensure -update` behavior for dependencies that are imported but not included as a `[[Constraint]]` in `Gopkg.toml`?
`dep` updates the dependency to the latest semver tag. If there are no semver tags, `dep` uses the tip of master.
## What external tools are supported?
During `dep init` configuration from other dependency managers is detected

Просмотреть файл

@ -191,10 +191,10 @@ Thus, even if an upstream tag is force-pushed in one of your project's dependenc
The key takeaway here is that `-update`'s behavior is governed by the type of constraints specified:
| `Gopkg.toml` version constraint type | Constraint example | `dep ensure -update` behavior |
| ------------------------------------ | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `version` (semver range) | `"^1.0.0"` | Tries to get the latest version allowed by the range |
| `branch` | `"master"` | Tries to move to the current tip of the named branch |
| `version` (non-range semver) | `"=1.0.0"` | Change can only occur if the upstream release was moved (e.g. `git push --force <tag>`) |
| `version` (non-semver) | `"foo"` | Change can only occur if the upstream release was moved |
| `revision` | `aabbccd...` | No change is possible |
| (none) | (none) | The first version that works, according to [the sort order](https://godoc.org/github.com/golang/dep/gps#SortForUpgrade) (not recommended) |
| ------------------------------------ | ------------------ | ----------------------------------------------------------------------------------------------------------------------- |
| `version` (semver range) | `"^1.0.0"` | Tries to get the latest version allowed by the range |
| `branch` | `"master"` | Tries to move to the current tip of the named branch |
| `version` (non-range semver) | `"=1.0.0"` | Change can only occur if the upstream release was moved (e.g. `git push --force <tag>`) |
| `version` (non-semver) | `"foo"` | Change can only occur if the upstream release was moved |
| `revision` | `aabbccd...` | No change is possible |
| (none) | (none) | The first version that works, according to [the sort order](https://godoc.org/github.com/golang/dep/gps#SortForUpgrade) |