Skip to content

Port commit selection to gix - #12

Open
Mshehu5 wants to merge 3 commits into
test-flake-integrationfrom
commit-validation-gix
Open

Mshehu5 wants to merge 3 commits into
test-flake-integrationfrom
commit-validation-gix

Conversation

@Mshehu5

@Mshehu5 Mshehu5 commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Moves from git2 to gix for reading the repository.

gix was the first choice: it's a pure Rust library that is easier to
work with, and it's what jj-lib is built on, if we want to add
something like that in the future.

  • Commit 1 swaps the library and leaves the tests untouched, so
    passing them shows nothing changed.
  • Commit 2 moves the test fixtures to gix and removes git2 entirely.

gix was the first choice: it is pure Rust and has what upcoming work
needs. git2 was picked only to apply expected-failure patches, and Nix
can apply those itself.

gix parses every revision form natively, so our hand-written ^X, X^!
and X^@ handling is gone. Tests are unchanged and still build
fixtures with git2, which shows behaviour is the same.
@Mshehu5
Mshehu5 added this pull request to stack #13 November 13, 2026 14:17
Rewrite the test fixtures with gix and drop git2 as a dev-dependency,
so libgit2 is no longer built at all. Each test keeps the same steps
and assertions.
std already prints an exit status as "exit status: 1" or as the signal
that stopped the process, so the hand-written status_suffix is gone.
Error messages now end with ": exit status: 1" instead of " with exit
status 1".
@Mshehu5
Mshehu5 force-pushed the commit-validation-gix branch from 5c2e1a3 to d479778 Compare November 13, 2026 15:39
Comment thread src/history.rs
for reference in references.all().context(Error::WalkHistory)? {
let mut reference = reference.context(Error::WalkHistory)?;
// As with `git rev-list --all`, refs to non-commit objects are ignored.
if let Ok(commit) = reference.peel_to_commit() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken refs are silently skipped by --all

if let Ok discards every peel error, not only the non-commit refs named by the comment, so a ref whose object is missing is dropped and --all exits successfully over an incomplete history; the parent returned WalkHistory for the same ref.

oak · automated · d479778

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants