diff --git a/bin/git-churn b/bin/git-churn index a44f20a..61ab588 100755 --- a/bin/git-churn +++ b/bin/git-churn @@ -1,10 +1,8 @@ -#!/bin/bash +#!/bin/sh # -# Written by Corey Haines -# Scriptified by Gary Bernhardt +# List files with commit count. # -# Put this anywhere on your $PATH (~/bin is recommended). Then git will see it -# and you'll be able to do `git churn`. +# Based on: https://github.com/garybernhardt/dotfiles/blob/main/bin/git-churn # # Show churn for whole repo: # $ git churn @@ -16,8 +14,16 @@ # $ git churn --since='1 month ago' # # (These are all standard arguments to `git log`.) - -set -e -git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort -n | awk 'BEGIN {print "count\tfile"} {print $1 "\t" $2}' - +# +exec git log --all \ + --find-copies \ + --find-renames \ + --name-only \ + --format='format:' \ + "$@" \ + | sort \ + | grep -v '^$' \ + | uniq -c \ + | sort -n \ + | awk 'BEGIN {print "count\tfile"} {print $1 "\t" $2}' diff --git a/bin/git-new b/bin/git-new index 405da55..693b935 100755 --- a/bin/git-new +++ b/bin/git-new @@ -1,7 +1,9 @@ #!/bin/sh - +# # Initialize a git repository and automatically create an empty root commit. -# NOTE: requires the `l` alias to be defined (see .gitconfig) - -git init && git commit --allow-empty -m "Initial commit" && git l +# +set -e +git init +git commit --allow-empty -m "Initial commit" +git log --graph --pretty='%C(auto)%h%d %s %C(8) %ad'