Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File comparison launch from "Git Staging" part or "History" part, shows different EOL (CRLF) for ancestor #45

Open
JeanGarf opened this issue Jul 18, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@JeanGarf
Copy link

Version

6.10.0

Operating System

Windows

Eclipse version

2024-06

Bug description

I have a .gitattibutes with :
.githooks/** text eol=lf

I have a file named .githooks/commit-msg.
I check icon to "Show whitespace characters". My file has only LF.

I perform a change in this file and save it. It appears in "Unstaged Changes" in "Git Staging" part.

When I double click on it in "Git Staging" part, the comparison editor show the git ancestor with CRLF instead of LF (but LF for my local file), and therefore find false white space changes on each line.

But if in History part, I double click on a commit, the comparison editor show the git ancestor with LF, which is correct.

Actual behavior

When I double click on it in "Git Staging" part, the comparison editor show the git ancestor with CRLF instead of LF (but LF for my local file), and therefore find false white space changes on each line.

Expected behavior

When I double click on it in "Git Staging" part, the comparison editor should show the git ancestor with LF due to my .gitattribute and should be coherent with a double clic on a commit in the History part.

Relevant log output

No response

Other information

No response

@JeanGarf JeanGarf added the bug Something isn't working label Jul 18, 2024
@msohn
Copy link
Member

msohn commented Aug 29, 2024

How did you configure line ending related git options ? Check global configuration in ~/.gitconfig and repo specific configuration in .git/config

@creckord
Copy link

I am facing the same issue, also on Windows.

.gitattributes:

* text=auto

*.java text
*.yaml text
*.yml text
*.xml text
*.json text
*.md text
*.txt text
*.properties text eol=crlf

*.tar text=false
*.zip text=false
*.gpg text=false
*.gz  text=false
*.jpg text=false
*.png text=false
*.tgz text=false

/src/test/resources/**/* text=false

.git/config:

[core]
        ...
        eol = lf
        autocrlf = true
        safecrlf = false

I can confirm that the repository does contain the files with LF only, as does my working copy, and as far as I can trust my local git command line, so does the index with my staged changes.

Yet in EGit all the files always show up like this if Ignore Whitespace is off, with CRLF on the staged end, when comparing working copy and index:

image

When comparing index and upstream, both show as CRLF, which at least makes the diff view more usable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants