jdx/mise · info

declined; nothing was changed

Error message

declined; nothing was changed

What it means

User-declined confirmation in history replay (apply_steps): the user answered no at the apply prompt, so the function bails with 'declined; nothing was changed' after re-planning and printing the plan. This is a normal, expected control-flow exit, not a malfunction.

Source

Thrown at src/system/history/replay.rs:505

    let mut live;
    loop {
        round += 1;
        // editors may have written while the prompt was open: re-plan
        live = live_tree(repo, tracked)?;
        let fresh = plan(repo, exec, &live)?;
        let changed = actionable(&fresh) != actionable(steps);
        if changed {
            *steps = fresh.clone();
            miseprintln!("history: the working tree changed since the plan was shown:");
            print_plan(steps, exec, tracked)?;
            if steps
                .iter()
                .any(|step| matches!(step.action, Action::Conflict(_)))
            {
                bail!("the refreshed plan has conflicts; nothing was changed");
            }
            if !exec.yes && !prompt::confirm("history: apply the refreshed plan?")?.is_yes() {
                bail!("declined; nothing was changed");
            }
        }
        // completeness: every path about to be written or deleted that exists
        // now must be captured, as it is now, in the protective checkpoint
        let Some((before_id, _)) = scope.before() else {
            bail!("no protective checkpoint could be taken; nothing was changed");
        };
        let before = store::entry(store, before_id)?;
        let before_tree = before
            .checkpoint
            .tree
            .snapshot
            .clone()
            .ok_or_else(|| eyre::eyre!("the protective checkpoint has no content"))?;
        let mut missing = vec![];
        for step in steps.iter().filter(|step| step.action.mutates()) {
            let Some(current) = repo.restored_object_at(&live, &step.tree_path)? else {
                continue;

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Re-run the history apply command and confirm at the prompt
  2. Use the dry-run/plan output to review steps before confirming
  3. No code fix is needed; this exit is by design

Example fix

// before
mise history apply <id>   # answers prompt with 'n'
// after
mise history apply <id> --yes
Defensive patterns

Strategy: fallback

Validate before calling

// non-interactive runs: pass --yes explicitly
if !is_interactive && !args.contains("--yes") {
    args.push("--yes");
}

Try / catch

// treat the bail as an intentional no-op
match result {
    Err(e) if e.to_string().contains("declined; nothing was changed") => {
        println!("user declined; tree untouched");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Answering 'no' (or a non-affirmative answer) to the `history: apply the refreshed plan?` prompt, i.e. when exec.yes is false and prompt::confirm does not return yes.

Common situations: User reviews the refreshed plan and decides not to proceed; non-interactive/CI runs where the prompt gets a non-yes answer.

Related errors


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