Skip to content

Instantly share code, notes, and snippets.

@dnd
Forked from gabro/git-working-history
Last active January 4, 2016 06:49
Show Gist options
  • Save dnd/8584255 to your computer and use it in GitHub Desktop.
Save dnd/8584255 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 --date=short --pretty=format:"%C(green)%cd%Creset" $f)
str2=$(git log -1 --decorate --pretty=format:"%C(cyan)%h%Creset %s %C(yellow)(%cn)%Creset" $f)
printf "%-${MAXLEN}s %s %s\n" "$f" "$str" "$str2"
done
@dnd
Copy link
Author

dnd commented Jan 23, 2014

Shortened the output to make it a little more compact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment