summary refs log tree commit diff
path: root/bin/fzfez
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2023-01-07 19:02:31 +0100
committerRobert Günzler <r@gnzler.io>2023-01-07 19:02:31 +0100
commitc3c3645ab8452a21ac757dd6b5d9c28701edb014 (patch)
treea2e7abb4985de8a8fee2bec3b9a0a350d2e2cb1a /bin/fzfez
parent0f334e28819e3590aa07e7ec0fb614b50989555c (diff)
bin: use git-switch for changing branches on fzfez git-branches
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to '')
-rwxr-xr-xbin/fzfez9
1 files 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)