{"record":{"id":"d0d1a93331a323de","repo":"zellij-org/zellij","slug":"flag-no-push-can-only-be-used-with-cargo-re","errorCode":null,"errorMessage":"flag '--no-push' can only be used with '--cargo-registry'","messagePattern":"flag '--no-push' can only be used with '--cargo-registry'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/pipelines.rs","lineNumber":233,"sourceCode":"    let remote = flags.git_remote.unwrap_or(\"origin\".into());\n    let registry = if let Some(ref registry) = flags.cargo_registry {\n        Some(format!(\n            \"--registry={}\",\n            registry\n                .clone()\n                .into_string()\n                .map_err(|registry| anyhow::Error::msg(format!(\n                    \"failed to convert '{:?}' to valid registry name\",\n                    registry\n                )))\n                .context(err_context)?\n        ))\n    } else {\n        None\n    };\n    let registry = registry.as_ref();\n    if flags.no_push && flags.cargo_registry.is_none() {\n        anyhow::bail!(\"flag '--no-push' can only be used with '--cargo-registry'\");\n    }\n\n    sh.change_dir(crate::project_root());\n    let cargo = crate::cargo().context(err_context)?;\n    let project_dir = crate::project_root();\n    let manifest = sh\n        .read_file(project_dir.join(\"Cargo.toml\"))\n        .context(err_context)?\n        .parse::<toml::Table>()\n        .context(err_context)?;\n    // Version of the core crate\n    let version = manifest\n        .get(\"workspace\")\n        .and_then(|workspace| workspace.get(\"package\"))\n        .and_then(|package| package[\"version\"].as_str())\n        .context(\"failed to read package version from manifest\")\n        .context(err_context)?;\n","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/xtask/src/pipelines.rs#L215-L251","documentation":"In `cargo xtask publish`, --no-push suppresses the git push step and is only meaningful when publishing to a custom registry selected with --cargo-registry. Using --no-push without --cargo-registry is rejected immediately (anyhow::bail!) before any publish work starts.","triggerScenarios":"Running `cargo xtask publish --no-push` without also passing --cargo-registry.","commonSituations":"Trying a dry-run-like local publish without reading the flag contract; scripts carrying --no-push over from a registry workflow into the default crates.io flow.","solutions":["Add the registry: `cargo xtask publish --cargo-registry <name> --no-push`","Or drop --no-push and run the normal publish flow (it pushes by default)","Use `--dry-run` instead if the goal was to rehearse a publish without side effects; check `cargo xtask publish --help`"],"exampleFix":"# before\ncargo xtask publish --no-push\n\n# after\ncargo xtask publish --cargo-registry acme --no-push","handlingStrategy":"validation","validationCode":"# enforce flag contract before invoking publish\nif [[ -n \"$NO_PUSH\" && -z \"$REGISTRY\" ]]; then\n  echo \"--no-push requires --cargo-registry <name>\"; exit 2\nfi\ncargo xtask publish ${REGISTRY:+--cargo-registry \"$REGISTRY\"} ${NO_PUSH:+--no-push}","typeGuard":"fn publish_flags_valid(no_push: bool, cargo_registry: Option<&str>) -> bool {\n    !no_push || cargo_registry.is_some()\n}","tryCatchPattern":null,"preventionTips":["Model the invariant in wrappers: no-push implies registry","Prefer --dry-run to rehearse publishes; reserve --no-push for registry workflows","Check `cargo xtask publish --help` when scripting the release pipeline"],"tags":["cli","usage","publish","flags"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}