Skip to content

Instantly share code, notes, and snippets.

@ascii-soup
ascii-soup / recentbranches.plugin.zsh
Created March 12, 2013 11:01
Quick zsh completer for recent branches
_recentbranches_completion() {
compadd -V $(git reflog | grep -Pi "checkout: moving from " | awk -F"moving from" '{ print $2 }' | awk -F'to' '{ print $1 }' | sed 's/ //g' | grep -Piv '[a-f0-9]{40}')
}
compdef _recentbranches_completion gitr