Switch to at_opts from at in gix-odb tests - #2901
Merged
Sebastian Thiel (Byron) merged 3 commits intoAug 11, 2026
Merged
Conversation
Christoph Rüßler (cruessler)
marked this pull request as ready for review
August 11, 2026 06:13
Contributor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5084f2e266
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
`gix_odb::at()` implicitly selects SHA-1 as the default hash in SHA-1/SHA-256 which can be unexpected, cannot be overwritten and is a potential source of bugs. `gix_odb::at_opts()`, on the other hand, forces callers to explicitly provide `Options` which contain `object_hash`.
This way, a hash must be chosen, so that SHA-1 isn't hardcoded anymore.
Sebastian Thiel (Byron)
force-pushed
the
switch-to-gix-odb-at-opts
branch
from
August 11, 2026 15:48
5084f2e to
17fea2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gix_odb::at_opts()forces callers to select a hash whilegix_odb::at()defaults to SHA-1 in SHA-1/SHA-256 builds, making most tests that useatfail underGIX_TEXT_FIXTURE_HASH=sha256. This has been a common theme in making tests SHA-256-ready: switching fromattoat_opts, so thatobject_hashcan be explicitly passed. If my LSP is correct, this PR switches the last remaining uses ofattoat_opts.gix_odb::at()implicitly selects SHA-1 as the default hash in SHA-1/SHA-256 builds which can be unexpected, cannot be overwritten and is a potential source of bugs.gix_odb::at_opts(), on the other hand, forces callers to explicitly provideOptionswhich containobject_hash.If I’m not missing anything,
atdoes not have any callers anymore, now that the remaining ones are switched toat_opts. Which makes me wonder: can we removeataltogether? This PR is an attempt at answering that question.Update after CI was green: it appears we could remove
gix_odb::atif we wanted to. Other options include deprecating it or adding a warning to its docs that clearly state the potential for bugs in SHA-1/SHA-256 builds. Sebastian Thiel (@Byron) What do you think?