{"record":{"id":"2e54611e6ec7e21e","repo":"rust-lang/cargo","slug":"unknown-vcs-specification","errorCode":null,"errorMessage":"unknown vcs specification: `{}`","messagePattern":"unknown vcs specification: `(.+?)`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/ops/cargo_new.rs","lineNumber":40,"sourceCode":"    pub kind: NewProjectKind,\n    pub auto_detect_kind: bool,\n    /// Absolute path to the directory for the new package\n    pub path: PathBuf,\n    pub name: Option<String>,\n    pub edition: Option<String>,\n    pub registry: Option<String>,\n}\n\n#[derive(Clone, Copy, Debug, PartialEq, Eq)]\npub enum NewProjectKind {\n    Bin,\n    Lib,\n}\n\nimpl NewProjectKind {\n    fn is_bin(self) -> bool {\n        self == NewProjectKind::Bin\n    }\n}\n\nimpl fmt::Display for NewProjectKind {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        match *self {\n            NewProjectKind::Bin => \"binary (application)\",\n            NewProjectKind::Lib => \"library\",\n        }\n        .fmt(f)\n    }\n}\n\nstruct SourceFileInformation {\n    relative_path: String,\n    bin: bool,\n}\n\nstruct MkOptions<'a> {","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/rust-lang/cargo/blob/98a09e7e7d62850f14e5b6132101fc1edd19a16f/src/ops/cargo_new.rs#L22-L58","documentation":"`VersionControl::from_str` accepts exactly `git`, `hg`, `pijul`, `fossil`, and `none`. Any other string — passed via `cargo new --vcs <s>` or read from a config field deserialized into `VersionControl` — is rejected with the offending token echoed back.","triggerScenarios":"`cargo new --vcs svn myproject`, `cargo new --vcs cvs myproject`, or any `--vcs` value outside the five allowed. Also triggered when a config file/TOML field deserialized as `VersionControl` contains an unrecognized variant.","commonSituations":"Typing `--vcs github`, `--vcs git-hub`, `--vcs none` misspelled (`--vcs noone`). Copying a `vcs = \"...\"` value from docs that listed an unsupported VCS. Scripts that interpolate a variable VCS name.","solutions":["Use one of: `git`, `hg`, `pijul`, `fossil`, `none` — e.g. `cargo new --vcs git myproject`.","Omit `--vcs` entirely to let cargo auto-detect (defaults to git for `new`, inherits existing for `init`).","Check for typos or trailing whitespace in the value, especially when read from config."],"exampleFix":"# before\n$ cargo new --vcs svn myproject   # error\n\n# after\n$ cargo new --vcs git myproject\n# or\n$ cargo new --vcs none myproject","handlingStrategy":"validation","validationCode":"fn valid_vcs(s: &str) -> bool {\n    matches!(s, \"git\" | \"hg\" | \"pijul\" | \"fossil\" | \"none\")\n}\n// if !valid_vcs(&v) { return error before calling cargo new --vcs }","typeGuard":"fn parse_vcs(s: &str) -> Option<&'static str> {\n    match s { \"git\"=>Some(\"git\"), \"hg\"=>Some(\"hg\"), \"pijul\"=>Some(\"pijul\"), \"fossil\"=>Some(\"fossil\"), \"none\"=>Some(\"none\"), _=>None }\n}","tryCatchPattern":null,"preventionTips":["Validate the `--vcs` value against the five allowed strings before invoking cargo.","When in doubt, omit `--vcs` and let cargo auto-detect.","Trim whitespace and lowercase user-supplied VCS names in wrappers.","Document the supported set wherever you expose a vcs option."],"tags":["vcs","cargo-new","cli-usage","config"],"backgroundTag":null,"analyzedSha":"98a09e7e7d62850f14e5b6132101fc1edd19a16f","analyzedAt":"2026-08-11T17:42:36.556Z","contentChangedAt":"2026-08-11T17:42:36.556Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}