From 6eb3d1baf51ffe13236f604fb4b51f13f7ec145f Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 22 Jan 2024 15:39:50 +0100 Subject: [PATCH] rc tools git: fix regression hiding blame in large files Sorry I did not test my earlier patch in production. It passes blame flags via the environment. On a 5000 line file this results in "execve failed: Argument list too long" errors. Use a different way of checking whether blame info is shown. --- rc/tools/git.kak | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/rc/tools/git.kak b/rc/tools/git.kak index 253ab845..fea1d4c0 100644 --- a/rc/tools/git.kak +++ b/rc/tools/git.kak @@ -159,14 +159,16 @@ define-command -params 1.. \ } run_git_blame() { - if [ "${kak_opt_git_blame_flags#* *}" != "${kak_opt_git_blame_flags}" ]; then - hide_blame - exit - fi + echo >${kak_command_fifo} "try %{ + add-highlighter window/git-blame flag-lines Information git_blame_flags + echo -to-file ${kak_response_fifo} + } catch %{ + echo -to-file ${kak_response_fifo} 'hide_blame; exit' + }" + eval $(cat ${kak_response_fifo}) ( cd_bufdir printf %s "evaluate-commands -client '$kak_client' %{ - try %{ add-highlighter window/git-blame flag-lines Information git_blame_flags } set-option buffer=$kak_bufname git_blame_flags '$kak_timestamp' }" | kak -p ${kak_session} git blame "$@" --incremental ${kak_buffile} | perl -wne '