jdx/mise · warning · eyre::Report

"{path_raw}".{id}: block/source and line are mutually exclus

Error message

"{path_raw}".{id}: block/source and line are mutually exclusive, ignoring entry

What it means

A [dotfiles] edit entry is either a block (inline block = or file-backed source =) or a single-line insert (line =). Setting block/source together with line is rejected because a region cannot be both marker-delimited content and an exact-match line; the entry is warned about and skipped.

Source

Thrown at src/system/edits.rs:244

    if id.is_empty() || !id.chars().all(|c| c.is_alphanumeric() || "_-.".contains(c)) {
        bail!(
            "\"{path_raw}\".{id:?}: ids may only contain letters, digits, '_', '-', and '.', ignoring entry"
        );
    }
    let entry = match entry {
        EditTomlEntry::Block(inline) => EditTomlTable {
            block: Some(inline),
            source: None,
            template: None,
            line: None,
            comment: None,
        },
        EditTomlEntry::Table(table) => table,
    };
    let is_block = entry.block.is_some() || entry.source.is_some();
    let op = match (&is_block, &entry.line) {
        (true, Some(_)) => {
            bail!(
                "\"{path_raw}\".{id}: block/source and line are mutually exclusive, ignoring entry"
            )
        }
        (false, None) => {
            bail!(
                "\"{path_raw}\".{id}: no recognized operation (block, source, or line), ignoring entry"
            )
        }
        (true, None) => {
            let source = match (entry.block, entry.source) {
                (Some(_), Some(_)) => {
                    bail!(
                        "\"{path_raw}\".{id}: block and source are mutually exclusive, ignoring entry"
                    )
                }
                (Some(inline), None) => BlockSource::Inline(inline),
                (None, Some(src)) => {
                    let src = file::replace_path(&src);

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Split into two entries with different ids — one block, one line — on the same file
  2. Or delete the key you do not want

Example fix

# before
[dotfiles]
"~/.zshrc/activate" = { block = 'eval "$(mise activate zsh)"', line = 'eval "$(mise activate zsh)"' }

# after
[dotfiles]
"~/.zshrc/activate" = { block = 'eval "$(mise activate zsh)"' }
Defensive patterns

Strategy: validation

Validate before calling

# an entry may combine block/source with template/comment, but not with line
python3 - <<'EOF'
import tomllib
for key, v in tomllib.load(open('mise.toml','rb')).get('dotfiles', {}).items():
    if isinstance(v, dict):
        blockish = 'block' in v or 'source' in v
        assert not (blockish and 'line' in v), f'mutually exclusive: {key}'
EOF

Prevention

When it happens

Trigger: An entry like { block = 'export PATH=...', line = 'export PATH=...' } or { source = "a.sh", line = "..." } in [dotfiles].

Common situations: Evolving a line edit into a block edit and leaving the old key in place; copy-pasting a combined example; intent to have both effects without realizing they need separate entries.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/a333a028ffcc2a2e. Report an issue: GitHub.