Comment

Comment by bastardoperator

I used the examples they provided on the repo README. I would still argue I can get the same results with less typing.

  git shortlog -sn | sort -r | head -n 10
If I run the 2nd command example against the chromium repo, it takes several minutes where a shell script using git for-each-ref takes about 8 seconds. I would also argue that this might be better expressed as commit_count <= 10 but I realize you're also using an example. This is the script I ran:

  git for-each-ref --format='%(refname:short)' refs/heads/ | while read branch; do
    commit_count=$(git rev-list --count $branch)
    [ "$commit_count" -le 10 ] && echo "Branch: $branch, Commit Count: $commit_count"
  done

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton