I was reading the latest edition of Kevin Ottens’ excellent weekly web review and one particular article caught my eye: “The Git Commands I Run Before Reading Any Code“. In a nutshell, you can use the git version control tool to quickly assess a project’s health, what breaks, who’s a key figure, how bad emergencies are, and so on.
So useful!
I immediately wanted to apply this to KDE projects. So I took the commands from the post and made some shell aliases and functions for convenience:
# git repo analysis toolsalias what-changes="echo 'What changes a lot?' && git log --format=format: --name-only --since='1 year ago' | rg -v 'po$|json$|desktop$' | sort | uniq -c | sort -nr | head -20"alias what-breaks="echo 'What breaks a lot?' && git log -i -E --grep='fix|bug|broke|bad|wrong|incorrect|problem' --name-only --format='' | sort | uniq -c | sort -nr | head -20"alias emergencies="echo 'And what were the emergencies?' && git log --oneline --since='1 year ago' | grep -iE 'revert|hotfix|emergency|urgent|rollback'"alias momentum="echo \"What's the project's momentum over the past 5 years?\" && git log --format='%ad' --date=format:'%Y-%m' | sort | uniq -c | tail -n 60"alias maintainers-recently="echo \"Who's been driving this project in the past year?\" && git shortlog -sn --no-merges --since='1 year ago' | rg -v 'l10n daemon script' | head -n 30"alias maintainers-alltime="echo 'And what about for all time?' && git shortlog -sn --no-merges | rg -v 'l10n daemon script' | head -n 30"function repo-analysis { what-changes echo what-breaks echo emergencies echo momentum echo maintainers-recently echo maintainers-alltime}
Now let’s run it on Plasma. Here’s plasma-workspace, the core of Plasma:
$ git clone ssh://git@invent.kde.org/plasma/plasma-workspace.git
$ cd plasma-workspace
$ repo-analysis
What changes a lot?
ย ย 1519 ย
ย ย ย ย 38 CMakeLists.txt
ย ย ย ย 29 shell/shellcorona.cpp
ย ย ย ย 24 runners/services/servicerunner.cpp
ย ย ย ย 21 wallpapers/image/imagepackage/contents/ui/config.qml
ย ย ย ย 19 libnotificationmanager/notifications.cpp
ย ย ย ย 18 shell/org.kde.plasmashell.desktop.cmake
ย ย ย ย 18 devicenotifications/devicenotifications.cpp
ย ย ย ย 17 kcms/lookandfeel/kcm.cpp
ย ย ย ย 16 wallpapers/image/plugin/model/packagelistmodel.cpp
ย ย ย ย 16 kcms/cursortheme/xcursor/xcursor.knsrc
ย ย ย ย 15 wallpapers/image/plugin/model/imagelistmodel.cpp
ย ย ย ย 15 applets/notifications/global/Globals.qml
ย ย ย ย 15 applets/devicenotifier/devicecontrol.cpp
ย ย ย ย 14 wallpapers/image/plugin/imagebackend.cpp
ย ย ย ย 14 shell/panelview.cpp
ย ย ย ย 14 .kde-ci.yml
ย ย ย ย 14 applets/systemtray/systemtray.cpp
ย ย ย ย 13 runners/services/autotests/servicerunnertest.cpp
ย ย ย ย 12 krunner/qml/RunCommand.qml
What breaks a lot?
ย ย ย 225 shell/shellcorona.cpp
ย ย ย 183 shell/panelview.cpp
ย ย ย ย 83 CMakeLists.txt
ย ย ย ย 74 applets/systemtray/package/contents/ui/main.qml
ย ย ย ย 71 applets/digital-clock/package/contents/ui/DigitalClock.qml
ย ย ย ย 63 klipper/klipper.cpp
ย ย ย ย 62 applets/notifications/package/contents/ui/NotificationItem.qml
ย ย ย ย 58 wallpapers/image/imagepackage/contents/ui/config.qml
ย ย ย ย 56 shell/desktopview.cpp
ย ย ย ย 56 libtaskmanager/tasksmodel.cpp
ย ย ย ย 54 shell/main.cpp
ย ย ย ย 54 applets/systemtray/systemtray.cpp
ย ย ย ย 53 shell/shellcorona.h
ย ย ย ย 52 krunner/view.cpp
ย ย ย ย 48 applets/digital-clock/package/contents/ui/CalendarView.qml
ย ย ย ย 47 runners/services/servicerunner.cpp
ย ย ย ย 46 wallpapers/image/imagepackage/contents/ui/main.qml
ย ย ย ย 45 applets/notifications/package/contents/ui/NotificationPopup.qml
ย ย ย ย 44 applets/systemtray/package/contents/ui/ExpandedRepresentation.qml
ย ย ย ย 43 startkde/startplasma.cpp
And what were the emergencies?
4f526a7bd1 Revert “applets/systemtray: Prevent popups from overlapping with the panel”
dca5788fee lookandfeel/components: Revert Plasma::setupPlasmaStyle
2c0fd34541 Revert “ContainmentLayoutManager: send recursive mouse release events too”
b6b230f4ff Revert “Read selenium-webdriver-at-spi-run location from CMake”
b8651b56f6 hotfix: Remove doc translations without actual doc
1f43f576e8 Revert “Add forceImageAnimation property to force animated image play”
f0349b6c81 hotfix: remove stray .po file
3ff7ae4269 Revert “CI: enable parallel testing”
83bebc7896 Revert “Limit evaluateScript execution at 2 seconds”
4f45f672be Revert “kcms/componentchooser: Don’t offer NoDisplay services”
3bf0ff8f56 Revert “Disable linux-qt6-next while the regression in Qt gets fixed”
80996f0633 Revert “kcms/wallpaper: set roleNames for WallpaperConfigModel”
What’s the project’s momentum over the past 5 years?
ย ย ย 148 2021-05
ย ย ย ย 87 2021-06
ย ย ย ย 62 2021-07
ย ย ย ย 85 2021-08
ย ย ย 121 2021-09
ย ย ย 106 2021-10
ย ย ย 146 2021-11
ย ย ย 190 2021-12
ย ย ย 191 2022-01
ย ย ย ย 84 2022-02
ย ย ย 168 2022-03
ย ย ย 130 2022-04
ย ย ย 146 2022-05
ย ย ย 141 2022-06
ย ย ย 136 2022-07
ย ย ย 107 2022-08
ย ย ย 232 2022-09
ย ย ย 234 2022-10
ย ย ย 181 2022-11
ย ย ย 150 2022-12
ย ย ย 154 2023-01
ย ย ย 161 2023-02
ย ย ย 156 2023-03
ย ย ย 156 2023-04
ย ย ย 163 2023-05
ย ย ย 137 2023-06
ย ย ย 186 2023-07
ย ย ย 190 2023-08
ย ย ย 275 2023-09
ย ย ย 226 2023-10
ย ย ย 283 2023-11
ย ย ย 157 2023-12
ย ย ย 131 2024-01
ย ย ย 147 2024-02
ย ย ย 249 2024-03
ย ย ย 180 2024-04
ย ย ย 188 2024-05
ย ย ย 158 2024-06
ย ย ย 128 2024-07
ย ย ย 146 2024-08
ย ย ย 169 2024-09
ย ย ย 156 2024-10
ย ย ย 116 2024-11
ย ย ย ย 98 2024-12
ย ย ย 145 2025-01
ย ย ย 126 2025-02
ย ย ย 120 2025-03
ย ย ย 116 2025-04
ย ย ย 131 2025-05
ย ย ย 131 2025-06
ย ย ย 132 2025-07
ย ย ย 115 2025-08
ย ย ย 110 2025-09
ย ย ย ย 97 2025-10
ย ย ย 147 2025-11
ย ย ย 114 2025-12
ย ย ย 140 2026-01
ย ย ย 131 2026-02
ย ย ย 119 2026-03
ย ย ย ย 44 2026-04
Who’s been driving this project in the past year?
ย ย 116 ย Vlad Zahorodnii
ย ย 113 ย Nicolas Fella
ย ย ย 87 ย Christoph Wolk
ย ย ย 82 ย Fushan Wen
ย ย ย 78 ย Nate Graham
ย ย ย 66 ย Kai Uwe Broulik
ย ย ย 48 ย Bohdan Onofriichuk
ย ย ย 37 ย Harald Sitter
ย ย ย 34 ย Tobias Fella
ย ย ย 31 ย Marco Martin
ย ย ย 30 ย David Edmundson
ย ย ย 25 ย Akseli Lahtinen
ย ย ย 21 ย Ismael Asensio
ย ย ย 17 ย David Redondo
ย ย ย 16 ย Niccolรฒ Venerandi
ย ย ย 15 ย Bhushan Shah
ย ย ย 11 ย Alexander Lohnau
ย ย ย 11 ย Kristen McWilliam
ย ย ย ย 9 ย Oliver Beard
ย ย ย ย 9 ย Shubham Arora
ย ย ย ย 8 ย Alexey Rochev
ย ย ย ย 8 ย Han Young
ย ย ย ย 8 ย Philipp Kiemle
ย ย ย ย 7 ย Albert Astals Cid
ย ย ย ย 6 ย Aleix Pol
ย ย ย ย 6 ย Mรฉven Car
ย ย ย ย 5 ย Devin Lin
ย ย ย ย 5 ย Joshua Goins
ย ย ย ย 4 ย Alexander Wilms
ย ย ย ย 4 ย Arjen Hiemstra
And what about for all time?
ย 1543 ย Fushan Wen
ย 1497 ย Marco Martin
ย 1374 ย Kai Uwe Broulik
ย 1030 ย David Edmundson
ย ย 772 ย Nate Graham
ย ย 658 ย Alexander Lohnau
ย ย 551 ย Aleix Pol
ย ย 548 ย Nicolas Fella
ย ย 438 ย ivan tkachenko
ย ย 385 ย Eike Hein
ย ย 264 ย Sebastian Kรผgler
ย ย 250 ย Martin Grรครlin
ย ย 238 ย Harald Sitter
ย ย 232 ย Martin Klapetek
ย ย 223 ย Jonathan Riddell
ย ย 207 ย Vlad Zahorodnii
ย ย 194 ย David Redondo
ย ย 190 ย Friedrich W. H. Kossebau
ย ย 189 ย Laurent Montel
ย ย 144 ย Bhushan Shah
ย ย 134 ย Christoph Wolk
ย ย 134 ย Ismael Asensio
ย ย 126 ย Lukรกลก Tinkl
ย ย 121 ย Niccolรฒ Venerandi
ย ย 117 ย Mรฉven Car
ย ย 105 ย Natalie Clarius
ย ย ย 91 ย Konrad Materka
ย ย ย 80 ย Vishesh Handa
ย ย ย 80 ย Volker Krause
ย ย ย 79 ย Ivan ฤukiฤ
ShellCorona both changing and breaking a lot is no great surprise to me; it’s fiddly and complicated. We need to do something about that. The number of emergencies doesn’t look too bad, and momentum feels fine too. The project also appears to have a nice healthy diversity of contributors. Excellent!
It’s been quite illuminating to run these tools on KDE projects that I’m both more and less familiar with. Give it a try!







