Tcl Source Code

View Ticket
Login
Ticket UUID: 3947fcf7cdb97c869e4e7a265589f8a876839646
Title: Current .gitattributes settings might not allow switching branches
Type: Bug Created on: 2019-08-22 14:56:38
Submitter: chrstphrchvz Assigned to: jan.nijtmans
Subsystem: 69. Other Severity: Minor
Priority: 5 Medium Last modified: 2019-08-26 14:19:12
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2019-08-26 14:19:12
Version: trunk
Description:

I recently cloned the git mirror (git clone https://github.com/tcltk/tcl.git) on a Linux machine, and then tried to checkout a different branch. However this seems impossible at first, because it believes there are updated files, even after git reset --hard HEAD:

win/buildall.vc.bat
win/makefile.vc
win/rules-ext.vc
win/rules.vc
win/targets.vc
win/tcl.dsp
win/tcl.dsw
win/tcl.hpj.in

I then tried combinations of commenting out the * text eol=lf and *.… text eol=crlf lines in .gitattributes, saw that the issue went away, undid my changes to .gitattribues, and the issue did not reappear. So I'm not certain what the cause was.

I tried to reproduce this on a Mac, by pulling in recent changes on core-8-6-branch (I had not done so in a few weeks), and it too believes there are files that have been modified:

libtommath/libtommath_VS2008.sln
libtommath/libtommath_VS2008.vcproj
win/makefile.vc
win/rules.vc

I do not have git config --global core.autocrlf set on either machine. I want to say this is caused by in the .gitattributes file, but am not sure, and I don't have a recommendation on how to resolve this. I understand that using the GitHub mirror (or using git at all) is likely not the preferred way of checking out the Tcl/Tk code.

User Comments:
jan.nijtmans added on 2019-08-23 07:10:09:
Well, did you switch between branches in which one of them had the .gitattributes file and the other branch didn't?  Well, the ".gitattribues" file was added recently [35adcf578d0c9d69], because without it GIT checkouts some files with CRLF line-endings on Windows, that caused a test-failures in the Travis build on Windows.

Eventually, all Tcl/Tk branches should have this .gitattributes files, then the problem should go away. It might also be a problem in the fossil <-> GIT conversion: Those files are committed in fossil using CRLF line-endings, this should not be modified by GIT.

sebres added on 2019-08-23 08:07:16:

Well, I think it is a bit not correct Jan, so Christopher is right (and I'm with him).
It could be sometimes really painful to work with this settings, especially if some prefered local git setting of user deviate.

So I'm always preferring another default gitattributes (also use it for Tcl)...

Here you'd find the "correct" settings in my opinion:

sebres/tcl/commit/80d9e36

I had never issues with that.

@Christopher you can also have your own local settings overriding the committed in fossil (git-mirror), see gitattributes#_examples


jan.nijtmans added on 2019-08-23 08:32:23:

Well, I'm not really a GIT expert, so if it works that's great!

So, let's test it: [dfa6dd4b95601034]

If Travis says OK (tomorrow), I'm OK too 😊︎. Then I'll backport this to 8.5 and up.

Thanks for your input! Appreciated, as always!


sebres added on 2019-08-26 13:24:38:

Got the same issue using my git2fossil script (trying to rebase some older branch from my git to current 8.6): several files were continuously recognized as "modified" during the rebase process (on each revision) without possibility to revert/reset them (unless I applied mentioned fix).

Could we rebase that fix (for >= 8.5), Jan? (Please :praying:)


jan.nijtmans added on 2019-08-26 14:11:11:
> Could we rebase that fix (for >= 8.5)

Yes, since the Travis build was successfull.

Again: Thanks for you help resolving this! Please, confirm that it's fixed now, then this ticket can be closed.

sebres added on 2019-08-26 14:12:41:
Many thanks, Jan!

@chrstphrchvz I'll close it now, Christopher. Please reopen if it still issued on your side.