Skip to content

Conversation

Dexterte
Copy link

@Dexterte Dexterte commented Sep 1, 2024

Fixes #11812

Proposed changes

  • It changed the commit date format in commit lists from YYYY-MM-DD HH:MM:SS to YYYY-MM-DD HH:MM.

Screenshots

Before

スクリーンショット 2024-09-01 202240

After

スクリーンショット 2024-09-01 203256

Test methodology

  • manual

Test environment(s)

  • GIT
  • Windows

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

@Dexterte Dexterte changed the title chore: remove seconds from commit date display (#11812) Remove seconds from commit date display (#11812) Sep 1, 2024
@mstv mstv added the 📜 status: needs cla The author needs to update contributors.txt before reviewing or merging can proceed label Sep 1, 2024
Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

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

+2

Although it is just one changed char, we need your sign-off in contributors.txt, please.

@gerhardol
Copy link
Member

0 I probably prefer the seconds in the grid, but will not vote against this (seconds is still in CommitInfo).

@pmiossec
Copy link
Member

pmiossec commented Sep 1, 2024

Personally, I'm not really pleased by this change. On day to day work, I don't need dates and so I hide the column to make more room for other information. But the few times where I show the column, it's to compare dates of different commits and here the seconds are the most important data.

Not really blocking because it is rare and maybe I will find another way to achieve the same thing.

@RussKie
Copy link
Member

RussKie commented Sep 2, 2024 via email

@gerhardol
Copy link
Member

Since there's a discontent, perhaps it's worth making it configurable...

No, there are too many configurables already, hard to find
(even if I personally appreciate them)

@RussKie
Copy link
Member

RussKie commented Sep 2, 2024 via email

@pmiossec
Copy link
Member

pmiossec commented Sep 3, 2024

But overall I'm indifferent to this change.

I personally have difficulties to see the consequences of this change and if users will never noticed. Or if we won't have issues created reclaiming to display the seconds, later...
My feeling is that it's a personal preference and I think it's a little strange as a commit date contains seconds to "process" this data to display only a subset only to "save space" (described in #11812 ).
On the other end, it seems that some other git GUI is doing it. So maybe not that important... and user has less to read.

This can be a hidden config.

If we want to cut the discussion and merge the change, maybe it's the best solution.

If so, I don't know which is the best in this case?

  1. true/false setting DisplaySecondsInGrid
  2. string setting CustomDateFormatInGrid where user configure it's custom format

Still interested by this answer even if we don't add one new setting because I had this dilemma multiple times for other settings...

@gerhardol
Copy link
Member

Hidden config for the format string?
Suggest default is the same to avoid the usual anger: Why was this changed?

@pmiossec
Copy link
Member

pmiossec commented Sep 3, 2024

Also the line 18

int initialWidth = AppSettings.RelativeDate ? DpiUtil.Scale(130) : TextRenderer.MeasureText(DateTime.Now.ToString("G"), AppSettings.Font).Width;
should be using the same formatting (and looking at the screenshots, probably due to locale, the times doesn't format as mine

image

so maybe we should not use DateTime.Now but an hardcoded carefully chosen value with double digit hours, minutes and seconds).

So something looking like:

_customDateFormatInGrid = AppSettings.CustomDateFormatInGrid ?? "G";
int initialWidth = AppSettings.RelativeDate ? DpiUtil.Scale(130) : TextRenderer.MeasureText(new DateTime(2000, 12, 12, 11, 11, 11).ToString(_customDateFormatInGrid), AppSettings.Font).Width;

@RussKie
Copy link
Member

RussKie commented Sep 3, 2024

Given the discussion we're already having, I don't think this change is worth the risk and associated complexities, especially since the workaround is easy - make the column narrower to hide the seconds (see #11812 (comment)).
I vote to reject the change.

@Dexterte
Copy link
Author

Dexterte commented Sep 8, 2024

Based on the discussion, I don’t think I should change this. Can I close the pull request?

@gerhardol
Copy link
Member

Based on the discussion, I don’t think I should change this. Can I close the pull request?

Yes
It is hard to change something that already exists...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📜 status: needs cla The author needs to update contributors.txt before reviewing or merging can proceed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove seconds in the timestamp in the commit lists
5 participants