this post was submitted on 09 Apr 2026
121 points (97.6% liked)

Programming

26473 readers
493 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
top 6 comments
sorted by: hot top controversial new old
[–] Kissaki@programming.dev 2 points 8 hours ago* (last edited 7 hours ago)

They're bash/shell- and bin-dependent commands rather than Git commands. I use Nushell.
Transformed to Nushell commands:

  • The 20 most-changed files in the last year:
    git log --format=format: --name-only --since="1 year ago" | lines | str trim | where (is-not-empty) | uniq --count | sort-by count --reverse | take 20
  • Who Built This:
    git shortlog -sn --no-merges
    git shortlog -sn --no-merges --since="6 months ago"
  • Where Do Bugs Cluster:
    git log -i -E --grep="fix|bug|broken" --name-only --format='' | lines | str trim | where (is-not-empty) | uniq --count | sort-by count --reverse | take 20
  • Is This Project Accelerating or Dying:
    git log --format='%ad' --date=format:'%Y-%m' | lines | str trim | where (is-not-empty) | uniq --count
  • How Often Is the Team Firefighting:
    git log --oneline --since="1 year ago" | find --ignore-case --regex 'revert|hotfix|emergency|rollback'

/edit: Looks like the lines have whitespace or sth. Replaced lines --skip-empty with lines | str trim | where (is-not-empty).

command aliases

def "gits most-changed-files" [] { git log --format=format: --name-only --since="1 year ago" | lines | str trim | where (is-not-empty) | uniq --count | sort-by count --reverse | take 20 }
def "gits who" [] { git shortlog -sn --no-merges }
def "gits who6m" [] { git shortlog -sn --no-merges --since="6 months ago" }
def "gits fixes" [] { git log -i -E --grep="fix|bug|broken" --name-only --format='' | lines | str trim | where (is-not-empty) | uniq --count | sort-by count --reverse | take 20 }
def "gits aliveness" [] { git log --format='%ad' --date=format:'%Y-%m' | lines | str trim | where (is-not-empty) | uniq --count }
def "gits firefighting" [] { git log --oneline --since="1 year ago" | find --ignore-case --regex 'revert|hotfix|emergency|rollback' }

[–] 87Six@lemmy.zip 8 points 1 day ago

This would have no effect in my team where everyone does whatever they want in git lol

[–] aivoton@sopuli.xyz 0 points 1 day ago

Ahh the famous git commands such as sort, uniq, head, and grep.

[–] pageflight@piefed.social 22 points 2 days ago (1 children)

Gonna have to try that out. I think it would have told interesting stories on some past repos.

I wish ''co-authored by AI' was easy to flag in vcs.

[–] olafurp@lemmy.world 2 points 19 hours ago

This is going into my bashrc as a mini cli. I'm pretty sure I'm going to want to run this every time I change jobs.

[–] xSikes@feddit.online 8 points 2 days ago