Skip to content

Instantly share code, notes, and snippets.

@hovissimo
Created October 9, 2020 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hovissimo/91e83a6358a88d476aba71c3792a0f92 to your computer and use it in GitHub Desktop.
Save hovissimo/91e83a6358a88d476aba71c3792a0f92 to your computer and use it in GitHub Desktop.
#! /bin/zsh
fancy_git_pickaxe() {
# -S$1 -- pickaxe the first argument to the function
# "${@:2}" -- pass the remaining arguments along
git log -S$1 "${@:2}" \
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" \
--color=always |
# from https://gist.github.com/junegunn/f4fca918e937e6bf5bad
fzf --ansi --no-sort --reverse --tiebreak=index --bind=ctrl-s:toggle-sort \
--bind "ctrl-m:execute:
(grep -o '[a-f0-9]\{7\}' | head -1 |
xargs -I % sh -c 'git show --color=always % | less -R') << 'FZF-EOF
{}
FZF-EOF"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment