Open tomcw opened 7 years ago
(Perhaps this is a one-off and once I commit/push then that's the only time I'll see this. I'll check this idea in my personal fork.)
OK, it looks like it's a one-off.
If I commit+push those modified files to my fork, then cloning again from scratch (by deleting current clone folder), then the status is clean:
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
So are we OK with a single push to master that converts all line-endings for the above .vcproj etc files?
btw. this is currently blocking any commits to master, since all these .vcproj files are modified. The alternative is to delete the .gitattributes files (or modify it), if I have misunderstood.
Yeah, best to try it in a test branch.
I knew about the option but haven't used it myself. (We're still using SVN at work. ; - )
Cheers, Nick.
Well the pushed change to my test branch is:
22 changed files with 2,343 additions and 2,343 deletions.
So basically all the above files (.vcproj etc) have, I guess, had their line-endings changed, ie. now stored with LF in the remote GitHub, but CRLF when checked out locally. Whereas previously these files we CRLF in the remote GitHub (maybe?).
This is just a one-off change, and because of the .gitattributes file, then anyone checking out AppleWin will only ever get copies with .vcproj (etc) with CRLF, due to the conversation that .gitattributes enforces. (Assuming I properly understand .gitattributes!)
But what is the problem that we are trying to solve here? None of us (you, me, Michael) had a problem before, and so maybe we are just making work for ourselves... and we just reject the original PR.
I'm removing .gitattributes for now, as I get different "modified" result on my different machines (desktop vs laptop) - perhaps due to differing git config?
Anyway if it's not consistent for me, then it won't be consistent for others, so until I properly understand the behaviour (done in a dedicated branch or fork, not master) then I'm reverting to .gitattributes setup for now.
Hi Nick,
Over in PR #439 you made a good suggestion of using a .gitattributes file to enforce line-ending consistency for everyone checking out from the AppleWin repo. You said:
For reference the current .gitattributes file that I've committed into master looks like this:
But now if I update (pull) from master or fork (to my personal space)+clone then I get lots of modified files.
EG.:
For reference: (desktop PC / AMD Phenom II)
So these are the very files that are the .gitattributes file applies to. This is probably expected, since the line-endings for these files get modified from LF to CRLF. But I was expecting this to be hidden.
I certainly don't want these auto-modified files to be mixed in with files that I'm actually changing, nor do I want every commit/push to be polluting the master repo with these changes!
Any ideas?
(Perhaps this is a one-off and once I commit/push then that's the only time I'll see this. I'll check this idea in my personal fork.)