{"thread":{"id":"59440","subject":"BUGREPORT: Modified files on a fresh clone on M2 MacBook Pro","startedAt":"2023-03-22T16:38:26Z","lastAt":"2023-03-24T04:45:41Z","messageCount":12,"participants":["Sjur Moshagen","Emily Shaffer","Jeff King","Kristoffer Haugsbakk","Junio C Hamano","Torsten Bögershausen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"473928","messageId":"593742E7-F0FC-471C-AFF5-1E855A3788B0@mac.com","threadId":"59440","inReplyTo":null,"subject":"BUGREPORT: Modified files on a fresh clone on M2 MacBook Pro","fromName":"Sjur Moshagen","fromEmail":"sjurnm@mac.com","sentAt":"2023-03-22T16:28:49Z","receivedAt":"2023-03-22T16:38:26Z","isPatch":false,"sender":{"key":"sjurnm@mac.com","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\ngit clone https://github.com/giellalt/lang-sma\n\nWhat did you expect to happen? (Expected behavior)\nClone to be clean, as reported by git status\n\nWhat happened instead? (Actual behavior)\ngit status reported four changed files\n\nWhat's different between what you expected and what actually happened?\nNothing except those four files\n\nAnything else you want to add:\nThis only happens on an M2 Macbook Pro. With Apple's git (1.37.1), a huge number of files were reported as modified.\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.40.0\ncpu: arm64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nfeature: fsmonitor--daemon\nuname: Darwin 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:46 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6020 arm64\ncompiler info: clang: 14.0.0 (clang-1400.0.29.202)\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /bin/zsh\n\n\n[Enabled Hooks]\n\n"},{"id":"473929","messageId":"CAJoAoZkKTGzgVyL2wM9a4VcFObx4YpjMSatH9Bpqcgyi=zzBrQ@mail.gmail.com","threadId":"59440","inReplyTo":"593742E7-F0FC-471C-AFF5-1E855A3788B0@mac.com","subject":"Re: BUGREPORT: Modified files on a fresh clone on M2 MacBook Pro","fromName":"Emily Shaffer","fromEmail":"nasamuffin@google.com","sentAt":"2023-03-22T16:46:11Z","receivedAt":"2023-03-22T16:46:41Z","isPatch":false,"sender":{"key":"nasamuffin@google.com","avatar":"https://avatars.githubusercontent.com/u/1606826?v=4"},"body":"On Wed, Mar 22, 2023 at 9:38 AM Sjur Moshagen <sjurnm@mac.com> wrote:\n>\n> Thank you for filling out a Git bug report!\n> Please answer the following questions to help us understand your issue.\n>\n> What did you do before the bug happened? (Steps to reproduce your issue)\n> git clone https://github.com/giellalt/lang-sma\n>\n> What did you expect to happen? (Expected behavior)\n> Clone to be clean, as reported by git status\n>\n> What happened instead? (Actual behavior)\n> git status reported four changed files\n\nIt would help to know which files, or what the difference was, so we\nhave a chance to figure out what happens without having to go and buy\na Macbook :)\n\n>\n> What's different between what you expected and what actually happened?\n> Nothing except those four files\n>\n> Anything else you want to add:\n> This only happens on an M2 Macbook Pro. With Apple's git (1.37.1), a huge number of files were reported as modified.\n>\n> Please review the rest of the bug report below.\n> You can delete any lines you don't wish to share.\n>\n>\n> [System Info]\n> git version:\n> git version 2.40.0\n> cpu: arm64\n> no commit associated with this build\n> sizeof-long: 8\n> sizeof-size_t: 8\n> shell-path: /bin/sh\n> feature: fsmonitor--daemon\n> uname: Darwin 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:46 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6020 arm64\n> compiler info: clang: 14.0.0 (clang-1400.0.29.202)\n> libc info: no libc information available\n> $SHELL (typically, interactive shell): /bin/zsh\n>\n>\n> [Enabled Hooks]\n>\n"},{"id":"473938","messageId":"3FC6072C-5856-437F-9B4F-BC182921426D@mac.com","threadId":"59440","inReplyTo":"CAJoAoZkKTGzgVyL2wM9a4VcFObx4YpjMSatH9Bpqcgyi=zzBrQ@mail.gmail.com","subject":"Re: BUGREPORT: Modified files on a fresh clone on M2 MacBook Pro","fromName":"Sjur Moshagen","fromEmail":"sjurnm@mac.com","sentAt":"2023-03-22T17:29:42Z","receivedAt":"2023-03-22T17:29:59Z","isPatch":false,"sender":{"key":"sjurnm@mac.com","avatar":null},"body":"22.3.2023 kl. 17:46 skrev Emily Shaffer <nasamuffin@google.com>:\n> \n> On Wed, Mar 22, 2023 at 9:38 AM Sjur Moshagen <sjurnm@mac.com> wrote:\n>> \n>> Thank you for filling out a Git bug report!\n>> Please answer the following questions to help us understand your issue.\n>> \n>> What did you do before the bug happened? (Steps to reproduce your issue)\n>> git clone https://github.com/giellalt/lang-sma\n>> \n>> What did you expect to happen? (Expected behavior)\n>> Clone to be clean, as reported by git status\n>> \n>> What happened instead? (Actual behavior)\n>> git status reported four changed files\n> \n> It would help to know which files, or what the difference was, so we\n> have a chance to figure out what happens without having to go and buy\n> a Macbook :)\n\nYes, of course :)\n\nIt only happens with binary files (.docx and .pdf files), which got me suspicious. It turned out that updating the .gitattributes file fixed the issue, cf\n\nhttps://github.com/giellalt/lang-sma/commit/fb5b56fa9fa7f25be1a1d7190bbb4d12b5a908fd#diff-618cd5b83d62060ba3d027e314a21ceaf75d36067ff820db126642944145393e\n\nWhat is still a mystery to me is that there has been no issues with cloning files on Intel Macs (git version 2.39.2), or on Linux (git version 2.34.1), even with the old .gitattributes file - ie the cloned repos were clean on these systems. Only on M2 (possibly also M1) Macs did this issue pop up.\n\nPlease tell me if there is more I can do to help.\n\nRegards,\nSjur\n\n"},{"id":"473939","messageId":"20230322173351.GC4296@coredump.intra.peff.net","threadId":"59440","inReplyTo":"CAJoAoZkKTGzgVyL2wM9a4VcFObx4YpjMSatH9Bpqcgyi=zzBrQ@mail.gmail.com","subject":"Re: BUGREPORT: Modified files on a fresh clone on M2 MacBook Pro","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-03-22T17:33:51Z","receivedAt":"2023-03-22T17:34:03Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Mar 22, 2023 at 09:46:11AM -0700, Emily Shaffer wrote:\n\n> On Wed, Mar 22, 2023 at 9:38 AM Sjur Moshagen <sjurnm@mac.com> wrote:\n> >\n> > Thank you for filling out a Git bug report!\n> > Please answer the following questions to help us understand your issue.\n> >\n> > What did you do before the bug happened? (Steps to reproduce your issue)\n> > git clone https://github.com/giellalt/lang-sma\n> >\n> > What did you expect to happen? (Expected behavior)\n> > Clone to be clean, as reported by git status\n> >\n> > What happened instead? (Actual behavior)\n> > git status reported four changed files\n> \n> It would help to know which files, or what the difference was, so we\n> have a chance to figure out what happens without having to go and buy\n> a Macbook :)\n\nJust a guess, but it probably has to do with Unicode normalization.\n\n  $ git clone https://github.com/giellalt/lang-sma\n  $ cd lang-sma\n  $ git ls-files -z |\n    perl -MUnicode::Normalize -0ne '\n      chomp;\n      print \"$_\\n\" if NFD($_) ne $_;\n    '\n  corp/SNÅSNINGEN 2014/10 uke/Arbeidsliv - sørsamisk.docx\n  corp/SNÅSNINGEN 2014/10 uke/Arbeidsliv.docx\n  [...and so on, there are 540 entries...]\n\nHFS silently normalized everything to NFD. On newer installs using APFS,\nI think the rules are different, but I haven't followed the details.\n\nI'm not sure if this is a red herring (after all, I'd expect 540 such\nfiles on HFS) or if some of the files are somehow special for APFS (I\nlooked for obvious things like collisions after normalization, but\ndidn't see any). I agree it would help to know which 4 files. :)\n\n-Peff\n"},{"id":"473948","messageId":"20230322174433.GA11532@coredump.intra.peff.net","threadId":"59440","inReplyTo":"20230322173351.GC4296@coredump.intra.peff.net","subject":"Re: BUGREPORT: Modified files on a fresh clone on M2 MacBook Pro","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-03-22T17:44:33Z","receivedAt":"2023-03-22T17:45:25Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Mar 22, 2023 at 01:33:51PM -0400, Jeff King wrote:\n\n> On Wed, Mar 22, 2023 at 09:46:11AM -0700, Emily Shaffer wrote:\n> \n> > On Wed, Mar 22, 2023 at 9:38 AM Sjur Moshagen <sjurnm@mac.com> wrote:\n> > >\n> > > Thank you for filling out a Git bug report!\n> > > Please answer the following questions to help us understand your issue.\n> > >\n> > > What did you do before the bug happened? (Steps to reproduce your issue)\n> > > git clone https://github.com/giellalt/lang-sma\n> > >\n> > > What did you expect to happen? (Expected behavior)\n> > > Clone to be clean, as reported by git status\n> > >\n> > > What happened instead? (Actual behavior)\n> > > git status reported four changed files\n> > \n> > It would help to know which files, or what the difference was, so we\n> > have a chance to figure out what happens without having to go and buy\n> > a Macbook :)\n> \n> Just a guess, but it probably has to do with Unicode normalization.\n\nHeh. After reading the other response in this thread, I could not have\nbeen further from the truth. :) Sorry for the noise.\n\n-Peff\n"},{"id":"473951","messageId":"73af529d-e918-445d-b0ee-9506e28188af@app.fastmail.com","threadId":"59440","inReplyTo":"3FC6072C-5856-437F-9B4F-BC182921426D@mac.com","subject":"Re: BUGREPORT: Modified files on a fresh clone on M2 MacBook Pro","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2023-03-22T18:22:09Z","receivedAt":"2023-03-22T18:22:34Z","isPatch":false,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Wed, Mar 22, 2023, at 18:29, Sjur Moshagen wrote:\n> [snip]\n>\n> Yes, of course :)\n>\n> It only happens with binary files (.docx and .pdf files), which got me \n> suspicious. It turned out that updating the .gitattributes file fixed \n> the issue, cf\n>\n> https://github.com/giellalt/lang-sma/commit/fb5b56fa9fa7f25be1a1d7190bbb4d12b5a908fd#diff-618cd5b83d62060ba3d027e314a21ceaf75d36067ff820db126642944145393e\n>\n> What is still a mystery to me is that there has been no issues with \n> cloning files on Intel Macs (git version 2.39.2), or on Linux (git \n> version 2.34.1), even with the old .gitattributes file - ie the cloned \n> repos were clean on these systems. Only on M2 (possibly also M1) Macs \n> did this issue pop up.\n>\n> Please tell me if there is more I can do to help.\n>\n> Regards,\n> Sjur\n\nI still get a dirty working repository after a fresh clone (on Linux,\ngit version 2.40.0) on your commit 6425cb09a8d0 (Apply changes 127,\n2023-03-22):\n\n    $ git status\n    On branch main\n    Your branch is up to date with 'origin/main'.\n\n    Changes not staged for commit:\n      (use \"git add <file>...\" to update what will be committed)\n      (use \"git restore <file>...\" to discard changes in working directory)\n            modified:   \"corp/SN\\303\\205SNINGEN 2014/43 uke/N\\303\\246ringsliv.doc\"\n            modified:   \"corp/SN\\303\\205SNINGEN 2015/26 uke/\\303\\230lsamling.doc\"\n            modified:   \"corp/SN\\303\\205SNINGEN 2015/38 uke /SAK1 -s\\303\\270rsamisk.doc\"\n            modified:   \"corp/SN\\303\\205SNINGEN 2015/38 uke /SAK1.doc\"\n            modified:   \"corp/Sn\\303\\245sningen 2012/20 uke/Artig med animasjon - samisk.doc\"\n            modified:   \"corp/Sn\\303\\245sningen 2012/20 uke/Artig med animasjon.doc\"\n            modified:   \"corp/Sn\\303\\245sningen 2012/4. uke/Mange vil l\\303\\246re s\\303\\270rs/Mange vil l\\303\\246re s\\303\\270rsamisk - saemien.doc\"\n            modified:   \"corp/Sn\\303\\245sningen 2012/4. uke/Mange vil l\\303\\246re s\\303\\270rs/Mange vil l\\303\\246re s\\303\\270rsamisk.doc\"\n            modified:   \"corp/Sn\\303\\245sningen 2012/4. uke/P\\303\\245 sameskolen/Det er p\\303\\245 sameskolen jeg f\\303\\270ler meg hjemme - samisk.doc\"\n            modified:   \"corp/Sn\\303\\245sningen 2012/4. uke/P\\303\\245 sameskolen/Det er p\\303\\245 sameskolen jeg f\\303\\270ler meg hjemme.doc\"\n            modified:   \"corp/Sn\\303\\245sningen 2013/50 uke/Dramatikk og kj\\303\\246rlighet - S\\303\\270rsamisk.doc\"\n\n    no changes added to commit (use \"git add\" and/or \"git commit -a\")\n\nNote that this `doc` extension was not covered by your update.\n\nBut it becomes clean if I remove this line:\n\n    $ git diff\n    diff --git a/.gitattributes b/.gitattributes\n    index bbd8c0db810d..3959fefadfc1 100644\n    --- a/.gitattributes\n    +++ b/.gitattributes\n    @@ -2,7 +2,6 @@\n     # DO NOT EDIT - the file is updated via the template system.\n\n     # Some defaults:\n    -* text   eol=lf\n     *.png    binary\n     *.jpg    binary\n     *.jpeg   binary\n\n-- \nKristoffer Haugsbakk\n"},{"id":"473952","messageId":"68ACFE61-5D19-43D8-887A-7150E8B90BDB@mac.com","threadId":"59440","inReplyTo":"73af529d-e918-445d-b0ee-9506e28188af@app.fastmail.com","subject":"Re: BUGREPORT: Modified files on a fresh clone on M2 MacBook Pro","fromName":"Sjur Moshagen","fromEmail":"sjurnm@mac.com","sentAt":"2023-03-22T18:47:35Z","receivedAt":"2023-03-22T18:55:12Z","isPatch":false,"sender":{"key":"sjurnm@mac.com","avatar":null},"body":"22.3.2023 kl. 19:22 skrev Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>:\n> \n> I still get a dirty working repository after a fresh clone (on Linux,\n> git version 2.40.0) on your commit 6425cb09a8d0 (Apply changes 127,\n> 2023-03-22):\n> \n>    $ git status\n>    On branch main\n>    Your branch is up to date with 'origin/main'.\n> \n>    Changes not staged for commit:\n>      (use \"git add <file>...\" to update what will be committed)\n>      (use \"git restore <file>...\" to discard changes in working directory)\n>            modified:   \"corp/SN\\303\\205SNINGEN 2014/43 uke/N\\303\\246ringsliv.doc\"\n>            modified:   \"corp/SN\\303\\205SNINGEN 2015/26 uke/\\303\\230lsamling.doc\"\n>            modified:   \"corp/SN\\303\\205SNINGEN 2015/38 uke /SAK1 -s\\303\\270rsamisk.doc\"\n>            modified:   \"corp/SN\\303\\205SNINGEN 2015/38 uke /SAK1.doc\"\n>            modified:   \"corp/Sn\\303\\245sningen 2012/20 uke/Artig med animasjon - samisk.doc\"\n>            modified:   \"corp/Sn\\303\\245sningen 2012/20 uke/Artig med animasjon.doc\"\n>            modified:   \"corp/Sn\\303\\245sningen 2012/4. uke/Mange vil l\\303\\246re s\\303\\270rs/Mange vil l\\303\\246re s\\303\\270rsamisk - saemien.doc\"\n>            modified:   \"corp/Sn\\303\\245sningen 2012/4. uke/Mange vil l\\303\\246re s\\303\\270rs/Mange vil l\\303\\246re s\\303\\270rsamisk.doc\"\n>            modified:   \"corp/Sn\\303\\245sningen 2012/4. uke/P\\303\\245 sameskolen/Det er p\\303\\245 sameskolen jeg f\\303\\270ler meg hjemme - samisk.doc\"\n>            modified:   \"corp/Sn\\303\\245sningen 2012/4. uke/P\\303\\245 sameskolen/Det er p\\303\\245 sameskolen jeg f\\303\\270ler meg hjemme.doc\"\n>            modified:   \"corp/Sn\\303\\245sningen 2013/50 uke/Dramatikk og kj\\303\\246rlighet - S\\303\\270rsamisk.doc\"\n> \n>    no changes added to commit (use \"git add\" and/or \"git commit -a\")\n> \n> Note that this `doc` extension was not covered by your update.\n> \n> But it becomes clean if I remove this line:\n> \n>    $ git diff\n>    diff --git a/.gitattributes b/.gitattributes\n>    index bbd8c0db810d..3959fefadfc1 100644\n>    --- a/.gitattributes\n>    +++ b/.gitattributes\n>    @@ -2,7 +2,6 @@\n>     # DO NOT EDIT - the file is updated via the template system.\n> \n>     # Some defaults:\n>    -* text   eol=lf\n\nThanks for pointing this out - git status did not return these files for me. Also interesting that you got it on a Linux box, that has not happened to us, cf earlier email in this thread.\n\nI will add this and other missing extensions.\n\nBest,\nSjur"},{"id":"473954","messageId":"xmqq355wegsd.fsf@gitster.g","threadId":"59440","inReplyTo":"73af529d-e918-445d-b0ee-9506e28188af@app.fastmail.com","subject":"Re: BUGREPORT: Modified files on a fresh clone on M2 MacBook Pro","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-03-22T19:18:26Z","receivedAt":"2023-03-22T19:18:29Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Kristoffer Haugsbakk\" <kristofferhaugsbakk@fastmail.com> writes:\n\n>             modified:   \"corp/Sn\\303\\245sningen 2013/50 uke/Dramatikk og kj\\303\\246rlighet - S\\303\\270rsamisk.doc\"\n>\n>     no changes added to commit (use \"git add\" and/or \"git commit -a\")\n>\n> Note that this `doc` extension was not covered by your update.\n>\n> But it becomes clean if I remove this line:\n>\n>     $ git diff\n>     diff --git a/.gitattributes b/.gitattributes\n>     index bbd8c0db810d..3959fefadfc1 100644\n>     --- a/.gitattributes\n>     +++ b/.gitattributes\n>     @@ -2,7 +2,6 @@\n>      # DO NOT EDIT - the file is updated via the template system.\n>\n>      # Some defaults:\n>     -* text   eol=lf\n>      *.png    binary\n>      *.jpg    binary\n>      *.jpeg   binary\n\nThe attribute file says \"assume everything is text unless otherwise\nnoted below\", which you probably should not lose.  Instead, I would\ndeclare *.doc are also binary by appending a new entry at the end of\nthe file, if I were managing that project.\n\n"},{"id":"473958","messageId":"34c11cee-d73e-4de0-85f1-5ecd5fe54c71@app.fastmail.com","threadId":"59440","inReplyTo":"xmqq355wegsd.fsf@gitster.g","subject":"Re: BUGREPORT: Modified files on a fresh clone on M2 MacBook Pro","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2023-03-22T20:00:13Z","receivedAt":"2023-03-22T20:08:17Z","isPatch":false,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Wed, Mar 22, 2023, at 20:18, Junio C Hamano wrote:\n> The attribute file says \"assume everything is text unless otherwise\n> noted below\", which you probably should not lose.\n\nThat was to illustrate the issue, not to propose a change. Sorry about\nnot being clear.\n\n(But it also so happens to be the case that I know very little about \n`.gitattributes` :))\n\nOn Wed, Mar 22, 2023, at 19:47, Sjur Moshagen wrote:\n> I will add this and other missing extensions.\n\nBy the way, when I first cloned the repository on commit 357c7cf01950\n(text, 2023-03-21), those two binary `txt` files showed up as dirty for\nme (before you removed them in 6b0acd78f9c9 (Remove accidentally added\nfiles with uncomprehensible content, 2023-03-22)). I guess it was the\nsame for you.\n\n-- \nKristoffer Haugsbakk\n"},{"id":"473962","messageId":"D9EA587E-1B31-40EC-BF00-BB37DA29DFC4@mac.com","threadId":"59440","inReplyTo":"34c11cee-d73e-4de0-85f1-5ecd5fe54c71@app.fastmail.com","subject":"Re: BUGREPORT: Modified files on a fresh clone on M2 MacBook Pro","fromName":"Sjur Moshagen","fromEmail":"sjurnm@mac.com","sentAt":"2023-03-22T21:09:19Z","receivedAt":"2023-03-22T21:09:38Z","isPatch":false,"sender":{"key":"sjurnm@mac.com","avatar":null},"body":"22.3.2023 kl. 21:00 skrev Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>:\n> \n> On Wed, Mar 22, 2023, at 20:18, Junio C Hamano wrote:\n>> The attribute file says \"assume everything is text unless otherwise\n>> noted below\", which you probably should not lose.\n\nI have now added all missing binary file types I could find, and kept the default as text.\n\n> On Wed, Mar 22, 2023, at 19:47, Sjur Moshagen wrote:\n>> I will add this and other missing extensions.\n\nDone in https://github.com/giellalt/lang-sma/commit/0f461c63ade00a623da2b2533fbe5ca4b986c1f0.\n\n> By the way, when I first cloned the repository on commit 357c7cf01950\n> (text, 2023-03-21), those two binary `txt` files showed up as dirty for\n> me (before you removed them in 6b0acd78f9c9 (Remove accidentally added\n> files with uncomprehensible content, 2023-03-22)). I guess it was the\n> same for you.\n\nYes, it was, should be ok now.\n\nThanks to all for the help and friendly comments and suggestions.\n\nSjur Moshagen"},{"id":"473977","messageId":"20230323053110.z64tcce5dy3q7yew@tb-raspi4","threadId":"59440","inReplyTo":"593742E7-F0FC-471C-AFF5-1E855A3788B0@mac.com","subject":"Re: BUGREPORT: Modified files on a fresh clone on M2 MacBook Pro","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2023-03-23T05:31:10Z","receivedAt":"2023-03-23T05:32:56Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On Wed, Mar 22, 2023 at 05:28:49PM +0100, Sjur Moshagen wrote:\n> Thank you for filling out a Git bug report!\n> Please answer the following questions to help us understand your issue.\n>\n> What did you do before the bug happened? (Steps to reproduce your issue)\n> git clone https://github.com/giellalt/lang-sma\n>\n> What did you expect to happen? (Expected behavior)\n> Clone to be clean, as reported by git status\n>\n> What happened instead? (Actual behavior)\n> git status reported four changed files\n>\n> What's different between what you expected and what actually happened?\n> Nothing except those four files\n>\n> Anything else you want to add:\n> This only happens on an M2 Macbook Pro. With Apple's git (1.37.1), a huge number of files were reported as modified.\n>\n> Please review the rest of the bug report below.\n> You can delete any lines you don't wish to share.\n>\n>\n> [System Info]\n> git version:\n> git version 2.40.0\n> cpu: arm64\n> no commit associated with this build\n> sizeof-long: 8\n> sizeof-size_t: 8\n> shell-path: /bin/sh\n> feature: fsmonitor--daemon\n> uname: Darwin 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:46 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6020 arm64\n> compiler info: clang: 14.0.0 (clang-1400.0.29.202)\n> libc info: no libc information available\n> $SHELL (typically, interactive shell): /bin/zsh\n>\n>\n> [Enabled Hooks]\n>\n\nAs a general note, the current .gitattributes file can still be improved.\nThe general rule and recommendation would be to start the text attributes\ndefinition by using a \"catch all\" rule, followed by files that need\nspecial treatment.\nThe very first text/binary line would be\n* text=auto\nwhich will tell Git to auto-detect all files (and file types),\nsee below,\nThis basically prevents corruption of binary files.\nwhich are not mentioned later.\nLike README.md, LICENCE and so on.\nThen there is a list of file extension, that are known to be binary,\nyou can add them as shown below.\n\n===============================\n# List of files to be included in GitHub statistics.\n# DO NOT EDIT - the file is updated via the template system.\n\n# Some defaults:\n* text=auto\n*.aif     binary\n*.aiff    binary\n*.docx    binary\n*.fomabin binary\n*.gz      binary\n[snip]\n*.sh text eol=lf\n\n===================================\nNow, lets look at the at the master branch of the repo:\ncommit 4e0d949dbbd13a4dd9285ae3dee63abc822b805a (HEAD -> main, origin/main, origin/HEAD)\nAuthor: Sjur N Moshagen <sjurnm@mac.com>\n\nPlease run\ngit ls-files --eol\nAnd you will see a line like this:\ni/-text w/-text attr/text eol=lf\tcorp/SNÅSNINGEN 2014/43 uke/Næringsliv.doc\n\nThe \"i/-text\" will tell us thet Git identified the file, as commited into the repo,\nas binary (\"non-text\").\nThe \"w/-text\" will tell us thet Git identified the file, as seen on disk,\nin you working tree,  as binary (\"non-text\").\nSo everything looks fine, so far.\nBut the comes \"attr/text eol=lf\", wich tells Git to ignore its feeling,\nand possible corrupt the file at the next commit, converting CRLF into LF.\n\nAs an exmple, the \"corp/SNÅSNINGEN 2014/43 uke/Næringsliv.doc\" will be corrupted.\nIt may or not be reported as changed. after a fresh clone. And others as well.\nBut in any case, it will be corrupted when you commit it.\nOops.\n\nAnd why is that?\nBecause people had forgotten a line like\n*.doc binary\nfor the doc files.\n\nTo put it in harsh words: I would call the .gitattributes file broken.\nPlease consider to change the default to auto, as pointed out by\nothers as well.\n\nMy version of a .gitattributes would look like this:\n=================\n# Some defaults:\n# Stay on the safe type for files that may be added later\n* text=auto\n# shell files need lf\n*.sh text eol=lf\n# Add other file types, like *.gz\n\n# Include in statistics, no syntax colour ATM, classified as text instead:\n[snip]\n====================\n\n"},{"id":"474074","messageId":"xmqqr0te69la.fsf@gitster.g","threadId":"59440","inReplyTo":"20230323053110.z64tcce5dy3q7yew@tb-raspi4","subject":"Re: BUGREPORT: Modified files on a fresh clone on M2 MacBook Pro","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-03-24T04:45:37Z","receivedAt":"2023-03-24T04:45:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> The general rule and recommendation would be to start the text attributes\n> definition by using a \"catch all\" rule, followed by files that need\n> special treatment.\n> The very first text/binary line would be\n> * text=auto\n> which will tell Git to auto-detect all files (and file types),\n> see below,\n> This basically prevents corruption of binary files.\n> which are not mentioned later.\n> Like README.md, LICENCE and so on.\n> Then there is a list of file extension, that are known to be binary,\n> you can add them as shown below.\n\nThanks for writing this down clearly.\n\nIf I would add one thing to the general advice, it is that it\napplies o those who are using Git primarily as their source code,\nnot binary asset, control system, which roughly translates to \"for\nmost of the paths in the project, 'git diff' without using any\nexternal diff driver is useful\".  In such an environment,\n\"everything by default is text, and only selected few are not\" would\nwork very well.  If on the other hand there are myriad of binary\nasset of different types, it can become cumbersome to mark them \"do\nnot try normalizing the eol, which is done to help cross platform\ndevelopment\" individually.\n"}]}