Skip to content

Commit

Permalink
Document the use of rev to depend on pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Sep 1, 2021
1 parent 19bb1df commit 86276d4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/doc/src/reference/specifying-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 86276d4

Please sign in to comment.