summaryrefslogtreecommitdiff
path: root/git-hotspots
diff options
context:
space:
mode:
Diffstat (limited to 'git-hotspots')
-rwxr-xr-xgit-hotspots17
1 files changed, 17 insertions, 0 deletions
diff --git a/git-hotspots b/git-hotspots
new file mode 100755
index 0000000..a18ce61
--- /dev/null
+++ b/git-hotspots
@@ -0,0 +1,17 @@
+#!/bin/bash
+# https://docs.mergestat.com/blog/2023/01/03/finding-code-hotspots-in-git-repos
+#
+# Finds hotspots as the files most frequently modified (by number of commits).
+
+set -euo pipefail
+
+main() {
+ git log --format=format: --name-only --since=12.month "$@" |
+ grep -vE '^$' |
+ sort |
+ uniq -c |
+ sort -nr |
+ head -50
+}
+
+main "$@"