commit dc9f493ccfd55561424305a41d54713fea6da548 parent 504e658a7b223c0c78d95f21b4dbde65a8b90591 Author: mtmn <miro@haravara.org> Date: Fri, 1 May 2026 17:33:21 +0200 dotfiles: gbf shows branches by recency Diffstat:
| M | modules/mixins/dotfiles/config/shell/rc/git | | | 14 | +++++++++----- |
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/modules/mixins/dotfiles/config/shell/rc/git b/modules/mixins/dotfiles/config/shell/rc/git @@ -104,11 +104,15 @@ glf() { gbf() { branch=$( - git branch --all | grep -v HEAD | sed 's/^[* ]*//' | sed 's/remotes\///' | sort -u | tac | fzf \ - --height=40% \ - --reverse \ - --preview 'git log --oneline --color=always {1} 2>/dev/null | head -20' \ - --preview-window=right:50% + git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads refs/remotes | + grep -v HEAD | + sed 's|^origin/||' | + awk '!seen[$0]++' | + fzf \ + --height=40% \ + --reverse \ + --preview 'git log --oneline --color=always {1} 2>/dev/null | head -20' \ + --preview-window=right:50% ) [ -n "$branch" ] && git switch "${branch#origin/}" }