From 17fbfec2536d40ec185fc908a040a7dee43dda01 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Tue, 2 Jan 2024 10:37:53 -0800 Subject: [PATCH] Improve git diffs for Swift code --- gitattributes | 1 + gitconfig | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 gitattributes diff --git a/gitattributes b/gitattributes new file mode 100644 index 0000000..34486ed --- /dev/null +++ b/gitattributes @@ -0,0 +1 @@ +*.swift diff=swift diff --git a/gitconfig b/gitconfig index b43e4bf..621ea0b 100644 --- a/gitconfig +++ b/gitconfig @@ -13,6 +13,7 @@ whitespace = trailing-space,space-before-tab excludesfile = /Users/sjs/config/gitignore pager = diff-so-fancy | less --tabs=4 -RFX + attributesfile = /Users/work/.gitattributes [diff] mnemonicprefix = true renames = copies @@ -50,3 +51,5 @@ program = /usr/local/bin/gpg [commit] gpgsign = true +[diff "swift"] + xfuncname = ^[ \t]*(((private |public |internal |final |open )*class|(private |public |internal )*struct|(private |public |internal )*actor|(private |public |internal )*func|(private |public |internal )*extension|(private |public |internal )*enum)[ \t].*)$