From 86276d4ffe1cc644a46c138e18a4b414c55f673c Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 1 Sep 2021 00:41:23 -0700 Subject: [PATCH] Document the use of `rev` to depend on pull requests --- src/doc/src/reference/specifying-dependencies.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/doc/src/reference/specifying-dependencies.md b/src/doc/src/reference/specifying-dependencies.md index 62789a4b879..d60d523bd92 100644 --- a/src/doc/src/reference/specifying-dependencies.md +++ b/src/doc/src/reference/specifying-dependencies.md @@ -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