Document the use of rev to depend on pull requests

This commit is contained in:
David Tolnay 2021-09-01 00:41:23 -07:00
parent 19bb1df226
commit 86276d4ffe
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -147,6 +147,13 @@ the latest commit on a branch named `next`:
regex = { git = "https://github.com/rust-lang/regex", branch = "next" }
```
Anything that is not a branch or tag falls under `rev`. This can be a commit
hash like `rev = "4c59b707"`, or a named reference exposed by the remote
repository such as `rev = "refs/pull/493/head"`. What references are available
varies by where the repo is hosted; GitHub in particular exposes a reference to
the most recent commit of every pull request as shown, but other git hosts often
provide something equivalent, possibly under a different naming scheme.
Once a `git` dependency has been added, Cargo will lock that dependency to the
latest commit at the time. New commits will not be pulled down automatically
once the lock is in place. However, they can be pulled down manually with