From c3c3645ab8452a21ac757dd6b5d9c28701edb014 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Sat, 7 Jan 2023 19:02:31 +0100 Subject: bin: use git-switch for changing branches on fzfez git-branches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert Günzler --- bin/fzfez | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/fzfez b/bin/fzfez index 4db1516..0e8db62 100755 --- a/bin/fzfez +++ b/bin/fzfez @@ -83,14 +83,15 @@ _batpreview) # highlights the line matching the query, usage: _batpreview FILENA git-branches) git rev-parse HEAD >/dev/null 2>&1 || exit 1 git branch -a --format='%(refname)' | - cut -d' ' -f1 | + grep -v 'remote' | + cut -d'/' -f3 | sort | - env FZFEZ_HEADER='BRANCHES: c-o (checkout)' \ + env FZFEZ_HEADER='BRANCHES: c-o (switch)' \ $0 \ --ansi --no-sort --tac \ - --preview 'git log --color=always --oneline --graph --date=short {} | head -${LINES}' \ + --preview 'git log --color=always --oneline --graph --date=short ..{} && echo && git diff --color=always --stat {}' \ --preview-window "${windowstyle},right:70%" \ - --bind "ctrl-o:execute(git checkout {} && git status)+abort" + --bind "ctrl-o:execute(git switch {})+abort" ;; git-tags) -- cgit 1.4.1