jdx/mise · error
conflicting dotfile edit declarations for
Error message
conflicting dotfile edit declarations for {}/{}
first:
{}
second:
{} What it means
Raised while composing dotfile edit requests from all config files: two config files declare an edit with the same (path, id) key but non-matching definitions. The library refuses to guess which wins and reports both declarations' conflict descriptions.
Solutions
- Open the two config files named in the message and make the duplicate declarations identical, or delete one.
- Give one of the conflicting edits a different `id` so each (path, id) pair is unique.
- Move shared edits to a single config file so they are declared exactly once.
Example fix
# before (project config conflicts with global config) [[edits]] path = "~/.zshrc" id = "alias" content = "alias g=git" # after: change the id in one file, or remove the duplicate block
Defensive patterns
Strategy: validation
Validate before calling
use std::collections::HashMap;
let mut seen: HashMap<(String, String), String> = HashMap::new();
for e in all_edit_entries() {
let key = (e.path.clone(), e.id.clone());
if let Some(prev) = seen.get(&key) { panic!("duplicate edit {key:?} in {prev}"); }
seen.insert(key, e.config_file.clone());
} Prevention
- Declare each (path, id) edit in exactly one config file.
- Keep edits centralized in the global config; avoid copy-pasting [[edit]] blocks between projects.
- Search all config files for a shared id before reusing it.
When it happens
Trigger: Calling `edits_from_config` where `edits_from_config_files` yields two `EditRequest`s with identical `path` and `id` whose `edit_requests_match` comparison fails, and the message names the path/id plus the `origin.conflict_description()` of each.
Common situations: The same dotfile edit declared in both a global config (~/.config/mise/config.toml) and a project config with different content/replacement text; duplicated [[edit]] blocks after copy-pasting config between files; an id reused across two files for different edits to the same file.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- [dotfiles]: duplicate OCI file path
- : target is already managed by [dotfiles] edits; remove or…
- a glob is required
- `--all` needs `--to
- an implied source entry key must be relative
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/429db438ab7a5f0c.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/edits.rs:172
let resolved = crate::system::files::resolve_target_arg(filter);
resolved == req.path
}
})
}
/// Aggregate edit `[dotfiles]` entries across all loaded config files. Entries
/// union global -> local, keyed by `(path, id)`; a more local config overrides
/// an edit with the same id. Malformed entries warn and are skipped.
pub(crate) fn edits_from_config(config: &Config) -> Result<Vec<EditRequest>> {
let mut composed: IndexMap<String, EditRequest> = IndexMap::new();
for config_files in config.bootstrap_config_maps() {
for request in edits_from_config_files(config_files) {
let key = format!("{}\u{0}{}", request.path.display(), request.id);
if let Some(existing) = composed.get(&key) {
if edit_requests_match(config, existing, &request) {
continue;
}
bail!(
"conflicting dotfile edit declarations for {}/{}\n\n first:\n {}\n\n second:\n {}",
request.path.display(),
request.id,
existing.origin.conflict_description(),
request.origin.conflict_description(),
);
}
composed.insert(key, request);
}
}
Ok(composed.into_values().collect())
}
/// Returns whether sibling declarations produce the same file edit.
fn edit_requests_match(config: &Config, first: &EditRequest, second: &EditRequest) -> bool {
first.path == second.path
&& first.id == second.id
&& first.op == second.opView on GitHub (pinned to 533346cc37)