Skip to content

Handle future commit datetimes in the future without panicking #1306

@MalteT

Description

@MalteT

Duplicates

  • I have searched the existing issues

Current behavior 😯

If the commit time is in the future, onefetch crashes.

Expected behavior 🤔

It should possibly handle the case or fail gracefully. The crash report blames this on me, but my system time is okay and I don't have much influence over my colleague's system time.

Steps to reproduce 🕹

Have the most recent git commit in the future and run onefetch

Additional context/Screenshots 🔦

name = "onefetch"
operating_system = "NixOS 24.5.0 [64-bit]"
crate_version = "2.20.0"
explanation = """
Panic occurred in file 'src/info/utils/mod.rs' at line 35
"""
cause = "Achievement unlocked: time travel! Check your system clock and commit dates."
method = "Panic"
backtrace = """

   0: 0x56049cc6bb63 - core::option::expect_failed::hcbf5a9b7e22cab9f
   1: 0x56049cc93285 - onefetch::info::utils::format_time::he784b32eb1d439c7
   2: 0x56049ccec879 - onefetch::info::InfoBuilder::last_change::h5aac04e9a53655fa
   3: 0x56049ccea471 - onefetch::info::build_info::h6232c8d9e8572b77
   4: 0x56049cc7dded - onefetch::main::hfc8e895e84fac4d0
   5: 0x56049cc85363 - std::sys_common::backtrace::__rust_begin_short_backtrace::he043df6535079d0d
   6: 0x56049cc86c9d - std::rt::lang_start::{{closure}}::h5f878ceb72151ea0
   7: 0x56049d5883d4 - std::panicking::try::h45c8379f4866ecc7
   8: 0x56049d581eb5 - std::rt::lang_start_internal::hf358ddc7f05da9a0
   9: 0x56049cc7e5f5 - main
  10: 0x7f25f061c0ce - __libc_start_call_main
  11: 0x7f25f061c189 - __libc_start_main@GLIBC_2.2.5
  12: 0x56049cc6be25 - _start
  13:        0x0 - <unresolved>"""

Possible Solution 💡

No response

Thanks for your awesome work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions