Re: [RFC PATCH 4/6] contrib/cgit-rs: add repo initialization and config access
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Aug 8, 2024, 00:04 UTC
- Message-ID
- <ZrQLeQ9P8OcDWZX-@tapette.crustytoothpaste.net>
- In-Reply-To
- <2p3fkcw2iie53ojnqybhyxhzwsyhkm6qhreip7emeftkjprqrw@r6drczjhy7hu>
On 2024-08-07 at 23:14:43, Josh Steadmon wrote:
Show 7 quoted lines
> Semi-relatedly, I was wondering if you might be able to answer a cargo / > crates.io question: for a crate such as cgit-rs, which is not located in > the root of its VCS repo, will cargo balk at downloading the full > git.git worktree? Our build.rs expects the full Git source to be > available at "../.." relative to the crate root. We've currently only > tested consuming cgit-rs in JJ via a local path rather than through > crates.io.
The documentation[0] says this:
Cargo fetches the git repository at that location and traverses the file tree to find Cargo.toml file for the requested crate anywhere inside the git repository. For example, regex-lite and regex-syntax are members of rust-lang/regex repo and can be referred to by the repo’s root URL (https://github.com/rust-lang/regex.git) regardless of where in the file tree they reside.
If you want to test, you should be able to push it to a repository somewhere, even if that's a local path, and specify like so to test:
---- [dependencies] cgit-rs = { version = "0.1.0", git = "file:///path/to/git.git", branch = "cgit-rs" } ----
and see if it finds it.
[0] https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html
-- brian m. carlson (they/them or he/him) Toronto, Ontario, CA