From e2917305c959106ab01018b4c768505fb2f655ac Mon Sep 17 00:00:00 2001 From: Anton Bobov Date: Tue, 5 Mar 2024 22:18:49 +0500 Subject: Updates --- git-hotspots | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 git-hotspots (limited to 'git-hotspots') 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 "$@" -- cgit v1.2.3