Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct git report datetimes #458

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix: correct git report datetimes #458

wants to merge 1 commit into from

Conversation

miki725
Copy link
Contributor

@miki725 miki725 commented Dec 10, 2024

Issue

In some cases commit dates show as in the future.

Description

When git reports its timestamp, its localized with the provided offset and as chalk wasnt accounting for that, in some cases, commit timestamps would show up as future timestamps which is very confusing

Now all timestamps are normalized with the provided offset.

In addition all date reporting was changed to use consistent output format of ISO-8601.

Testing

➜ make tests args="test_git.py -x --logs --pdb"

Base automatically changed from bases to main December 10, 2024 18:35
@miki725 miki725 force-pushed the git branch 2 times, most recently from d3c3b11 to 78eeadd Compare December 11, 2024 15:56
@miki725 miki725 changed the title fix: parsing git timestamp offsets fix: correct git report datetimes Dec 11, 2024
@miki725 miki725 marked this pull request as ready for review December 11, 2024 16:01
@miki725 miki725 requested a review from viega as a code owner December 11, 2024 16:01
When git reports its timestamp, its localized with the provided offset
and as chalk wasnt accounting for that, in some cases, commit timestamps
would show up as future timestamps which is very confusing

Now all timestamps are normalized with the provided offset.

In addition all date reporting was changed to use consistent output
format of ISO-8601.
Comment on lines -270 to +262
result.setIfNeeded("DATETIME_WHEN_CHALKED", pack(getDateTime()))
result.setIfNeeded("DATE_CHALKED", startTime.utc.format(timesDateFormat))
result.setIfNeeded("TIME_CHALKED", startTime.utc.format(timesTimeFormat))
result.setIfNeeded("TZ_OFFSET_WHEN_CHALKED", startTime.utc.format(timesTzFormat))
result.setIfNeeded("DATETIME_WHEN_CHALKED", startTime.utc.format(timesIso8601Format))
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

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.

2 participants