GitoxideLabs/gitoxide · error

traversal with date

Error message

traversal with date

What it means

When listing commits in the revision-list CLI, `commit.commit_time` is expected to be `Some` because the traversal was configured with commit-time ordering. The `.expect()` panics if a commit arrives without its commit time set.

Solutions

  1. Ensure the traversal is built with commit-time information enabled (e.g. `Sorting::ByCommitTime(...)`) so `commit_time` is populated.
  2. Update to a gix version where commit time is attached when date sorting is requested.
  3. Replace the `.expect()` with a fallback (e.g. print `0`) for robustness.

Example fix

// before
commit.commit_time.expect("traversal with date"),

// after
commit.commit_time.unwrap_or(0),
Defensive patterns

Strategy: try-catch

Validate before calling

// configure traversal explicitly
let sorting = gix::traverse::commit::Sorting::ByCommitTime(gix::traverse::commit::commit_timegen::Sorting::NewestFirst);

Try / catch

// guard instead of expect
let time = commit.commit_time.unwrap_or_else(|| {
    eprintln!("warning: commit time missing; printing 0");
    0
});

Prevention

When it happens

Trigger: Running the revision-list command where traversal is configured to sort by commit date but the returned commit info lacks `commit_time` — an internal inconsistency between traversal setup and consumption.

Common situations: A change in gix's traversal API that no longer populates commit_time by default; calling the list function with date-based sorting flags but an outdated traversal configuration.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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

Appendix: source

Thrown at gitoxide-core/src/repository/revision/list.rs:109

                    for parent_id in commit.parent_ids() {
                        let dest = match map.get(parent_id.as_ref()) {
                            Some(handle) => *handle,
                            None => {
                                let dest = vg.add_node(new_node(parent_id));
                                map.insert(parent_id.detach(), dest);
                                dest
                            }
                        };
                        let arrow = Arrow::simple("");
                        vg.add_edge(arrow, source, dest);
                    }
                }
                None => {
                    writeln!(
                        out,
                        "{} {} {}",
                        HexId::new(commit.id(), long_hashes),
                        commit.commit_time.expect("traversal with date"),
                        commit.parent_ids.len()
                    )?;
                }
            }
            progress.inc();
            if limit.is_some_and(|limit| limit == progress.step()) {
                break;
            }
        }

        progress.show_throughput(start);
        if let Some((mut vg, path, _)) = vg {
            let start = std::time::Instant::now();
            progress.set_name("layout graph".into());
            progress.info(format!("writing {}…", path.display()));
            let mut svg = SVGWriter::new();
            vg.do_it(false, false, false, &mut svg);
            std::fs::write(&path, svg.finalize().as_bytes())?;

View on GitHub (pinned to e73179060b)