From 6ae1330bdfb6d10b50abaff03b8444535a2bc874 Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Thu, 22 Oct 2020 20:41:15 -0700 Subject: [PATCH] git: Add global attributes file Thanks to this blog post: https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more --- default.conf.yaml | 1 + git/config | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/default.conf.yaml b/default.conf.yaml index ea66899..e8f5955 100644 --- a/default.conf.yaml +++ b/default.conf.yaml @@ -17,6 +17,7 @@ ~/.config/user-dirs.dirs: etc/user-dirs.dirs ~/.config/zsh: zsh/ ~/.emacs.d: emacs/ + ~/.gitattributes: git/gitattributes ~/.gitignore: git/gitignore ~/.my.cnf: mysql/.my.cnf ~/.psqlrc: psql/.psqlrc diff --git a/git/config b/git/config index 738b7a7..f003c4a 100644 --- a/git/config +++ b/git/config @@ -9,6 +9,10 @@ ui = true colorMoved = default wsErrorHighlight = all +# https://gist.github.com/tekin/12500956bd56784728e490d8cef9cb81#gistcomment-3500150 +[diff "rspec"] +xfuncname = "^[ \t]*((RSpec|describe|context|it|before|after|around|feature|scenario|background)[ \t].*)$" + [merge] conflictStyle = diff3 ff = only @@ -58,6 +62,7 @@ helper = cache verbose = true [core] +attributesfile = ~/.gitattributes excludesfile = ~/.gitignore [include]