Skip to content

gix-error conversion batch 1 (part 1)#2423

Merged
Sebastian Thiel (Byron) merged 4 commits intomainfrom
gix-error
Feb 22, 2026
Merged

gix-error conversion batch 1 (part 1)#2423
Sebastian Thiel (Byron) merged 4 commits intomainfrom
gix-error

Conversation

@Byron
Copy link
Copy Markdown
Member

@Byron Sebastian Thiel (Byron) commented Feb 7, 2026

Crates done

  • 1 gix-bitmap # feat!: gix-error instead of thiserror in gix-bitmap
  • 2 gix-quote # feat!: gix-error instead of thiserror in gix-quote
  • 3 gix-mailmap # feat!: gix-error instead of thiserror in gix-mailmap
Batch 1 Migration Complete

11 crates migrated from thiserror to gix-error, in 11 commits:
┌────────────────┬───────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────────────────┐
│     Crate      │                 Error types replaced                  │                            Downstream fixes                             │
├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
│ gix-bitmap     │ 1 (ewah::decode::Error)                               │ none                                                                    │
├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
│ gix-quote      │ 1 (ansi_c::undo::Error)                               │ none                                                                    │
├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
│ gix-mailmap    │ 1 (parse::Error)                                      │ none                                                                    │
├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
│ gix-fs         │ 1 (to_normal_path_components::Error)                  │ none                                                                    │
├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
│ gix-lock       │ 1 (acquire::Error)                                    │ gix-testtools                                                           │
├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
│ gix-path       │ 2 (relative_path::Error, realpath::Error)             │ gix-ref                                                                 │
├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
│ gix-packetline │ 3 (encode::Error, decode::Error, decode::band::Error) │ none                                                                    │
├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
│ gix-attributes │ 2 (name::Error, parse::Error)                         │ gix-pathspec                                                            │
├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
│ gix-url        │ 3 (parse::Error, UrlParseError, expand_path::Error)   │ gix-transport, gix                                                      │
├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
│ gix-hash       │ 7 (all error types)                                   │ gix-object, gix-pack, gix-odb, gix-index, gix-status, gix-protocol, gix │
├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
│ gix-features   │ 3 (DecompressError, CompressError, inflate::Error)    │ (included in gix-hash downstream)                                       │
└────────────────┴───────────────────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────────┘
Verification: cargo check -p gix passes, all 21 test suites across the 11 crates pass with 0 failures.

Tasks

  • fixup commits with correct authorship
  • thorough review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates 11 plumbing crates from thiserror to gix-error, implementing the project's error handling standardization strategy. The migration replaces enum-based error types with gix_error::Exn and uses message-based error construction for better composability and reduced boilerplate.

Changes:

  • Replaces thiserror enums with gix_error::Exn<gix_error::Message> or gix_error::ValidationError
  • Updates error construction to use message!() and raise() patterns
  • Adjusts downstream crates to handle new error types via .into_error() conversions
  • Replaces deprecated #[allow(missing_docs)] with #[expect(missing_docs)] throughout

Reviewed changes

Copilot reviewed 299 out of 349 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
gix-bitmap/src/ewah.rs Converts EWAH decode error from thiserror enum to gix-error ValidationError
gix-quote/src/ansi_c.rs Replaces ansi_c undo error enum with Exn
gix-mailmap/src/parse.rs Converts mailmap parse errors to ValidationError
gix-fs/src/stack.rs Updates path component error to ValidationError
gix-lock/src/acquire.rs Migrates lock acquisition errors to Exn
gix-path/src/relative_path.rs Converts RelativePath error to Exn
gix-path/src/realpath.rs Replaces realpath error enum with Exn
gix-packetline/* Converts encode/decode errors to gix-error types
gix-attributes/src/parse.rs Migrates attribute parse errors to Exn
gix-url/src/expand_path.rs Converts expand_path error to Exn
gix-hash/src/* Replaces all hash-related errors with gix-error types
gix-features/src/zlib/* Converts compression/decompression errors to Exn
gix/* Updates downstream consumers to handle new error types

This allows to more conveniently create validation errors.
@Byron Sebastian Thiel (Byron) force-pushed the gix-error branch 3 times, most recently from 348f983 to 1cfb707 Compare February 18, 2026 03:36
Replace the thiserror-derived `ewah::decode::Error` enum with
`gix_error::Exn<gix_error::ValidationError>`, using `ok_or_raise()` for
Option-based error creation.

Co-Authored-By: Sebastian Thiel <sebastian.thiel@icloud.com>
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Replace the thiserror-derived `ansi_c::undo::Error` enum with
`gix_error::Exn<gix_error::ValidationError>`, converting the `Error::new()`
factory and variant constructors to `message!()` calls.

Co-Authored-By: Sebastian Thiel <sebastian.thiel@icloud.com>
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Replace the thiserror-derived `parse::Error` enum with
`gix_error::Exn<gix_error::ValidationError>`. Tests converted from
variant pattern matching to string-based assertions.

Co-Authored-By: Sebastian Thiel <sebastian.thiel@icloud.com>
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
@Byron Sebastian Thiel (Byron) marked this pull request as ready for review February 22, 2026 14:37
@Byron Sebastian Thiel (Byron) merged commit 000d58a into main Feb 22, 2026
30 checks passed
@Byron Sebastian Thiel (Byron) changed the title gix-error conversion batch 1 gix-error conversion batch 1 (part 1) Feb 22, 2026
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.

3 participants