From 254e46436c638a95fcb35c4a7a3333893de413cf Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 15 May 2017 20:41:20 +0200 Subject: [PATCH] shell/+fzf: better formatting for fzf-git-* candidates --- shell/+fzf/bin/fzf-git-log | 11 +++++------ shell/+fzf/bin/fzf-git-sha | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/shell/+fzf/bin/fzf-git-log b/shell/+fzf/bin/fzf-git-log index 8c2ac2c3..72a467de 100755 --- a/shell/+fzf/bin/fzf-git-log +++ b/shell/+fzf/bin/fzf-git-log @@ -1,10 +1,9 @@ #!/usr/bin/env bash -git log --graph --color=always \ - --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" | -gui-fzf --ansi --no-sort --tiebreak=index --bind=ctrl-s:toggle-sort \ +git log --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" | +fzf --ansi --no-sort --tiebreak=index --bind=ctrl-s:toggle-sort \ --bind "ctrl-m:execute: - (grep -o '[a-f0-9]\{7\}' | head -1 | - xargs -I % sh -c 'git show --color=always % | less -R') << 'FZF-EOF' - {} + (grep -o '[a-f0-9]\{7\}' | head -1 | + xargs -I % sh -c 'git show --color=always % | less -R') << 'FZF-EOF' + {} FZF-EOF" diff --git a/shell/+fzf/bin/fzf-git-sha b/shell/+fzf/bin/fzf-git-sha index f3b547d1..2ea8c7a1 100755 --- a/shell/+fzf/bin/fzf-git-sha +++ b/shell/+fzf/bin/fzf-git-sha @@ -6,6 +6,6 @@ # + git checkout `fzf-git-sha` # + git commit --fixup `fzf-git-sha` -commits=$(git log --color=always --pretty=oneline --abbrev-commit --reverse) && - commit=$(echo "$commits" | fzf --tac +s +m -e --ansi --reverse) && +commits=$(git log --color=always --abbrev-commit --reverse --format="%C(auto)%h%d %s %C(black)%C(bold)%cr") && + commit=$(echo "$commits" | gui-fzf --tac +s +m -e --ansi) && echo -n $(echo "$commit" | sed "s/ .*//")