shell/+fzf: better formatting for fzf-git-* candidates
This commit is contained in:
parent
36104366aa
commit
254e46436c
|
@ -1,8 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
git log --graph --color=always \
|
git log --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" |
|
||||||
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" |
|
fzf --ansi --no-sort --tiebreak=index --bind=ctrl-s:toggle-sort \
|
||||||
gui-fzf --ansi --no-sort --tiebreak=index --bind=ctrl-s:toggle-sort \
|
|
||||||
--bind "ctrl-m:execute:
|
--bind "ctrl-m:execute:
|
||||||
(grep -o '[a-f0-9]\{7\}' | head -1 |
|
(grep -o '[a-f0-9]\{7\}' | head -1 |
|
||||||
xargs -I % sh -c 'git show --color=always % | less -R') << 'FZF-EOF'
|
xargs -I % sh -c 'git show --color=always % | less -R') << 'FZF-EOF'
|
||||||
|
|
|
@ -6,6 +6,6 @@
|
||||||
# + git checkout `fzf-git-sha`
|
# + git checkout `fzf-git-sha`
|
||||||
# + git commit --fixup `fzf-git-sha`
|
# + git commit --fixup `fzf-git-sha`
|
||||||
|
|
||||||
commits=$(git log --color=always --pretty=oneline --abbrev-commit --reverse) &&
|
commits=$(git log --color=always --abbrev-commit --reverse --format="%C(auto)%h%d %s %C(black)%C(bold)%cr") &&
|
||||||
commit=$(echo "$commits" | fzf --tac +s +m -e --ansi --reverse) &&
|
commit=$(echo "$commits" | gui-fzf --tac +s +m -e --ansi) &&
|
||||||
echo -n $(echo "$commit" | sed "s/ .*//")
|
echo -n $(echo "$commit" | sed "s/ .*//")
|
||||||
|
|
Loading…
Reference in a new issue