jdx/mise · error

a glob is required

Error message

a glob is required

What it means

Thrown by `edit_exclude` in src/cli/dotfiles/paths.rs when the glob argument passed for adding or removing a history capture exclusion is empty (after trimming whitespace). An exclusion rule with no pattern is meaningless, so the command fails fast.

Source

Thrown at src/cli/dotfiles/paths.rs:179

                crate::system::history::watch::runtime::humantime(std::time::Duration::from_secs(
                    noisy.interval_secs,
                )),
                noisy.pending_changes.to_string(),
                noisy.last_seen.clone(),
            ]);
        }
        table.print()?;
        miseprintln!(
            "These paths keep changing, so the watcher saves them ever more rarely (never excluded or switched to manual saving on its own). Exclude a log, cache, or database with `mise bootstrap dotfiles exclude '<glob>'`; track configuration that changes constantly with `--no-autosave` and save it explicitly."
        );
        Ok(())
    }
}

pub(crate) fn edit_exclude(glob: &str, add: bool) -> Result<()> {
    let glob = glob.trim();
    if glob.is_empty() {
        eyre::bail!("a glob is required");
    }
    let global = crate::config::global_config_path();
    let changed = crate::cli::dotfiles::track::edit_exclude(glob, add)?;
    match (add, changed) {
        (true, true) => info!(
            "history: {glob} is excluded from capture ({})",
            display_path(&global)
        ),
        (true, false) => info!("history: {glob} was already excluded"),
        (false, true) => info!(
            "history: {glob} is captured again ({})",
            display_path(&global)
        ),
        (false, false) => info!("history: {glob} was not excluded"),
    }
    Ok(())
}

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Pass a non-empty glob pattern, e.g. `mise bootstrap dotfiles paths --exclude '**/*.log'`
  2. Check the shell variable you interpolated actually has a value before invoking the command
  3. Quote the glob so the shell does not drop empty arguments

Example fix

// before
GLOB=""
mise bootstrap dotfiles paths exclude "$GLOB"
// after
GLOB='**/*.log'
mise bootstrap dotfiles paths exclude "$GLOB"
Defensive patterns

Strategy: validation

Validate before calling

# shell: fail fast on an empty glob
if [ -z "${GLOB// /}" ]; then
  echo "error: a glob is required" >&2; exit 1
fi
mise bootstrap dotfiles paths exclude "$GLOB"

Prevention

When it happens

Trigger: Calling the dotfiles paths exclude edit with an empty string or whitespace-only glob argument, e.g. `mise bootstrap dotfiles paths --exclude ' '` or an unset shell variable expanding to nothing.

Common situations: Unquoted/unset shell variables like `mise ... exclude "$GLOB"` where $GLOB is empty; copy-paste mistakes leaving the argument blank; scripting loops that iterate over an empty list.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/0ed942ecf185ca2e. Report an issue: GitHub.