last-modified support
Summary 💡
As documented in https://github.blog/open-source/git/highlights-from-git-2-52/ , the new git last-modified command efficiently walks commits to determine the last modification to each file in a tree.
Motivation 🔦
This would help for operations like displaying a directory with the most recent commit that modifies it (as various Git UIs and forges do). It's also useful for importing/exporting a git tree into some other context that wants an mtime for every file.
Thanks a lot for making me aware of this :)!
The history of the feature is interesting, having powered GitHub overviews for a while, and I am already looking forward to dealing with yet another cache format when that lands to allow incremental runs to not repeat all work of prior runs.
It's notable that ein t query already has this feature built in indirectly, as it caches metadata with each commit to make accessing it faster. With it one can query all commits that touched a given path in order of the original graph walk, which could probably also be extended to provide git last-modified like output in an alternative query.
Extending ein t query is definitely an option, with the benefit that the incremental, cached operation would then be built in.
`ein t query trace-path` example
❯ ein t query trace-path README.md
05:02:34 traverse commit graph done 1.0K commits in 0.01s (82.6K commits/s)
05:02:34 extract stats done 1.0K commits in 0.05s (20.4K commits/s)
05:02:34 find changes done 4.9K modified files in 0.05s (100.2K modified files/s)
05:02:34 find changes done 67.7K diff lines in 0.05s (1.4M diff lines/s)
05:02:34 db cache done 1.0K events in 0.05s (18.8K events/s)
05:02:34 run sql query done 1.0 round in 0.00s (1.4K round/s)
+++-- | 2025-11-18 | f07ebe1ab Δ README.md
+ | 2025-11-17 | ecde413b6 Δ README.md
++ | 2025-08-06 | e64ac3330 Δ README.md
+ | 2023-03-29 | 47a9753fa Δ README.md
+ | 2022-01-24 | 80a0aca20 Δ README.md
+ | 2022-01-25 | 37f72c29d Δ README.md
+ | 2022-01-24 | 394f11f59 Δ README.md
+ | 2022-01-19 | 4da8e9f18 Δ README.md
+ | 2021-10-22 | 00c6f156a Δ README.md
+ | 2021-10-20 | b60ccde63 Δ README.md
+ | 2021-10-19 | 0cbceee0f Δ README.md
+ | 2021-10-16 | eaca66c77 Δ README.md
+ | 2021-10-15 | e6a975fef Δ README.md
+++-- | 2021-10-15 | 76b7e1c20 Δ README.md
+++++++-- | 2021-10-15 | 1e160ba1f Δ README.md
+ | 2021-10-03 | b99774c44 Δ README.md
+ | 2021-08-27 | 40000346b Δ README.md
+ | 2021-08-24 | b4d3317e2 Δ README.md
+ | 2021-08-15 | 844960f07 Δ README.md
+ | 2021-08-13 | a1eca1dfc Δ README.md
+ | 2021-08-13 | 79613c0c2 Δ README.md
++- | 2021-08-13 | db48d23ef Δ README.md
+ | 2021-08-13 | cf2138ff9 Δ README.md
| 2021-08-13 | 283c6f100 Δ README.md
+ | 2021-08-13 | 56eb63363 Δ README.md
+ | 2021-08-13 | 2ad38b9d5 Δ README.md
+ | 2021-08-13 | ece1d055f Δ README.md
+ | 2021-08-12 | c3982a7ce Δ README.md
++++++++++| 2021-08-12 | 5534a5c24 + README.md