-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Group commit list page by date #34098
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
Group commit list page by date #34098
Conversation
To be honest, I like the old UI.
Although the new UI follows GitHub, it seems too loose and less informative.
What are the benefits of introducing the new UI?
I can see what you mean for repos that only you yourself contribute to:
I mean, how many commits can you commit in a day? 1? 2?
But precisely for repos with a large number of contributors and commits like Gitea, this feature is absolutely useful:
It helps you distinguish where in the timeline you currently are, and also on what date you are (if you go a few pages down the list).
At the moment, this somewhat crucial information for the commit list is "hidden" behind a (mostly) relative tooltip like a month ago
.
I can see what you mean for repos that only you yourself contribute to:
I never meant that.
But precisely for repos with a large number of contributors and commits like Gitea, this feature is absolutely useful:
It helps you distinguish where in the timeline you currently are, and also on what date you are (if you go a few pages down the list).
The old list is pretty clear, and contains all information.
Why end users need to "distinguish where in the timeline you currently are" by the unit of "day"?
At the moment, this somewhat crucial information for the commit list is "hidden" behind a (mostly) relative tooltip like
a month ago
.
Then we just need to change it to the absolute time, or set PREFERRED_TIMESTAMP_TENSE
in app.ini
From another perspective, there are so many pending proposals and bug reports, till now, I do not see any single user said that they need the "grouped commit list".
I think you only need to update the frontend and keep the backend as it is. There’s no need to group commits on the backend.
Why end users need to "distinguish where in the timeline you currently are" by the unit of "day"?
Something I've noticed doing myself is the following:
From time to time, I watch over what happened in vim/vim
since I last looked at the repo for a quick overview of changes to expect.
When the currently looked at date is publicly displayed, it's much easier to know the last time you've looked at the repo.
Alternatively, consider any fork that wants to see what changed upstream since the last cherry-pick.
When you know the day of the last cherry-pick, it becomes much easier to find the diff of commits visually.
(And yes, I am aware of the contextual irony in this argument. I haven't found a way to phrase it without triggering that association. )
58371f7
to
b29d401
Compare
I like the design with the timeline and icons from first screenshot better, it matches the issue/pr view.
Hi, I like the first proposed change. It's follows GitHub/GitLab style.
Without this separation, it's harder to control which new commits have appeared since the previous review.
The new order is also easier to read, because the most important data is in front of your eyes and the commit SHA is secondary information.
@delvh I use the date separation for a similar reason where as a packager of software for various OSes I need to catch up on what's changed, as well it helps me verify some things for changelogs on projects that don't use milestones (or use PRs for changes).
I like the design with the timeline and icons from first screenshot better, it matches the issue/pr view.
If most people like GitHub style, feel free to ignore my comment for the old style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still the question, it seems that "wiki" is still using the repo/commits_list
, why not unify them to the new layout? Is there any strong reason that wiki must have a different layout?
routers/web/repo/commit.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this algorithm is right, or maybe it is right but it needs some tests.
For example:
- commit1 is at "2025-04-10T08:00:00+08:00"
- commit2 is at "2025-04-09T23:00:00-01:00"
Actually they are the same timestamp (1744243200), and the day depends on visitor's timezone.
- When visitor's timezone is
UTC
, time is2025年04月10日T00:00:00Z
, on local day "2025-04-10" - When visitor's timezone is
-04:00
, time is2025年04月09日T20:00:00-04:00
, on local day "2025-04-09"
ps: I have no idea how GitHub handles such timezone problem then renders the "date" to end users. Just FYI.
Or maybe some tests could help to clarify the expected behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now switched to using UTC for grouping, and corresponding test cases have also been added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it confuse users if they are not in UTC timezone?
For example: if you are in UTC+8, and when you open GitHub's commit list page at:
- 2025年04月02日 23:00 UTC+8: see "2025-04-02" ?
- 2025年04月03日 01:00 UTC+8: see "2025-04-03" ?
But if you always use UTC to group, the user in UTC+8 will see "2025-04-02" at "2025-04-03 01:00 UTC+8"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grouping should be based on the local timezone of the user, but this is challenging to communicate to the backend because there is no HTTP header that communicates user timezone.
Maybe we need to render a flat list and have JS then perform the grouping? Any idea how GitHub does it (assuming they do it in backend)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another edge case: git commit's date could be manually set.
So you could see a commit list like this:
commit4 2025年04月10日
commit3 2025年04月01日
commit2 2025年04月30日
commit1 2025年04月15日
And the graph is commit1->commit2->commit3->commit4.
What's the expected output for such commit list? It needs some tests to clarify the behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The to be discussed here is which time field to use. Currently, the list uses the committer's time both before and after grouping. If adjustment is needed, we can make modifications later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't mean "which field". I mean "how to group them", assume these dates are all from the "committer's time"
commit4, committer date: 2025年04月10日
commit3, committer date: 2025年04月01日
commit2, committer date: 2025年04月30日
commit1, committer date: 2025年04月15日
What's the expected output?
Or to be more precise
commit4, committer date: 2025年04月10日 09:00
commit3, committer date: 2025年04月01日 08:00
commit2, committer date: 2025年04月10日 07:00
commit1, committer date: 2025年04月01日 06:00
What's the expected output?
Co-authored-by: metiftikci <metiftikci@hotmail.com>
image