Git: add possiblity to view diff images

This commit is contained in:
Robert Kmieć
2022-05-02 22:49:42 +02:00
parent fc997b0134
commit 86fa5c5017
2 changed files with 12 additions and 0 deletions

6
.gitattributes vendored Normal file
View File

@@ -0,0 +1,6 @@
*.bmp diff=image
*.gif diff=image
*.jpeg diff=image
*.jpg diff=image
*.png diff=image
*.svg diff=image

View File

@@ -9,6 +9,7 @@
autocrlf = false autocrlf = false
excludesfile = /home/rkmiec/.config/git/ignore excludesfile = /home/rkmiec/.config/git/ignore
symlinks = true symlinks = true
#attributesfile = ~/.gitattributes
[help] [help]
autocorrect = 1 autocorrect = 1
[color] [color]
@@ -38,6 +39,7 @@
dc = diff --cached dc = diff --cached
short = rev-parse --short --verify HEAD short = rev-parse --short --verify HEAD
update = !git stash && git pull --rebase && git stash pop && git submodule update --init --recursive 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] [interactive]
diffFilter = delta --color-only diffFilter = delta --color-only
[delta] [delta]
@@ -50,8 +52,12 @@
[pull] [pull]
rebase = true rebase = true
[commit] [commit]
template = .gitmessage
verbose = true verbose = true
[mergetool "vimdiff"] [mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J' cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[init] [init]
defaultBranch = master defaultBranch = master
[diff "image"]
command = /home/kmcr/tools/git-diff-image/git_diff_image
textconv = imgcat