Skip to content

Instantly share code, notes, and snippets.

@ssoriche
Forked from gabro/git-working-history
Created March 26, 2014 13:38
Show Gist options
  • Save ssoriche/9783325 to your computer and use it in GitHub Desktop.
Save ssoriche/9783325 to your computer and use it in GitHub Desktop.
#!/bin/bash
FILES=`git ls-tree --name-only HEAD .`
MAXLEN=0
for f in $FILES; do
if [ ${#f} -gt $MAXLEN ]; then
MAXLEN=${#f}
fi
done
for f in $FILES; do
str=$(git log -1 --decorate --pretty=format:"%C(green)%cr%Creset" $f)
str2=$(git log -1 --decorate --pretty=format:"%C(cyan)%h%Creset %s %C(yellow)(%cn)%Creset" $f)
printf "%-${MAXLEN}s -- %s \t %s\n" "$f" "$str" "$str2"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment