Skip to content

Instantly share code, notes, and snippets.

@timcharper
Created December 11, 2009 23:12
Show Gist options
  • Save timcharper/254592 to your computer and use it in GitHub Desktop.
Save timcharper/254592 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ -z "$1" ]; then
echo "Usage: $0 <commit> <branch>"
echo " branch is optimal and defaults to current"
exit 1
fi
what_ref=$1
branch=$(git symbolic-ref HEAD | sed 's|refs/heads/||')
git reflog show $branch@{now} | while read ref rest; do
if [ -z "$(git rev-list -1 $ref..$what_ref)" ]; then
printf "[x] "
else
printf "[ ] "
fi
echo $ref $rest
done | less -R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment