UPSTREAM PR #2423: gix-error conversion batch 1#20
Conversation
Replace the thiserror-derived `ewah::decode::Error` enum with `gix_error::Exn<gix_error::Message>`, using `ok_or_raise()` for Option-based error creation. Co-Authored-By: Sebastian Thiel <[email protected]>
Replace the thiserror-derived `ansi_c::undo::Error` enum with `gix_error::Exn<gix_error::Message>`, converting the `Error::new()` factory and variant constructors to `message!()` calls. Co-Authored-By: Sebastian Thiel <[email protected]>
Replace the thiserror-derived `parse::Error` enum with `gix_error::Exn<gix_error::Message>`. Tests converted from variant pattern matching to string-based assertions. Co-Authored-By: Sebastian Thiel <[email protected]>
Replace the thiserror-derived `to_normal_path_components::Error` enum with `gix_error::Exn<gix_error::Message>`. Co-Authored-By: Sebastian Thiel <[email protected]>
Replace the thiserror-derived `acquire::Error` enum with `gix_error::Exn<gix_error::Message>`. The manually-implemented `commit::Error<T>` is unchanged. Also fix gix-testtools for the new error type. Co-Authored-By: Sebastian Thiel <[email protected]>
Replace the thiserror-derived `relative_path::Error` and `realpath::Error` enums with `gix_error::Exn<gix_error::Message>`. Also fix downstream gix-ref for the changed error type. Co-Authored-By: Sebastian Thiel <[email protected]>
Replace the thiserror-derived `encode::Error`, `decode::Error`, and `decode::band::Error` enums with `gix_error::Exn<gix_error::Message>`. The manually-implemented `read::Error` is unchanged. Co-Authored-By: Sebastian Thiel <[email protected]>
Replace the thiserror-derived `name::Error` struct and `parse::Error` enum with `gix_error::Exn<gix_error::Message>`. Also fix downstream gix-pathspec for the removed `attribute` field. Co-Authored-By: Sebastian Thiel <[email protected]>
Replace the thiserror-derived `parse::Error`, `simple_url::UrlParseError`, and `expand_path::Error` enums with `gix_error::Exn<gix_error::Message>`. Also fix downstream gix-transport and gix for the changed error types. Co-Authored-By: Sebastian Thiel <[email protected]>
Replace all 7 thiserror-derived error types (io::Error, oid::Error, prefix::Error, prefix::from_hex::Error, decode::Error, hasher::Error, verify::Error) with `gix_error::Exn<gix_error::Message>`. Also fix downstream crates for the changed error types: gix-object, gix-pack, gix-odb, gix-index, gix-status, gix-protocol, gix. Co-Authored-By: Sebastian Thiel <[email protected]>
Replace the thiserror-derived `DecompressError`, `CompressError`, and `inflate::Error` enums with `gix_error::Exn<gix_error::Message>`. The dependency is conditional on the `zlib` feature. Co-Authored-By: Sebastian Thiel <[email protected]>
- cargo fmt - cargo clippy Fix all downstream compilation and clippy issues caused by Batch 1 crates changing error types from thiserror enums to Exn<Message>: - Add From<Infallible> for Exn<Message> in gix-error - Fix test files that use ? into Box<dyn Error> with .into_error() - Fix clippy redundant_closure_for_method_calls warnings - Fix gitoxide-core and porcelain code for changed error types - Add gix-error dev-dependencies where needed Co-authored-by: Claude <[email protected]>
OverviewThis analysis evaluates a systematic error handling migration from Binaries analyzed:
The migration introduces measurable regressions in configuration access and error formatting paths, while preserving performance in hot paths (object access, pack operations, parallel processing). Function AnalysisConfiguration Access (ein binary):
All three functions bottleneck at ~1ms response time, indicating a common downstream issue in section lookup or value parsing. Path Operations (ein binary):
These functions show improved self-execution but dramatically worse response times with unchanged source code, suggesting static analysis measurement artifacts rather than genuine regressions. Error Handling (gix binary):
I/O Operations (gix binary):
Iterator Performance (gix binary):
Positive Changes:
Other analyzed functions showed expected overhead in error destructors and trait implementations, or minimal changes in parallel dispatch logic. Additional FindingsThe migration represents an intentional architectural trade-off: accepting performance costs in cold paths (error display, configuration access) for improved error diagnostics with automatic call-site tracking, error trees, and reduced binary bloat. The ein binary's configuration access bottleneck (~1ms per call) represents the most significant performance concern warranting investigation. Standard library I/O regressions appear to stem from Rust toolchain differences rather than gitoxide changes, with existing buffering strategies providing effective mitigation. No GPU/ML operations were identified; gitoxide operates entirely in CPU and I/O domains. 🔎 Full breakdown: Loci Inspector. |
4805387 to
853b34d
Compare
dccca45 to
24496b3
Compare
f045646 to
e746ced
Compare
3a9c4ae to
a28c634
Compare
3deba97 to
9b41e5f
Compare
95ef755 to
a9e7940
Compare
8b02847 to
1bf0519
Compare
cdbe120 to
78a7ab5
Compare
49231d8 to
bc0a777
Compare
e902b63 to
c6739bc
Compare
Note
Source pull request: GitoxideLabs/gitoxide#2423
Tasks