From daaa32104fcbafdecd2f6eec15975dca3b7cc665 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 23 Mar 2025 15:59:58 +0100 Subject: rc git: throw an error when diffutils is not installed Some of our git wrappers use the diff utility; if it's not installed we'll hang because no one is opening the fifo for reading. For example, this happens when running chmod -x $(which diff) && kak -e "edit README.asciidoc; git apply" Fail earlier, I guess -- although it's probably fine as-is. --- rc/tools/git.kak | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rc') diff --git a/rc/tools/git.kak b/rc/tools/git.kak index b5cbb778..b4be1973 100644 --- a/rc/tools/git.kak +++ b/rc/tools/git.kak @@ -195,6 +195,9 @@ define-command -params 1.. \ } diff_buffer_against_rev() { + if ! command -v diff >/dev/null; then + echo >${kak_command_fifo} "fail diff: command not found" + fi rev=$1 # empty means index shift buffile_relative=${kak_buffile#"$(git rev-parse --show-toplevel)/"} -- cgit v1.2.3