Changing Indentation with Eclipse Preferences not picked up as a changeset by TortoiseHG

Null :

I have changed the size of my indentations in preferences -> java -> code style -> formatter within the eclipse settings. I believe Eclipse defaults to 4, but I wanted it set to 2. I have applied the change, and all of my files now have 2 space indentations. However, TortoiseHG does not see this as a "change" that can be committed.

I've tried switching the formatting to "spaces only" but no change is picked up by TortoiseHG. What is the best workaround here if there is one?

Sambit :

I provide few lines which will be helpful to you.

  1. First convert tab to space in Eclipse. You can do it by clicking Preference > Java > Code Style > Formatter > Edit > Indentation > Tab Policy as Spaces only.
  2. Click on Preference > General > Editors > Text Editors > select check box for Insert spaces for tabs.

After making this configuration in eclipse, it will give more clarity of how many spaces are there in each line.

If you are using TortoiseGit, refer this link , before committing and pushing the files, double click on each file and you can see if there are tabs of spaces. In case of spaces, you will find .(dot).

Besides, you can also verify whether the file contains tabs or spaces in Notepad++ .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=162046&siteId=1