gitui
gitui copied to clipboard
fix sorting of commits in diff view
Commits were sorted by time in diff view. That's wrong as some people like to commit in the future or past. To see the fix just compare my commit to one before by selecting both and pressing SHIFT+C.
This Pull Request fixes/closes #{issue_num}.
It changes the following:
- diff view is correct now
I followed the checklist:
- ( ) I added unittests
- [x] I ran
make checkwithout errors - [x] I tested the overall application
- [x] I tested my changes
- [x] I added an appropriate item to the changelog
don't know how to write tests for my changes
@extrawurst this is ready for review
4 long months, he waits...
@Joshix-1 the problem with this change is that it is right in the hotpath for giant repos like linux. can you benchmark the differences with and without your change?
How and what can I benchmark?
Shouldn't it improve performance as commits aren't unneccessarily sorted by date in most cases?
check the log for this line (after the commits are all collected in the log tab):
13:47:30 [TRACE] (4) scopetime: [scopetime/src/lib.rs:41] scopetime: 2360 ms [asyncgit::revlog::async::revlog] @asyncgit/src/revlog.rs:176 (after opening kubernetes repo)
13:57:42 [TRACE] (4) scopetime: [scopetime/src/lib.rs:41] scopetime: 26058 ms [asyncgit::revlog::async::revlog] @asyncgit/src/revlog.rs:176 (after opening linux repo)
and please update to current master to get ready to merge
my gitui is in ~/code/gitui i built it with cargo build --features=timing --release
I freshly cloned both repos at their current master, without --filter
Linux:
this pr:
~/code/linux master $ ~/code/gitui/target/release//gitui -l ; grep asyncgit::revlog::async::revlog ~/.cache/gitui/gitui.log
Logging enabled. log written to: "/home/josh/.cache/gitui/gitui.log"
17:39:51 [TRACE] (3) scopetime: [scopetime/src/lib.rs:41] scopetime: 35821 ms [asyncgit::revlog::async::revlog] @asyncgit/src/revlog.rs:176
~/code/linux master $ rm ~/.cache/gitui/gitui.log && ~/code/gitui/target/release//gitui -l && grep asyncgit::revlog::async::revlog ~/.cache/gitui/gitui.log
Logging enabled. log written to: "/home/josh/.cache/gitui/gitui.log"
17:41:54 [TRACE] (4) scopetime: [scopetime/src/lib.rs:41] scopetime: 37788 ms [asyncgit::revlog::async::revlog] @asyncgit/src/revlog.rs:176
current master
~/code/linux master $ rm ~/.cache/gitui/gitui.log && ~/code/gitui/target/release//gitui -l && grep asyncgit::revlog::async::revlog ~/.cache/gitui/gitui.log
Logging enabled. log written to: "/home/josh/.cache/gitui/gitui.log"
17:55:57 [TRACE] (4) scopetime: [scopetime/src/lib.rs:41] scopetime: 41685 ms [asyncgit::revlog::async::revlog] @asyncgit/src/revlog.rs:142
~/code/linux master $ rm ~/.cache/gitui/gitui.log && ~/code/gitui/target/release//gitui -l && grep asyncgit::revlog::async::revlog ~/.cache/gitui/gitui.log
Logging enabled. log written to: "/home/josh/.cache/gitui/gitui.log"
17:56:54 [TRACE] (4) scopetime: [scopetime/src/lib.rs:41] scopetime: 43782 ms [asyncgit::revlog::async::revlog] @asyncgit/src/revlog.rs:142
Kubernetes
this pr
~/code/kubernetes master $ rm ~/.cache/gitui/gitui.log && ~/code/gitui/target/release//gitui -l && grep asyncgit::revlog::async::revlog ~/.cache/gitui/gitui.log
Logging enabled. log written to: "/home/josh/.cache/gitui/gitui.log"
17:47:54 [TRACE] (4) scopetime: [scopetime/src/lib.rs:41] scopetime: 2382 ms [asyncgit::revlog::async::revlog] @asyncgit/src/revlog.rs:176
~/code/kubernetes master $ rm ~/.cache/gitui/gitui.log && ~/code/gitui/target/release//gitui -l && grep asyncgit::revlog::async::revlog ~/.cache/gitui/gitui.log
Logging enabled. log written to: "/home/josh/.cache/gitui/gitui.log"
17:48:38 [TRACE] (3) scopetime: [scopetime/src/lib.rs:41] scopetime: 2364 ms [asyncgit::revlog::async::revlog] @asyncgit/src/revlog.rs:176
current master
~/code/kubernetes master $ rm ~/.cache/gitui/gitui.log && ~/code/gitui/target/release//gitui -l && grep asyncgit::revlog::async::revlog ~/.cache/gitui/gitui.log
Logging enabled. log written to: "/home/josh/.cache/gitui/gitui.log"
17:53:30 [TRACE] (4) scopetime: [scopetime/src/lib.rs:41] scopetime: 2640 ms [asyncgit::revlog::async::revlog] @asyncgit/src/revlog.rs:142
~/code/kubernetes master $ rm ~/.cache/gitui/gitui.log && ~/code/gitui/target/release//gitui -l && grep asyncgit::revlog::async::revlog ~/.cache/gitui/gitui.log
Logging enabled. log written to: "/home/josh/.cache/gitui/gitui.log"
17:53:38 [TRACE] (4) scopetime: [scopetime/src/lib.rs:41] scopetime: 2378 ms [asyncgit::revlog::async::revlog] @asyncgit/src/revlog.rs:142
@Joshix-1 thanks, lgtm!