`git diff -b` (actually legible when reindenting code)
Contrast git diff
output:
diff --git a/indent.rb b/indent.rb
index 81595d9..08ec43c 100644
--- a/indent.rb
+++ b/indent.rb
@@ -1,7 +1,9 @@
-def fn
- # big complicated
- # function body
- # ...
- # ...
+def fn(really_do_it)
+ if really_do_it
+ # big complicated
+ # function body
+ # ...
+ # ...
+ end
end
With git diff -b
output:
diff --git a/indent.rb b/indent.rb
index 81595d9..08ec43c 100644
--- a/indent.rb
+++ b/indent.rb
@@ -1,7 +1,9 @@
-def fn
+def fn(really_do_it)
+ if really_do_it
# big complicated
# function body
# ...
# ...
+ end
end
(I still don't know how I only found out about this just now...)
Written by Tim Serong
Related protips
2 Responses
Coolest thing I learned today!
over 1 year ago
·
Much better option is: -w
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Diff
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#