Use GIX_TEST_FIXTURE_HASH for gix-worktree-stream#2543
Conversation
7605705 to
74a08aa
Compare
This is breaking because `Stream::add_entry_from_path`'s API has changed. It now takes `hash_kind` as an argument.
`gix-worktree-stream` actually has `#[cfg(feature = "sha256")]` in two places.
|
Thanks a lot for keeping this up, and as always sorry for the delays. While reviewing I noticed one thing that I think we should change from now on: unless the context really demands it, let's use I have pushed a couple of commits on top to change this, after I rebased yours for good measure. And… let's merge this :), and follow up anything else in the next PR. PSThis is the first time my new review workflow actually worked flawlessly :)! It's a delight.
Quite a few steps, but it's a great demonstration of how useful the Git index actually is. Q & A
It's the
I think so!
Good catch, this looks like an oversight. |
9245578 to
d5a5a76
Compare
… to `object_hash_from_env()` For consistency and convenience.
The new name is now used everywhere and more descriptive and clear.
2cf977b to
4309fa4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2cf977bc93
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
There was a problem hiding this comment.
Pull request overview
Updates the workspace to consistently respect GIX_TEST_FIXTURE_HASH (SHA1 vs SHA256) in fixtures and tests, while renaming hash_kind→object_hash across gix_object::Data and related call sites, and extending gix-worktree-stream to encode/decode the selected object-hash kind.
Changes:
- Add
gix_testtools::object_hash()/object_hash_from_env()and migrate call sites from the previous env-based helper usage. - Rename
gix_object::Datafieldhash_kindtoobject_hashand propagate the rename through multiple crates, tests, and benches. - Add SHA256 signaling to
gix-worktree-stream’s protocol and run its tests for both hash kinds viajust.
Reviewed changes
Copilot reviewed 63 out of 63 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/tools/src/lib.rs | Introduces object_hash() helpers and uses them for fixture generation paths and GIT_DEFAULT_HASH. |
| justfile | Adds dual-hash nextest runs for gix-worktree-stream. |
| gix/src/repository/impls.rs | Updates gix_object::Data construction to use object_hash. |
| gix-worktree-stream/tests/stream.rs | Makes expectations hash-kind aware; updates ODB init to use selected object hash. |
| gix-worktree-stream/src/protocol.rs | Adds byte mapping for SHA256 in the stream protocol (feature-gated). |
| gix-worktree-stream/src/lib.rs | Changes add_entry_from_path() to accept an object_hash kind and use it for null IDs. |
| gix-worktree-stream/Cargo.toml | Adds a sha256 feature and enables SHA256 for dev tests via gix-hash dev-dep features. |
| gix-revwalk/src/graph/mod.rs | Renames LazyCommit field hash_kind→object_hash. |
| gix-revwalk/src/graph/commit.rs | Propagates object_hash rename into commit parsing paths. |
| gix-refspec/tests/refspec/match_group.rs | Switches hash selection to gix_testtools::object_hash(). |
| gix-ref/tests/refs/main.rs | Uses gix_testtools::object_hash() for fixture hash kind. |
| gix-ref/tests/refs/file/mod.rs | Updates gix_object::Data field name to object_hash. |
| gix-ref/src/store/packed/transaction.rs | Updates gix_object::Data field name to object_hash. |
| gix-ref/src/store/packed/mod.rs | Renames packed-refs parsing state field to object_hash. |
| gix-ref/src/store/packed/iter.rs | Propagates object_hash rename through packed-refs iteration/parsing. |
| gix-ref/src/store/packed/find.rs | Uses object_hash when decoding packed references. |
| gix-ref/src/store/packed/decode.rs | Renames decode parameter to object_hash and updates callers. |
| gix-ref/src/store/packed/buffer.rs | Renames packed buffer field/params to object_hash. |
| gix-ref/src/store/file/raw_ext.rs | Adjusts destructuring to object_hash field rename. |
| gix-ref/src/store/file/overlay_iter.rs | Renames iterator field to object_hash and updates decoding call. |
| gix-ref/src/store/file/loose/reference/decode.rs | Renames loose-ref parsing arg to object_hash. |
| gix-ref/src/parse.rs | Renames hex_hash() arg to object_hash for consistency. |
| gix-pack/tests/pack/data/input.rs | Updates gix_object::Data field and fixture hash selection. |
| gix-pack/src/data/output/count/objects/mod.rs | Uses obj.object_hash when parsing tags/commits/trees. |
| gix-pack/src/bundle/find.rs | Updates gix_object::Data field name to object_hash. |
| gix-odb/src/store_impls/loose/find.rs | Updates gix_object::Data field name to object_hash. |
| gix-odb/src/store_impls/dynamic/handle.rs | Preserves store object_hash in TryFrom<&Store> for Store. |
| gix-odb/src/store_impls/dynamic/find.rs | Updates gix_object::Data field name to object_hash. |
| gix-odb/src/memory.rs | Updates gix_object::Data field name to object_hash. |
| gix-object/tests/object/tree/iter.rs | Uses gix_testtools::object_hash() for parsing tree entries. |
| gix-object/tests/object/tree/from_bytes.rs | Uses gix_testtools::object_hash() in tree parsing tests. |
| gix-object/tests/object/tree/entries.rs | Uses gix_testtools::object_hash() in tree ordering test. |
| gix-object/tests/object/tree/editor.rs | Updates gix_object::Data field name to object_hash. |
| gix-object/tests/object/object_ref.rs | Uses gix_testtools::object_hash() in loose object parsing test. |
| gix-object/tests/object/main.rs | Uses gix_testtools::object_hash() for fixture hash kind. |
| gix-object/tests/object/encode.rs | Uses gix_testtools::object_hash() for roundtrip parsing. |
| gix-object/src/tree/ref_iter.rs | Uses tree.object_hash when iterating tree components. |
| gix-object/src/tag/ref_iter.rs | Updates docs to refer to object_hash. |
| gix-object/src/tag/decode.rs | Updates docs to refer to object_hash. |
| gix-object/src/parse.rs | Updates docs to refer to object_hash. |
| gix-object/src/object/mod.rs | Updates docs to refer to object_hash. |
| gix-object/src/lib.rs | Renames Data.hash_kind→Data.object_hash and updates docs. |
| gix-object/src/data.rs | Updates Data decoding to use self.object_hash. |
| gix-object/src/commit/ref_iter.rs | Updates docs to refer to object_hash. |
| gix-object/src/commit/mod.rs | Renames CommitRef::from_bytes arg to object_hash and threads it through decode. |
| gix-object/src/commit/decode.rs | Updates commit parsing to use the renamed hash-kind parameter. |
| gix-object/benches/edit_tree.rs | Updates gix_object::Data field name to object_hash. |
| gix-object/benches/decode_objects.rs | Uses gix_testtools::object_hash() in benchmark setup. |
| gix-merge/tests/merge/blob/mod.rs | Updates gix_object::Data field name to object_hash. |
| gix-index/src/extension/end_of_index_entry/write.rs | Renames function arg to object_hash and updates uses. |
| gix-filter/tests/filter/pipeline/mod.rs | Uses gix_testtools::object_hash() in filter pipeline options. |
| gix-filter/tests/filter/pipeline/convert_to_worktree.rs | Uses gix_testtools::object_hash() in expected-hash assertions. |
| gix-filter/tests/filter/pipeline/convert_to_git.rs | Uses gix_testtools::object_hash() in expected-hash assertions. |
| gix-filter/tests/filter/ident.rs | Uses gix_testtools::object_hash() throughout ident tests. |
| gix-diff/tests/diff/tree_with_rewrites.rs | Uses gix_testtools::object_hash() for tree parsing and fixtures. |
| gix-diff/tests/diff/main.rs | Uses gix_testtools::object_hash() for ID selection and fixture kind. |
| gix-diff/src/tree/function.rs | Uses gix_testtools::object_hash().null() in tests. |
| gix-blame/tests/blame.rs | Uses gix_testtools::object_hash() for fixture kind. |
| gix-archive/tests/archive.rs | Updates add_entry_from_path() calls to pass object_hash. |
| gitoxide-core/src/repository/archive.rs | Passes repo.object_hash() into add_entry_from_path(). |
| gitoxide-core/src/query/engine/update.rs | Uses obj.object_hash when parsing commit parents. |
| gitoxide-core/src/index/checkout.rs | Updates gix::objs::Data field name to object_hash. |
| gitoxide-core/src/hours/mod.rs | Renames commit parsing arg to object_hash and threads it through. |
18bb074 to
b358d31
Compare
|
I have also updated 281, which now lists |
Perfect, I had started to notice a certain tension between |
CI failed with the following error message:
This is odd as, in this PR,
gix-worktree-streamis only at version0.30.0.Open questions
byte_to_hashandhash_to_bytecorrect?TryFrom<&super::Store> for super::Store, do we want to replaceuse_multi_pack_index: falsebyuse_multi_pack_index: s.use_multi_pack_index?This is part of #281