jdx/mise · error
a glob is required
Error message
a glob is required
What it means
Validation in the `mise dotfiles` paths command (edit_exclude flow, src/cli/dotfiles/paths.rs). The `mise dot exclude` command requires a glob pattern argument to add to the exclusion list; this error fires when the subcommand is invoked with no glob (or an empty argument), so there is no pattern to persist to the dotfiles watch configuration.
Solutions
- Pass the glob explicitly: `mise dot paths exclude 'secrets/*'`
- Quote the argument in scripts: `mise dot paths exclude "$GLOB"` and validate $GLOB is non-empty first
- Use `mise dot paths` to list current exclusions and confirm the pattern you want
Example fix
// before GLOB="" mise dot paths exclude $GLOB // after GLOB="secrets/*" mise dot paths exclude "$GLOB"
Defensive patterns
Strategy: validation
Validate before calling
[ -n "${GLOB:-}" ] && [ -n "$(echo "$GLOB" | tr -d '[:space:]')" ] || { echo "glob required"; exit 1; } Try / catch
if ! mise dot paths exclude "$GLOB"; then echo "provide a non-empty glob, e.g. mise dot paths exclude 'secrets/*'" fi
Prevention
- Quote glob variables in shell scripts
- Default empty variables before invoking the command
- Validate globs non-empty after trimming whitespace
- List current exclusions (`mise dot paths`) to sanity-check patterns
When it happens
Trigger: Calling `mise dot paths exclude` / `--add` with an empty string or only whitespace as the glob argument (after `glob.trim()` it is empty).
Common situations: Shell scripts with an unquoted/unset variable: `mise dot paths exclude $GLOB` where GLOB is empty; accidental double-space or missing argument in an alias.
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
- `--all` needs `--to
- at least one target or --changed is required
- cannot apply
- cannot connect a setup repository
- cannot save
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/0ed942ecf185ca2e.
Report an issue: GitHub.
Appendix: 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 dot 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 533346cc37)