GitoxideLabs/gitoxide · error · anyhow::Error

File-based lookup isn't yet implemented in a way that is…

Error message

File-based lookup isn't yet implemented in a way that is competitively fast

What it means

`gix log` on a file path is unimplemented: the `log_file` helper is a stub that unconditionally raises this message. Gitoxide has not yet implemented a competitively fast file-based history lookup (equivalent of `git log <path>`), so the feature is explicitly disabled rather than being slow.

Solutions

  1. Use the `git log -- <path>` command from real git instead
  2. Track upstream gitoxide for file-based log implementation and upgrade
  3. Implement the needed history traversal via the gix library API directly (e.g. commit-graph traversal with tree diffs)

Example fix

// before
$ gix log -- src/main.rs
// after
$ git log -- src/main.rs
Defensive patterns

Strategy: fallback

Validate before calling

// no way to detect beforehand; the whole subcommand is a stub

Try / catch

match result {
    Err(e) if e.to_string().contains("File-based lookup isn't yet implemented") =>
        fallback_to_git_cli("log", &["--", path]),
    other => other?,
}

Prevention

When it happens

Trigger: Calling `gix log` (the `log` entrypoint) with a file path argument, which routes to `log_file` and always fails regardless of repository state.

Common situations: Trying to view per-file history via the CLI to replicate `git log -- path/to/file`; scripting history queries over specific files; comparing gitoxide output against git for file histories.

Related errors


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

Appendix: source

Thrown at gitoxide-core/src/repository/log.rs:29

    }
}

fn log_all(repo: gix::Repository, out: &mut dyn std::io::Write) -> Result<(), anyhow::Error> {
    let head = repo.head()?.peel_to_commit()?;
    let topo = gix::traverse::commit::topo::Builder::from_iters(&repo.objects, [head.id], None::<Vec<gix::ObjectId>>)
        .build()?;

    for info in topo {
        let info = info?;

        write_info(&repo, &mut *out, &info)?;
    }

    Ok(())
}

fn log_file(_repo: gix::Repository, _out: &mut dyn std::io::Write, _path: BString) -> anyhow::Result<()> {
    bail!("File-based lookup isn't yet implemented in a way that is competitively fast");
}

fn write_info(
    repo: &gix::Repository,
    mut out: impl std::io::Write,
    info: &gix::traverse::commit::Info,
) -> Result<(), std::io::Error> {
    let commit = repo.find_commit(info.id).unwrap();

    let message = commit.message_raw_sloppy();
    let title = message.lines().next();

    writeln!(
        out,
        "{} {}",
        info.id.to_hex_with_len(8),
        title.map_or_else(|| "<no message>".into(), BString::from)
    )?;

View on GitHub (pinned to e73179060b)