Skip to content

Instantly share code, notes, and snippets.

@kubek2k
Created March 23, 2013 21:37
Show Gist options
  • Save kubek2k/5229457 to your computer and use it in GitHub Desktop.
Save kubek2k/5229457 to your computer and use it in GitHub Desktop.
Show git tree everytime we change something (so the screen is not blinking) - its a good way of showing how git is actually working
#!/bin/bash
get_last_change() {
find .git -type f -exec stat -f "%m %N" {} \; | sort -nr | head -1 | awk '{print $1}'
}
while [ true ]; do
LAST_CHANGE=`get_last_change`
clear
GIT_PAGER="cat" git log --format=oneline --abbrev-commit --decorate --graph --all
while [ true ]; do
ANOTHER_CHANGE=`get_last_change`
if [ "$LAST_CHANGE" != "$ANOTHER_CHANGE" ]; then
break
fi
sleep 2
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment