summaryrefslogtreecommitdiff
path: root/rc/tools/git.kak
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2025-03-23 15:59:58 +0100
committerMaxime Coste <mawww@kakoune.org>2025-03-24 08:23:50 +1100
commitdaaa32104fcbafdecd2f6eec15975dca3b7cc665 (patch)
tree252a2272e7abde7d6cf9f822ae4b14fbbd3f78a8 /rc/tools/git.kak
parentd433eb27c9944af33cd01acbef14a0220ad55251 (diff)
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.
Diffstat (limited to 'rc/tools/git.kak')
-rw-r--r--rc/tools/git.kak3
1 files changed, 3 insertions, 0 deletions
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)/"}