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 |