From: Peter S. <pe...@st...> - 2010-12-06 09:47:28
|
Xiaofan Chen wrote: > > Cygwin is *NOT* Windows. So using a Windows tool such as TortoiseGit > > or msysGit to check out something that will be used Cygwin is not > > correct, should not be expected to work, and must not be optimized > > for. Make sure to use a Cygwin tool for Cygwin testing. I guess LF > > may be the native line ending in Cygwin, which would explain why > > Xiaofan never has problems with line endings. > > I just use whatever default Cygwin git is using and I have no issues > with all the git trees I use. Default is to never convert as I understand it. And Cygwin is happy with LF line endings which all projects use. > But I tried to use MSysGit for once and it gave me all kinds of > problems so that I did not use it. Also CRLF problems, or other? Just curious, it should continue to be fine for you to use Cygwin git. > Take note I sometimes copy git repos between Linux/Windows. Ah thanks for pointing this out. Yes, this should indeed work fine - except when a user has safecrlf=true+autocrlf=true to get CRLF, since core.eol=native by default and will thus differ for the two gits. But getting a problem in that case is a healthy indicator that something is wrong. The CRLF worktree should not be copied to a non-CRLF platform. (Cloning from it would however work perfectly.) > On the other hand, so you expect Pete to use MSysGit for > MinGW/MSVC/WDK testing and use Cygwin Git for Cygwin > testing. I am not so sure if he would like to do that. Only with safecrlf=true+autocrlf=true in the worktree for MinGW/MSVC/WDK; ie. only if there are CRLF in the worktree. I do think it would make sense to keep different worktrees for the different systems, but it's not technically a requirement, I believe especially not if the .gitattributes I suggested is added. (Oh, and if it is added I will add it before any other changes to libusb.git. Everyone should then rebase onto at least that commit. This is why it is important to always track upstream HEAD in downstrean repositories.) > To me, it is better not to let the tool be too smart and convert > things automatically. Rather do not touch the line endings. If > something breaks, blame those who use stupid editors to stupid tools. The entire problem is that we would like to be native on Windows, where CRLF is the only truth that ever existed. And I am very happy to be able to push this problem to the capable hands of git, if users want CRLF in their worktrees. I repeat; git doesn't do conversion unless autocrlf=true, which should never be set without safecrlf=true to ensure conversions do not break stuff. So by default things are as you describe; no conversion, and developers must have good tools. On Windows such good tools are less common, so there it is good that safecrlf=true+autocrlf=true can be set by users, who are stuck with tools that will require or produce CRLF. This is how I have been thinking. //Peter |