Add files command

This commit is contained in:
samedamci 2021-08-31 12:22:27 +02:00
parent 17d5888ac8
commit b9c23f3d68
No known key found for this signature in database
GPG Key ID: FCB4A9A20D00E894

12
guzzy/commands/files.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
[ "$1" ] && commit_hash="$1" || commit_hash="HEAD"
commit="git --no-pager show -q $commit_hash"
limiter="-------------------------------------------------"
file_content="git show $commit_hash:{}"
git ls-tree -r --name-only "$commit_hash" |
fzf --ansi --preview "$commit && echo $limiter && $file_content" \
--preview-window=right:70%