jdx/mise · error

tap ' ' must be in / format; supply an explicit URL for…

Error message

tap '{tap}' must be in <owner>/<repo> format; supply an explicit URL for non-standard taps

What it means

default_tap_url requires a tap name in <owner>/<repo> format to build the default GitHub URL (https://github.com/<owner>/homebrew-<repo>.git). Any other shape — missing slash, empty components, extra slashes, or a bare name — is rejected because a URL cannot be derived unambiguously without an explicit URL.

Solutions

  1. Write the tap as <owner>/<repo>, e.g. owner/tap.
  2. Supply an explicit git URL for non-standard taps instead of relying on the default.
  3. Check the config for typos: exactly one slash, no empty or whitespace components.
  4. Consult `brew tap` output locally to get the correct owner/repo pair.

Example fix

// before
let url = default_tap_url("homebrew").unwrap();          // panics/errors
let url2 = default_tap_url("owner/repo/extra").unwrap(); // too many parts
// after
let url = default_tap_url("owner/repo").unwrap();        // https://github.com/owner/homebrew-repo.git
// or supply an explicit URL for nonstandard taps
Defensive patterns

Strategy: validation

Validate before calling

fn is_valid_tap(tap: &str) -> bool {
    let parts: Vec<&str> = tap.split('/').collect();
    parts.len() == 2 && parts.iter().all(|p| !p.is_empty() && !p.trim().is_empty())
}

Type guard

fn parse_tap(tap: &str) -> Option<(&str, &str)> {
    let (owner, repo) = tap.split_once('/')?;
    if owner.is_empty() || repo.is_empty() || repo.contains('/') { return None; }
    Some((owner, repo))
}

Prevention

When it happens

Trigger: Called from run and tap_entry_with_urls when configuring a tap; triggered by taps like "homebrew", "owner/repo/extra", "/repo", "owner/", or names containing whitespace. Also when a user supplies a nonstandard tap without its git URL.

Common situations: Config mistakes in brew backend entries where a tap is written without the owner; typos like double slashes; attempting to use Homebrew's official shorthand (e.g. "homebrew/cask") without a URL.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/6ceea377c8f807e7. Report an issue: GitHub.

Appendix: source

Thrown at src/system/packages/brew/maintenance.rs:91

    #[serde(default)]
    installed_on_request: Option<bool>,
    #[serde(default)]
    source: Option<ReceiptSource>,
}

#[derive(Debug, Default, Deserialize)]
struct ReceiptSource {
    #[serde(default)]
    tap: Option<String>,
}

pub(crate) fn default_tap_url(tap: &str) -> Result<String> {
    let mut parts = tap.split('/');
    match (parts.next(), parts.next(), parts.next()) {
        (Some(owner), Some(repo), None) if !owner.is_empty() && !repo.is_empty() => {
            Ok(format!("https://github.com/{owner}/homebrew-{repo}.git"))
        }
        _ => bail!(
            "tap '{tap}' must be in <owner>/<repo> format; supply an explicit URL for non-standard taps"
        ),
    }
}

pub(crate) fn linked_formulae(include_all: bool) -> Result<Vec<InstalledFormula>> {
    let opt = prefix::prefix().join("opt");
    let mut formulae = BTreeMap::new();
    for entry in file::ls(&opt)? {
        if !entry
            .symlink_metadata()
            .is_ok_and(|m| m.file_type().is_symlink())
        {
            continue;
        }
        let Some(name) = entry
            .file_name()
            .and_then(|f| f.to_str())

View on GitHub (pinned to 533346cc37)