date: support GNU-compatible out-of-range years and formatting parity#10931
date: support GNU-compatible out-of-range years and formatting parity#10931abhishekpradhan wants to merge 10 commits intouutils:mainfrom
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
|
some conflicts |
4d2eee6 to
f33e4bb
Compare
|
GNU testsuite comparison: |
|
This branch is now rebased onto current I also fixed the remaining extended-format regressions for large years:
Local |
|
GNU testsuite comparison: |
|
This is now pinned to the upstream |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
This is too large to be reviewed
Having a quick look here, it isn't ready - too much duplication (Extended vs ExtendedInZone branches), some various issues, etc Given it seems that you use codex, you should prompt it to do better work in term of modification sizes, code duplication, etc thanks |
|
Of course, thanks for the feedback here. I’ll split into several PR’s and work on the quality here. |
|
GNU testsuite comparison: |
Summary
This addresses #9774:
date -drejects GNU-valid out-of-range years (for example18978-01-01) because the normal parser/runtime path stops at the in-range datetime boundary.parse_datetime::ParsedDateTime::{InRange, Extended}in thedate -dflow-u, local TZ output, explicit input offsets, and far-future IANA rule lookups-uoutput and-uconversion for both fixed-offset and mapped IANA cases%Q,%q,%r,%c,%U,%W,%V,%G, and%guutils date(notably%QandE/Omodifiers), preserve currentuutilsbehavior rather than expanding scope in this PRtouch -dwithout panictouch -dDependency
parse_datetimeto the upstream0.15.0git tagdeny.tomlandfuzz/Cargo.lockto keep CI green with the temporary git dependencyparse_datetime 0.15.0is published thereRelated issues
datebug this PR fixesE/Omodifier support, intentionally left out of scope hereReviewer guide
src/uu/date/src/date.rs: parse branching, extended formatting, timezone/output conversionsrc/uu/touch/src/touch.rs: extendedtouch -dpathtests/by-util/test_date.rsandtests/by-util/test_touch.rs: regression coverageTesting
cargo fmt --all -- --checkcargo check -p uu_date -p uu_touchcargo test -p uu_date --lib -qcargo test -p uu_touch --lib -qcargo clippy -p uu_date --all-features --all-targets -- -D warningscd fuzz && cargo fetch --lockedcargo test -q --test tests test_date::test_large_year_with_explicit_offset_converts_to_output_timezone -- --nocapturecargo test -q --test tests test_date::test_large_year_supports_r_and_c_formats -- --nocapturecargo test -q --test tests test_date::test_large_year_iana_timezone_rule_uses_dst_in_far_future -- --nocapturecargo test -q --test tests test_date::test_large_year_week_format_specifiers -- --nocapturecargo test -q --test tests test_date::test_large_year_supports_existing_q_format_in_local_timezone -- --nocapturecargo test -q --test tests test_date::test_large_year_preserves_existing_eo_literal_behavior -- --nocapturecargo test -q --test tests test_date::test_large_year_timezone_abbreviations -- --nocapturecargo test -q --test tests test_date::test_large_year_timezone_abbreviations_match_in_range_behavior -- --nocapturecargo test -q --test tests test_touch::test_touch_large_year_date_does_not_panic -- --nocapture