zsh:glog: Fix some non-local variables
This commit is contained in:
@@ -51,19 +51,19 @@ local date="$dateshort %T %z" # year time timezone
|
|||||||
|
|
||||||
# Use git's pager in the preview window (and with it any special highlighting
|
# Use git's pager in the preview window (and with it any special highlighting
|
||||||
# tool, such as diff-so-fancy)
|
# tool, such as diff-so-fancy)
|
||||||
local pager
|
local pager="$(git config --get --default="" core.pager)"
|
||||||
pager="$(git config --get --default="" core.pager)"
|
local into_pager="${pager:+|} $pager"
|
||||||
into_pager="${pager:+|} $pager"
|
|
||||||
|
|
||||||
# NOTE: use read for a bit better readability of the code since less needs
|
# NOTE: use read for a bit better readability of the code since less needs
|
||||||
# quoting and formatting is easier
|
# quoting and formatting is easier
|
||||||
|
local get_hash_cmd show_cmd
|
||||||
read -r -d '' get_hash_cmd <<EOT
|
read -r -d '' get_hash_cmd <<EOT
|
||||||
hash="\$(echo -E {} | sed -E "$commit_hash")"; [[ -z "\$hash" ]] ||
|
hash="\$(echo -E {} | sed -E "$commit_hash")"; [[ -z "\$hash" ]] ||
|
||||||
EOT
|
EOT
|
||||||
read -r -d '' show_cmd <<EOT
|
read -r -d '' show_cmd <<EOT
|
||||||
git show "$format" "$date" --color=always --patch-with-stat "\$hash"
|
git show "$format" "$date" --color=always --patch-with-stat "\$hash"
|
||||||
EOT
|
EOT
|
||||||
show_stat_cmd="${show_cmd/patch-with-}"
|
local show_stat_cmd="${show_cmd/patch-with-}"
|
||||||
|
|
||||||
local -A fzf_preview
|
local -A fzf_preview
|
||||||
fzf_preview[patch]="$get_hash_cmd $show_cmd $into_pager"
|
fzf_preview[patch]="$get_hash_cmd $show_cmd $into_pager"
|
||||||
|
|||||||
Reference in New Issue
Block a user