dotfiles/modules/common/shell/fish/functions/git-history.fish

15 lines
409 B
Fish
Raw Permalink Normal View History

2022-04-30 14:21:43 +00:00
if not count $argv >/dev/null
echo "Must provide filename."
return 1
2021-04-10 21:08:54 +00:00
end
2022-04-30 14:21:43 +00:00
set commitline ( git log \
--follow \
--pretty="format:%C(auto)%ar %h%d %s" \
-- ./$argv \
| fzf \
--height 100% \
--preview "git diff --color=always (echo {} | cut -d' ' -f4)^1..(echo {} | cut -d' ' -f4) -- ./$argv" \
)
and set commit (echo $commitline | cut -d" " -f4)
and echo $commit