etc/plan/sha256-support.md
Source issue: GitoxideLabs/gitoxide#281
Imported on: 2026-04-22
Working assumption: checkboxes in this file reflect current checkout, not only historical issue state.
Make object-hash kind first-class across config, protocol, storage, tests, and clone flow so SHA1 and SHA256 are both deliberate runtime choices instead of SHA1 being hidden fallback everywhere.
gix-hash and lean on gix_hash::Kind-parametric usage.
Evidence: gix-hash still contains new_sha1, new_sha256, from_20_bytes, from_32_bytes, null_sha1, null_sha256.Kind::Sha1.null() call sites still remain, plus a few explicit 20-byte comments and helpers.--object-hash matches.sha1 feature from gix-hash and deal with fallout.
Evidence: gix-hash has default = [], docs.rs explicitly enables sha1, root gitoxide chooses SHA1 via features, and justfile contains 31 compile-guard checks for missing hash selection.gix-features feature toggles.
Evidence: gix-features/Cargo.toml has no SHA1/SHA256 feature toggles anymore.gix-object tree decoding hotspot uses hash_kind.len_in_bytes().Sha256 enum variant and hasher support.
Evidence: gix_hash::Kind::Sha256, ObjectId::Sha256, and Hasher::Sha256 exist.gix/src/clone/fetch/mod.rs still has unimplemented!("configure repository to expect a different object hash as advertised by the server").Workspace signals on 2026-04-22:
gix-hash default hash feature: removedjustfile: 31Kind::Sha1.null() occurrences: 73object-format=sha1 fixture occurrences: 10unimplemented!() for hash mismatch: 1--object-hash CLI flag matches: 0Dual-hash test hooks already exist in justfile for at least:
gix-filtergix-commitgraphgix-objectgix-packgix-refspecgix-hashgix-commitgraph
Evidence: issue marked it complete, crate depends on gix-hash with sha1 and sha256, and justfile runs it with GIX_TEST_FIXTURE_HASH=sha1 and sha256.gix/src/config/tree/sections/extensions.rs
extensions.objectFormat still only accepts sha1 and explicitly says SHA256 is not fully implemented.gix-protocol/src/fetch/refmap/init.rs
object-format capability parsing still rejects anything except sha1.gix/src/config/cache/incubate.rs
repository object hash still falls back to SHA1 when config does not say otherwise.gix/src/clone/fetch/mod.rs
clone still aborts on remote hash mismatch instead of configuring repo state.gix-hash
Remove remaining SHA1/SHA256-shaped helper APIs where Kind-based forms can replace them.gitoxide CLI surface
Decide whether to restore a flag like --object-hash or bless config-only selection and document it clearly.gix-refspec
Keep object-hash-looking refspec parsing honest under SHA256-heavy inputs.gix
Teach extensions.objectFormat config parsing to accept sha256.gix-object
Keep object parsers hash-length aware and extend tests around non-SHA1 trees and related decode paths.gix-ref
Expand refs and reflog read/write coverage to both hash lengths.gix-index
Extend checksum and extension tests to SHA256-sized object ids.gix-transport
Add negotiation fixtures that advertise object-format=sha256.gix-protocol
Accept and preserve SHA256 object-format negotiation end to end.gix-odb
Strengthen loose/packed lookup and prefix behavior under SHA256.gix-pack
Finish pack data, index, multi-index, and verification assumptions that still lean on SHA1-shaped fixtures or sentinels.gix
Replace clone hash-mismatch unimplemented!() with real repo initialization/configuration.gix-diff
Remove SHA1-only sentinel assumptions where caller hash kind should drive impossible ids.gix-blame
Same sentinel cleanup where SHA1 null ids are only placeholders.Kind::Sha1.null() occurrences one by one and separate acceptable sentinels from real SHA1 assumptions.--object-hash is still required as CLI UX, or whether config plus API is enough.extensions.objectFormat=sha256 parse successfully.object-format=sha256.unimplemented!() for remote hash mismatch.object-format=sha256.