GitoxideLabs/gitoxide · info · anyhow::Error

interrupted by user

Error message

interrupted by user

What it means

After finishing index/worktree status iteration, `show` checks gix's global interrupt flag and bails with 'interrupted by user' so the command exits cleanly instead of proceeding to write changes or print results. This is the end-of-operation interrupt checkpoint complementing per-item checks elsewhere.

Solutions

  1. Expected behavior on cancellation — just re-run the command
  2. Reduce worktree size or ignore untracked files to speed status
  3. Avoid interrupting if changes (e.g. `--allow-write` index updates) must be applied
  4. Check exit status in scripts to distinguish cancelled runs from real failures
Defensive patterns

Strategy: try-catch

Try / catch

gix status show || handle_interrupt  # detect 'interrupted by user' in stderr and exit 130

Prevention

When it happens

Trigger: Receiving SIGINT/Ctrl-C (or `gix::interrupt::trigger()`) at any point while `gix status show` runs — checked at gitoxide-core/src/repository/status.rs:199 after iteration completes.

Common situations: User cancelling a slow status scan on huge worktrees; CI sending SIGTERM-like interrupts; terminal closing mid-command.

Related errors


AI-assisted analysis of GitoxideLabs/gitoxide@e73179060b (2026-09-08). Data as JSON: /api/errors/2b4dc40b28998418. Report an issue: GitHub.

Appendix: source

Thrown at gitoxide-core/src/repository/status.rs:199

            }) => {
                // TODO: handle multi-status characters, there can also be modifications at the same time as determined by their ID and potentially diffstats.
                writeln!(
                    out,
                    "{status: >3} {source_rela_path} → {dest_rela_path}",
                    status = "R",
                    source_rela_path =
                        gix::path::relativize_with_prefix(&gix::path::from_bstr(source.rela_path()), prefix).display(),
                    dest_rela_path = gix::path::relativize_with_prefix(
                        &gix::path::from_bstr(dirwalk_entry.rela_path.as_bstr()),
                        prefix
                    )
                    .display(),
                )?;
            }
        }
    }
    if gix::interrupt::is_triggered() {
        bail!("interrupted by user");
    }

    let out = iter.outcome_mut().expect("successful iteration has outcome");

    if out.has_changes() && allow_write {
        out.write_changes().transpose()?;
    }

    if statistics {
        writeln!(err, "{outcome:#?}", outcome = out.index_worktree).ok();
    }

    progress.init(Some(out.worktree_index.entries().len()), gix::progress::count("files"));
    progress.set(out.worktree_index.entries().len());
    progress.show_throughput(start);
    Ok(())
}

View on GitHub (pinned to e73179060b)