{"record":{"id":"0ed942ecf185ca2e","repo":"jdx/mise","slug":"a-glob-is-required","errorCode":null,"errorMessage":"a glob is required","messagePattern":"a glob is required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/paths.rs","lineNumber":179,"sourceCode":"                crate::system::history::watch::runtime::humantime(std::time::Duration::from_secs(\n                    noisy.interval_secs,\n                )),\n                noisy.pending_changes.to_string(),\n                noisy.last_seen.clone(),\n            ]);\n        }\n        table.print()?;\n        miseprintln!(\n            \"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.\"\n        );\n        Ok(())\n    }\n}\n\npub(crate) fn edit_exclude(glob: &str, add: bool) -> Result<()> {\n    let glob = glob.trim();\n    if glob.is_empty() {\n        eyre::bail!(\"a glob is required\");\n    }\n    let global = crate::config::global_config_path();\n    let changed = crate::cli::dotfiles::track::edit_exclude(glob, add)?;\n    match (add, changed) {\n        (true, true) => info!(\n            \"history: {glob} is excluded from capture ({})\",\n            display_path(&global)\n        ),\n        (true, false) => info!(\"history: {glob} was already excluded\"),\n        (false, true) => info!(\n            \"history: {glob} is captured again ({})\",\n            display_path(&global)\n        ),\n        (false, false) => info!(\"history: {glob} was not excluded\"),\n    }\n    Ok(())\n}\n","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/dotfiles/paths.rs#L161-L197","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Pass a non-empty glob pattern, e.g. `mise bootstrap dotfiles paths --exclude '**/*.log'`","Check the shell variable you interpolated actually has a value before invoking the command","Quote the glob so the shell does not drop empty arguments"],"exampleFix":"// before\nGLOB=\"\"\nmise bootstrap dotfiles paths exclude \"$GLOB\"\n// after\nGLOB='**/*.log'\nmise bootstrap dotfiles paths exclude \"$GLOB\"","handlingStrategy":"validation","validationCode":"# shell: fail fast on an empty glob\nif [ -z \"${GLOB// /}\" ]; then\n  echo \"error: a glob is required\" >&2; exit 1\nfi\nmise bootstrap dotfiles paths exclude \"$GLOB\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate/trim glob inputs in scripts before passing them to mise","Quote all interpolated glob variables","Test exclusion commands with a sample glob before automating them"],"tags":["cli","dotfiles","validation","empty-argument"],"backgroundTag":"empty-required-field","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}