GitoxideLabs/gitoxide · error
Failed to handle repositories
Error message
Failed to handle {num_errors} repositories What it means
Thrown at the end of an `organize` run (`gitoxide_core::organize::run`) when one or more repositories could not be handled. Individual failures are recorded during the loop (with `num_errors` incremented per failure) and this final bail summarizes the count.
Solutions
- Check per-repository error output earlier in the run to find the failing repositories
- Fix or remove the problematic repositories, then re-run organize
- Check permissions and that each target path is a valid git repository
- Re-run with a narrower set of repositories to isolate the failure
Example fix
// before gix organize ./repos/ # fails: 2 repositories could not be handled // after # inspect and fix the failing repos, e.g. remove corrupt one rm -rf ./repos/corrupt-repo gix organize ./repos/
Defensive patterns
Strategy: fallback
Try / catch
let result = organize::run(/* args */);
if let Err(e) = &result {
eprintln!("{e}; inspect per-repository errors above");
} Prevention
- Run batch operations with logging per item
- Quarantine known-bad repositories before batch runs
When it happens
Trigger: Running the organize command over a set of repositories where at least one repository fails handling - e.g. a repository open/operation error inside the per-repo processing loop.
Common situations: Corrupted or non-git directories inside the organized tree; permission problems on some repos; a repository locked by another process; one bad repo aborting an otherwise-successful batch.
Understand the failure class
Background: "git command failed": what it means when a tool shells out to git and git exits non-zero — this error's family across 21 libraries.
Related errors
- Refusing to checkout index into existing directory
- Cannot run without any task to perform on the repositories
- At least one operation failed
- No commits to process
- Cannot print information using 'human' format.
AI-assisted analysis of GitoxideLabs/gitoxide@e73179060b (2026-09-08).
Data as JSON: /api/errors/f27d9315731ecd2d.
Report an issue: GitHub.
Appendix: source
Thrown at gitoxide-core/src/organize.rs:316
let mut num_errors = 0usize;
let destination = destination.as_ref().canonicalize()?;
let mut repositories =
find_git_repository_workdirs(source_dir, progress.add_child("Searching repositories"), false, threads)
.collect::<Vec<_>>();
repositories.sort_unstable_by(|a, b| a.0.cmp(&b.0));
for (path_to_move, kind) in repositories {
if let Err(err) = handle(mode, kind, &path_to_move, &destination, &mut progress) {
progress.fail(format!(
"Error when handling directory {:?}: {}",
path_to_move.display(),
err
));
num_errors += 1;
}
}
if num_errors > 0 {
anyhow::bail!("Failed to handle {num_errors} repositories")
} else {
Ok(())
}
}
View on GitHub (pinned to e73179060b)