m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-20 09:33:42 -05:00

fshow with --multi

Junegunn Choi
2015-03-23 02:15:49 +09:00
parent a2e435e1fc
commit 0425f644c6

@@ -133,15 +133,16 @@ fco() {
``` ```
```sh ```sh
# fshow - git show commit # fshow - git commit browser
fshow() { fshow() {
local sha q local out sha q
while sha=$( while out=$(
git log --decorate=full --graph --oneline --color=always | git log --decorate=full --graph --oneline --color=always |
fzf --ansi --no-multi --no-sort --reverse --query="$q" --print-query); do fzf --ansi --multi --no-sort --reverse --query="$q" --print-query); do
q=$(head -1 <<< "$sha") q=$(head -1 <<< "$out")
sha=$(sed '1d;s/^[^a-z0-9]*//;/^$/d' <<< "$sha" | awk '{print $1}') while read sha; do
[ -n "$sha" ] && git show --color=always $sha | less -R [ -n "$sha" ] && git show --color=always $sha | less -R
done < <(sed '1d;s/^[^a-z0-9]*//;/^$/d' <<< "$out" | awk '{print $1}')
done done
} }
``` ```