|
|
|
|
|
by mkdirp
1540 days ago
|
|
> If you have consistent code style and formatting this tool is unnecessary I disagree. I struggle to replicate it right now using a simple test, but I've seen the following rather infuriating and counter intuitive behaviour from Git/GNU diff. If you have a simple if statement such as: if (bla) {
// do something
}
And you were to add another statement at the end, after the closing curly brace, e.g.: if (bla) {
// do something
}
if (bla2) {
// do something else
}
Git/GNU diff will sometimes show the following diff: diff --git 1/left 2/right
index c2ea6f1..dc0e1c2 100644
--- 1/left
+++ 2/right
@@ -1,3 +1,6 @@
if (bla) {
// do something
+}
+if (bla2) {
+ // do something else
}
This is basic example, but there's other similar things. For a simple change like the above, this isn't a huge issue, but for a bigger patch sets, it can take a minute to understand what is really going on. |
|