Skip to content

Instantly share code, notes, and snippets.

@lukerandall
Last active December 6, 2024 16:40
Show Gist options
  • Save lukerandall/a30ff82008bdc4a314e10a78939f685e to your computer and use it in GitHub Desktop.
Save lukerandall/a30ff82008bdc4a314e10a78939f685e to your computer and use it in GitHub Desktop.
Make browsing the evolog easier with fzf
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