Created
March 12, 2013 11:01
-
-
Save ascii-soup/5142012 to your computer and use it in GitHub Desktop.
Quick zsh completer for recent branches
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment