Skip to content

Commit 86276d4

Browse files
committed
Document the use of rev to depend on pull requests
1 parent 19bb1df commit 86276d4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/doc/src/reference/specifying-dependencies.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ the latest commit on a branch named `next`:
147147
regex = { git = "https://github.com/rust-lang/regex", branch = "next" }
148148
```
149149

150+
Anything that is not a branch or tag falls under `rev`. This can be a commit
151+
hash like `rev = "4c59b707"`, or a named reference exposed by the remote
152+
repository such as `rev = "refs/pull/493/head"`. What references are available
153+
varies by where the repo is hosted; GitHub in particular exposes a reference to
154+
the most recent commit of every pull request as shown, but other git hosts often
155+
provide something equivalent, possibly under a different naming scheme.
156+
150157
Once a `git` dependency has been added, Cargo will lock that dependency to the
151158
latest commit at the time. New commits will not be pulled down automatically
152159
once the lock is in place. However, they can be pulled down manually with

0 commit comments

Comments
 (0)