Last active
December 6, 2024 16:40
-
-
Save lukerandall/a30ff82008bdc4a314e10a78939f685e to your computer and use it in GitHub Desktop.
Make browsing the evolog easier with fzf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function grepsha | |
grep -oE "\b[0-9a-f]{7,}\b" | |
end | |
function jjevo | |
set rev $argv[1] | |
if test -z "$rev" | |
set rev "@" | |
end | |
jj evolog --no-graph --template="builtin_log_oneline" -r $rev | | |
fzf --preview 'echo {} | grepsha | head -n 1 | xargs jj show --git | bat --language=diff --style=plain --paging=always --wrap=never --color=always' \ | |
--bind "enter:execute(echo {} | grepsha | head -n 1 | tr -d '\n' | pbcopy)+abort" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment