1

We are using git. I am using eclipse. Some of the committers may not be using eclipse. Here's what is happening.

I make a small change in an existing file (properties/xml/java) and save it and commit it.

gitk (without ignore space change) and eclipse thinks the whole file changed. The commit shows @@ -1,354 +1,354 @@ which means the entire file changed.

When I check for code change difference, with ignore white space, then I can see the text difference. But I don't know what white space change is causing this.

How do I detect what white space difference is there between two files? It could be new line character, carriage return, tab, or something else.

Indu Devanath
  • 2,068
  • 1
  • 16
  • 17

1 Answers1

0

This is how eclipse compare editor works. Unlike other file compare tools(kdiff3 or winmerge or Beyond compare) it shows entire file instead of showing only the difference.

But you can jump to individual changes by clicking on the change book markers as highlighted below.

enter image description here

You can integrate other compare tools(Ex: Beyond compare, winmerge) in eclipse.

Refer these links

Beyond Compare with git

Winmerge with git

Edit:

White space changes are shown in GREY background color

enter image description here

Community
  • 1
  • 1
Chandrayya G K
  • 8,719
  • 5
  • 40
  • 68
  • I know that. In eclipse go to Windows > Preferences > General > compare/patch. Here "uncheck" ignore white space. Which means I need to know if there are any white space differences. I know what text changed. What I want to know is if any white space changed. If yes, then what is that white space. It could be new line character, carriage return, tab, some white space change. How to detect that? – Indu Devanath Mar 19 '14 at 20:51
  • Comparator shows all changes(including whitespace and text)initially. You can ignore white space changes by selecting option `Ignore White Space` in the context menu of comparator editor. But there is no option to `ignore text changes` and show only `White Space changes`. However you can detect ONLY white space changes by looking at the background color of changes. See the new picture attached – Chandrayya G K Mar 20 '14 at 05:02
  • I see your picture that white space difference shows some grey spots in your comparator. Mine shows that the entire file changed, with no grey spots highlighting. – Indu Devanath Mar 20 '14 at 23:03