Created
October 9, 2020 18:12
-
-
Save hovissimo/91e83a6358a88d476aba71c3792a0f92 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#! /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