Initially we had SVN, but then migrated to Git. Actually we had no idea about end of line issue, because we always worked on Windows. After some time we've noticed that specific commits changed the whole file, though some diff tools insisted that there are no differences.
First of all, it occurred that the order of revisions in git diff is important. It misled us, we started to think that those commits changed LF -> CRLF.
Finally,
git diff <parent_commit> <child_commit> --ws-error-highlight=new,old -- FileName.java
revealed the truth:
Now we are thinking should we stay with "Windows-style everywhere" or migrate to "commit Unix-style".
First of all, it occurred that the order of revisions in git diff is important. It misled us, we started to think that those commits changed LF -> CRLF.
Finally,
git diff <parent_commit> <child_commit> --ws-error-highlight=new,old -- FileName.java
revealed the truth:
Now we are thinking should we stay with "Windows-style everywhere" or migrate to "commit Unix-style".
Points to consider:
- There are tons of holly wars, but I couldn't find recommendation from Git. But it provides a way to change behavior.
- There is recommendation
from GitHub to use LF in repository.
- Windows for git has
three options, but neither one of them enforces CRLF. Though it is
possible to enforce LF. If we use checkout as-is and commit as-is, there
is always a chance that some developer has another setting.
Comments
Post a Comment