From b9c23f3d68c907c2e9fb2c372ccdc22ea2813486 Mon Sep 17 00:00:00 2001 From: samedamci Date: Tue, 31 Aug 2021 12:22:27 +0200 Subject: [PATCH] Add files command --- guzzy/commands/files.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 guzzy/commands/files.sh diff --git a/guzzy/commands/files.sh b/guzzy/commands/files.sh new file mode 100755 index 0000000..dba7d44 --- /dev/null +++ b/guzzy/commands/files.sh @@ -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%