Skip to content

Run gix-refspec tests with both sha1 and sha256#2448

Merged
Sebastian Thiel (Byron) merged 6 commits intoGitoxideLabs:mainfrom
cruessler:add-sha-256-to-gix-refspec
Mar 23, 2026
Merged

Run gix-refspec tests with both sha1 and sha256#2448
Sebastian Thiel (Byron) merged 6 commits intoGitoxideLabs:mainfrom
cruessler:add-sha-256-to-gix-refspec

Conversation

@cruessler
Copy link
Copy Markdown
Contributor

@cruessler Christoph Rüßler (cruessler) commented Feb 28, 2026

This PR adds sha256 support to gix-refspec tests. It adds the sha256 feature flag to dev-dependencies and runs the test suite for gix-refspec for both sha1 and sha256. It adds separate branches for SHA-256 in a few places where SHA-1 hashes were hardcoded.

Open questions

  • gix-refspec/tests/fixtures/generated-archives/.gitignore includes /match_baseline.tar. Does it also need to include /match_baseline_sha256.tar? (I haven’t committed the latter yet.)
  • gix_refspec::parse::function::looks_like_object_hash uses gix_hash::Kind::shortest. Does it need to be changed? (I suspect it doesn’t.)

This PR is related to #281.

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3dcb7ee9b7

ℹ️ 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".

Comment thread gix-refspec/tests/fixtures/match_baseline.sh Outdated
@cruessler Christoph Rüßler (cruessler) marked this pull request as draft February 28, 2026 21:40
@cruessler Christoph Rüßler (cruessler) marked this pull request as ready for review March 1, 2026 08:31
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d58a35e673

ℹ️ 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".

Comment thread justfile
@cruessler Christoph Rüßler (cruessler) changed the title Use GIX_TEST_FIXTURE_HASH for gix-refspec Run gix-refspec tests with both sha1 and sha256 Mar 3, 2026
Sebastian Thiel (Byron) and others added 5 commits March 23, 2026 15:33
…TURE_HASH`

This is useful when tests want to inspect the hash under test.
This script now unconditionally expands `GIX_TEST_FIXTURE_HASH` under `set -u`,
so running the refspec tests without explicitly exporting that variable (for
example via `cargo nextest run -p gix-refspec`) aborts fixture generation before
any baseline is produced. Previously the tests worked with the default hash
behavior, so this change introduces a regression unless every invocation path
sets the env var; please make the script treat an unset value as `sha1`.
@Byron
Copy link
Copy Markdown
Member

Sorry for the late response, and thanks for keeping this topic going!

As you can see, I changed my review style and create changes on top of each commit (if needed).
While doing so I also noticed that gix doesn't actually compile just yet, and I hope that getting it to compile can be prioritized (via gix-pack for instance, and probably more).

  • gix-refspec/tests/fixtures/generated-archives/.gitignore includes /match_baseline.tar. Does it also need to include /match_baseline_sha256.tar? (I haven’t committed the latter yet.)
    Yes, this came up naturally and it's ignored now. Codex also pointed it out.
  • gix_refspec::parse::function::looks_like_object_hash uses gix_hash::Kind::shortest. Does it need to be changed? (I suspect it doesn’t.)

I think that's fine as well.

Finally, I hope I will not get into the situation again that so many PRs are piling up - have to take the time now to review everything 😅.

@Byron Sebastian Thiel (Byron) merged commit 9a78ae2 into GitoxideLabs:main Mar 23, 2026
31 checks passed
@cruessler
Copy link
Copy Markdown
Contributor Author

Sorry for the late response, and thanks for keeping this topic going!

No worries, I’ll happily continue whenever I get a new review. :-)

As you can see, I changed my review style and create changes on top of each commit (if needed). While doing so I also noticed that gix doesn't actually compile just yet, and I hope that getting it to compile can be prioritized (via gix-pack for instance, and probably more).

gix not compiling, is that something that still needs to be addressed? (I feel I might be missing context.)

@Byron
Copy link
Copy Markdown
Member

gix not compiling, is that something that still needs to be addressed? (I feel I might be missing context.)

I think I meant that gix doesn't compile with sha256 enabled. My confusion stemmed from me being able to use Cargo features that didn't actually compile.

@cruessler
Copy link
Copy Markdown
Contributor Author

I think I meant that gix doesn't compile with sha256 enabled. My confusion stemmed from me being able to use Cargo features that didn't actually compile.

Understood. I’ll have a look!

@cruessler
Copy link
Copy Markdown
Contributor Author

Sebastian Thiel (@Byron) Which command did you run exactly that did not work?

On my Ubuntu machine, all of the following work:

  • cargo build --package gix --features=sha1,sha256 works.
  • cargo build --package gix --features=sha256 works.
  • Adding a feature flag sha256 to the root Cargo.toml and running cargo build --features sha1,sha256 also works.

@Byron
Copy link
Copy Markdown
Member

Thanks for double-checking - I retract my statement :D. Maybe I really was confused, and will take a look if it happens again.

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