Changed files pane shows different changes than git diff

Answered

Hi,

can you please explain why the "Changed Files pane" shows different changes than git diff?

In this sample project I moved the method println from Main to Bar, but the changed files pane only shows Bar as changed.

 

If I run git diff I see all the expected changes:

$ git diff 846d47f2acce2c8d6c73a44768c0e23c919fc7b9 057a30e4d1b22e9077ce11b0b50dbe8c746d917e
diff --git a/src/com/foo/Bar.java b/src/com/foo/Bar.java
index 731a489..6cafc1a 100644
--- a/src/com/foo/Bar.java
+++ b/src/com/foo/Bar.java
@@ -1,4 +1,7 @@
package com.foo;

class Bar {
+ static void println(String msg) {
+ System.out.println(msg);
+ }
}
diff --git a/src/com/foo/Main.java b/src/com/foo/Main.java
index 69c768c..68add96 100644
--- a/src/com/foo/Main.java
+++ b/src/com/foo/Main.java
@@ -3,11 +3,8 @@ package com.foo;
public class Main {

public static void main(String[] args) {
- println("Foo");
- println("Bar");
+ Bar.println("Foo");
+ Bar.println("Bar");
}

- private static void println(String msg) {
- System.out.println(msg);
- }
}

The information in the "Changed Files Pane" shown is incomplete, it does not show all the files that were changed by merging the move_println2 branch.

0
1 comment

The Changed files pane shows you the same information as git log, not the full diff. Since it is a merged commit, only files that a different form both parents are listed.

You will see the same list of files if you do

git show 057a30e4d1b22e9077ce11b0b50dbe8c746d917e

See https://youtrack.jetbrains.com/issue/IDEA-125054 and https://youtrack.jetbrains.com/issue/IDEA-148143

 

0

Please sign in to leave a comment.