|
From: Pete B. <pb...@gm...> - 2011-02-02 19:26:13
|
Still a bit too early to claim victory, but I'm seeing some encouraging results with the latest version of msys-git at last. Tests on a machine where I completely removed TGit and MsysGit, and installed the very latest version of MsysGit alone (1.7.3.1) seem to produce the expected results with "text eol=lf" (text is of course redundant, since default, but didn't want to take any risks). Complete details of my testing procedure are at the end of this e-mail (pretty much the same as how I tested last time around). The original hypertest branch I started with is a 1:1 clone of current official. Now, cloning the resulting hypertest repo with MsysGit 1.7.1 (and of course autocrlf=true), still produces CRLF'd files, so it looks like this is an issue that got fixed recently (and I'm upgrading MsysGit on that other machine to confirm). Not entirely sure whether it was an MsysGit or Git issue to start with, especially as there has been a recent (2010.05+) overhaul of autocrlf vs .gitattributes in mainline git [1]. At least the 1.7.1 of mainline git was released before the 2010.05 discussion, so I have reason to believe that this was indeed a mainline git issue. To quote Linux slightly out of context from the thread, (May 14 2010, 9:27 pm) ------------------------------------------------------------------------ We're trying to get _away_ from .gitattributes depending on autocrlf, aren't we? (...) It's really that simple. I think "autocrlf" actually works pretty well, but at the same time, I think we made mistakes in the initial design. Let's not make them again. ------------------------------------------------------------------------ Once I confirm recent versions of git are A-OK with regards to eol=*, I'll switch back to using eol=lf / eol=CRLF in my repo (with of course the possibility of inconveniencing Michael once again). We will of course have to advise our Windows users to use git 1.7.3 or later. Regards, /Pete [1] http://groups.google.com/group/msysgit/browse_thread/thread/4f1235bcfb164098/7bc34afcfbac71e2 ------------------------------------------------------------------------ $ git config --global user.name "Pete Batard" $ git config --global user.email "pb...@gm..." $ git clone git://git.libusb.org/libusb-pbatard.git Cloning into libusb-pbatard... remote: Counting objects: 6047, done. remote: Compressing objects: 100% (2430/2430), done. remote: Total 6047 (delta 4615), reused 4746 (delta 3609) Receiving objects: 100% (6047/6047), 1.32 MiB | 657 KiB/s, done. Resolving deltas: 100% (4615/4615), done. $ cd libusb-pbatard/ $ git checkout -b hypertest origin/hypertest Branch hypertest set up to track remote branch hypertest from origin. Switched to a new branch 'hypertest' $ git config remote.origin.url ssh://pbatard@git.libusb.org/var/lib/git/libusb-pbatard.git $ echo "*.sh text eol=lf" > .gitattributes $ git add * warning: CRLF will be replaced by LF in autogen.sh. The file will have its original line endings in your working directory. $ git add .gitattributes warning: LF will be replaced by CRLF in .gitattributes. The file will have its original line endings in your working directory. $ git commit [hypertest 6d39479] added "*.sh text eol=lf" .gitattributes warning: LF will be replaced by CRLF in .gitattributes. The file will have its original line endings in your working directory. 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 .gitattributes $ git config -l > config.sh $ dos2unix.exe config.sh # AND manually confirmed LF in config.sh $ git add config.sh ; notice no mention of LF being replaced by CRLF! $ git commit [hypertest 4c0e27d] added config.sh 1 files changed, 23 insertions(+), 0 deletions(-) create mode 100644 config.shgit push $ git push Counting objects: 7, done. Compressing objects: 100% (5/5), done. Writing objects: 100% (6/6), 899 bytes, done. Total 6 (delta 2), reused 0 (delta 0) To ssh://pbatard@git.libusb.org/var/lib/git/libusb-pbatard.git 295c9d1..4c0e27d hypertest -> hypertest $ cd..; rm -rf libusb-pbatard/ $ git clone git://git.libusb.org/libusb-pbatard.git Cloning into libusb-pbatard... remote: Counting objects: 6053, done. remote: Compressing objects: 100% (2435/2435), done. Receiving objects: 100% (6053/6053), 1.32 MiB | 651 KiB/s, done. Resolving deltas: 100% (4615/4615), done. $ cd libusb-pbatard/ $ git checkout -b hypertest origin/hypertest Branch hypertest set up to track remote branch hypertest from origin. Switched to a new branch 'hypertest' => YAY! LF on the .sh files at long last!!! |