Skip to content

Instantly share code, notes, and snippets.

@LBRapid
Created May 5, 2015 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LBRapid/34d331f5688b5332816c to your computer and use it in GitHub Desktop.
Save LBRapid/34d331f5688b5332816c to your computer and use it in GitHub Desktop.
# fshow - git commit browser
fshow() {
local out sha q
while out=$(
git log --decorate=short --graph --oneline --color=always |
fzf --ansi --multi --no-sort --reverse --query="$q" --print-query); do
q=$(head -1 <<< "$out")
while read sha; do
[ -n "$sha" ] && git show --color=always $sha | less -R
done < <(sed '1d;s/^[^a-z0-9]*//;/^$/d' <<< "$out" | awk '{print $1}')
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment