Sort PR commits in chronological order #12838

Open
opened 2025-11-02 10:22:31 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @jtran on GitHub (Apr 12, 2024).

Feature Description

Gitea currently displays commits of a PR in reverse chronological order, that is, latest first, both during compare before a PR is created and on the Commits tab after creation. This is the reverse of GitHub, and I find it to be confusing. Commits appear in the conversations tab in chronological order, so it's different between the two tabs. I think it would be simpler if they were the same. Obviously, everyone may have a different preference, but I think we should both be consistent and follow GitHub unless there's a good reason not to.

Note, this is different from looking at a repo's history, where commits are sorted with latest commits first, because the repo's entire history is a large set of commits. When looking there, people generally aren't reading through the entire history of commits, only the most recent commits.

On the other hand, a PR's set of commits is much smaller. People can read through them top to bottom. And for many long-running branches, the first few commits tend to be the important parts, while later commits are updating with merge commits or minor tweaks from review feedback. Obviously, every PR is going to be different, but I think the above is a common pattern.

Screenshots

Screenshot 2024-04-12 at 4 02 00 PM Screenshot 2024-04-12 at 4 09 34 PM
Originally created by @jtran on GitHub (Apr 12, 2024). ### Feature Description Gitea currently displays commits of a PR in reverse chronological order, that is, latest first, both during compare before a PR is created and on the Commits tab after creation. This is the reverse of GitHub, and I find it to be confusing. Commits appear in the conversations tab in chronological order, so it's different between the two tabs. I think it would be simpler if they were the same. Obviously, everyone may have a different preference, but I think we should both be consistent and follow GitHub unless there's a good reason not to. Note, this is different from looking at a repo's history, where commits are sorted with latest commits first, because the repo's entire history is a large set of commits. When looking there, people generally aren't reading through the entire history of commits, only the most recent commits. On the other hand, a PR's set of commits is much smaller. People can read through them top to bottom. And for many long-running branches, the first few commits tend to be the important parts, while later commits are updating with merge commits or minor tweaks from review feedback. Obviously, every PR is going to be different, but I think the above is a common pattern. ### Screenshots <img width="1392" alt="Screenshot 2024-04-12 at 4 02 00 PM" src="https://github.com/go-gitea/gitea/assets/10803/8041792f-f9b7-4676-89bf-0690ffeda878"> <img width="1392" alt="Screenshot 2024-04-12 at 4 09 34 PM" src="https://github.com/go-gitea/gitea/assets/10803/15e169fb-805d-45ab-93f2-38bbec0afe4a">
GiteaMirror added the proposal/acceptedtype/proposal labels 2025-11-02 10:22:31 -06:00
Author
Owner

@silverwind commented on GitHub (Apr 13, 2024):

I absolutely agree, all commit lists in PRs should sort oldest first.

@silverwind commented on GitHub (Apr 13, 2024): I absolutely agree, all commit lists in PRs should sort oldest first.
Author
Owner

@zokkis commented on GitHub (Apr 14, 2024):

I would disagree, I like to see the latest on top
So maybe set a config or a option to sort which is stored in the cookie

@zokkis commented on GitHub (Apr 14, 2024): I would disagree, I like to see the latest on top So maybe set a config or a option to sort which is stored in the cookie
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12838