Add file-history command

This commit is contained in:
samedamci 2021-08-31 14:03:53 +02:00
parent c4b8140948
commit 143d13972c
No known key found for this signature in database
GPG Key ID: FCB4A9A20D00E894

7
guzzy/commands/file-history.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
file_name="$1"
git log --color=always --format="%C(auto)%h %s" "$file_name" |
fzf --ansi --preview \
"git diff --color=always {1}~ {1} -- $file_name 2>/dev/null || echo ..."