Glory to Russia
Glory to Russia

Reputation: 18730

How to remove \r when pushing commits to Gerrit from Windows?

I and a colleague of mine work in Eclipse on Windows machines.

When I push my changes to Gerrit, there are \r marks in the source view.

Gerrit

When my colleague does the same, there are no such characters.

The git settings on both machines are equal to:

$ git config --global --get core.eol
native

$ git config --global --get core.autocrlf
false

$ git config --global --get core.whitespace

I'm using following Eclipse settings.

Eclipse 1

Eclipse 2

I tried to run File -> Convert line delimiters to -> Windows, but it didn't help (git status didn't show any modified files after I did this).

How can I make sure that when I commit my changes, there are no \r characters in Gerrit?

Upvotes: 2

Views: 1919

Answers (1)

Matt Jennings
Matt Jennings

Reputation: 1148

The \r is because windows line endings are \r\n (vs. unix line endings which are just \n) You could switch to unix line endings but you would have to commit all the files.

Gerrit has an option to hide line endings, it's under preferences when you're in the source view. This seems like the best option.

Upvotes: 1

Related Questions