From 86fa5c501701d39436c3c6f85dab8f324ae6f581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Kmie=C4=87?= Date: Mon, 2 May 2022 22:49:42 +0200 Subject: [PATCH] Git: add possiblity to view diff images --- .gitattributes | 6 ++++++ .gitconfig | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b108b70 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +*.bmp diff=image +*.gif diff=image +*.jpeg diff=image +*.jpg diff=image +*.png diff=image +*.svg diff=image diff --git a/.gitconfig b/.gitconfig index 3f86fc8..49554cf 100644 --- a/.gitconfig +++ b/.gitconfig @@ -9,6 +9,7 @@ autocrlf = false excludesfile = /home/rkmiec/.config/git/ignore symlinks = true + #attributesfile = ~/.gitattributes [help] autocorrect = 1 [color] @@ -38,6 +39,7 @@ dc = diff --cached short = rev-parse --short --verify HEAD update = !git stash && git pull --rebase && git stash pop && git submodule update --init --recursive + diff-image = "!f() { cd -- \"${GIT_PREFIX:-.}\"; GIT_DIFF_IMAGE_ENABLED=1 git diff \"$@\"; }; f" [interactive] diffFilter = delta --color-only [delta] @@ -50,8 +52,12 @@ [pull] rebase = true [commit] + template = .gitmessage verbose = true [mergetool "vimdiff"] cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J' [init] defaultBranch = master +[diff "image"] + command = /home/kmcr/tools/git-diff-image/git_diff_image + textconv = imgcat