Git supports an attributes file. A good read is https://git-scm.com/docs/gitattributes
Among the cool features is the ability to show ruby method definitions in the diffs.
The default behavior for ruby is to show the Class
diff --git a/tmp/rubya.rb b/tmp/rubyb.rb
index 554bf890..fa453b1d 100644
--- a/tmp/rubya.rb
+++ b/tmp/rubyb.rb
@@ -8,6 +8,6 @@ class Foo
# more context
# more context
- 3
+ 4
end
end
Add a .gitattributes file
diff --git a/tmp/rubya.rb b/tmp/rubyb.rb
index 554bf890..fa453b1d 100644
--- a/tmp/rubya.rb
+++ b/tmp/rubyb.rb
@@ -8,6 +8,6 @@ def my_foo
# more context
# more context
- 3
+ 4
end
end
I personally set a global .gitattributes using ~/.gitconfig