{"thread":{"id":"53642","subject":"osx autocrlf sanity?","startedAt":"2020-06-09T19:52:56Z","lastAt":"2020-06-10T23:54:15Z","messageCount":11,"participants":["Martin Langhoff","brian m. carlson","Randall S. Becker","Torsten Bögershausen","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"399363","messageId":"CACPiFCJKvnDL9Xj1Xs0RCvuhymjDz4N0hT42dNtBQxp+TLiPaw@mail.gmail.com","threadId":"53642","inReplyTo":null,"subject":"osx autocrlf sanity?","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2020-06-09T19:52:42Z","receivedAt":"2020-06-09T19:52:56Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"Hi git list,\n\nlong time no see! I am here to ask for a sanity check. I'm on OSX.\nChecking out a repository that has an un-controlled mix of line\nendings. Mostly linux-style, but some Windows CRLF endings.\n\nA few tests.\n - I set core.autocrlf=input globally --> a fresh clone doesn't have a\nclean status files look modified right after a clone)\n - set core.autocrlf=false globally --> a fresh clone doesn't have a\nclean status\n - set core.autocrlf=true globally --> a fresh clone doesn't have a clean status\n\nThis is git v2.23.0 from Homebrew.\n\nAm I doing something wrong? Can git work sanely on a mixed endings\nrepo without having to fix the world first?\n\n... I do strive to fix the world (and this small repository), as we\nall do, but it should not be a preconditions before git behaves\nsanely.\n\ncheers,\n\n\nmartin\n-- \n martin.langhoff@gmail.com\n - ask interesting questions  ~  http://linkedin.com/in/martinlanghoff\n - don't be distracted        ~  http://github.com/martin-langhoff\n   by shiny stuff\n"},{"id":"399375","messageId":"20200609231336.GQ6569@camp.crustytoothpaste.net","threadId":"53642","inReplyTo":"CACPiFCJKvnDL9Xj1Xs0RCvuhymjDz4N0hT42dNtBQxp+TLiPaw@mail.gmail.com","subject":"Re: osx autocrlf sanity?","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-06-09T23:13:36Z","receivedAt":"2020-06-09T23:14:16Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-06-09 at 19:52:42, Martin Langhoff wrote:\n> Hi git list,\n> \n> long time no see! I am here to ask for a sanity check. I'm on OSX.\n> Checking out a repository that has an un-controlled mix of line\n> endings. Mostly linux-style, but some Windows CRLF endings.\n> \n> A few tests.\n>  - I set core.autocrlf=input globally --> a fresh clone doesn't have a\n> clean status files look modified right after a clone)\n>  - set core.autocrlf=false globally --> a fresh clone doesn't have a\n> clean status\n>  - set core.autocrlf=true globally --> a fresh clone doesn't have a clean status\n> \n> This is git v2.23.0 from Homebrew.\n> \n> Am I doing something wrong? Can git work sanely on a mixed endings\n> repo without having to fix the world first?\n> \n> ... I do strive to fix the world (and this small repository), as we\n> all do, but it should not be a preconditions before git behaves\n> sanely.\n\nDoes this repository have a .gitattributes file and if so, is there any\ncorrelation between the patterns in that file and the modified files?\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"399377","messageId":"CACPiFCK0h0LfdyE6Q=UJkuX+Qdb=rULcgDJwgxQ0w-1O0zpMew@mail.gmail.com","threadId":"53642","inReplyTo":"20200609231336.GQ6569@camp.crustytoothpaste.net","subject":"Re: osx autocrlf sanity?","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2020-06-09T23:31:23Z","receivedAt":"2020-06-09T23:31:41Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"Hi Brian,\n\ngood question! There is a .gitattributes file, all the files affected\nhave these attributes\n\n*.py     text diff=python\n\nregards,\n\n\nmartin\n\nOn Tue, Jun 9, 2020 at 7:14 PM brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n>\n> On 2020-06-09 at 19:52:42, Martin Langhoff wrote:\n> > Hi git list,\n> >\n> > long time no see! I am here to ask for a sanity check. I'm on OSX.\n> > Checking out a repository that has an un-controlled mix of line\n> > endings. Mostly linux-style, but some Windows CRLF endings.\n> >\n> > A few tests.\n> >  - I set core.autocrlf=input globally --> a fresh clone doesn't have a\n> > clean status files look modified right after a clone)\n> >  - set core.autocrlf=false globally --> a fresh clone doesn't have a\n> > clean status\n> >  - set core.autocrlf=true globally --> a fresh clone doesn't have a clean status\n> >\n> > This is git v2.23.0 from Homebrew.\n> >\n> > Am I doing something wrong? Can git work sanely on a mixed endings\n> > repo without having to fix the world first?\n> >\n> > ... I do strive to fix the world (and this small repository), as we\n> > all do, but it should not be a preconditions before git behaves\n> > sanely.\n>\n> Does this repository have a .gitattributes file and if so, is there any\n> correlation between the patterns in that file and the modified files?\n> --\n> brian m. carlson: Houston, Texas, US\n> OpenPGP: https://keybase.io/bk2204\n\n\n\n-- \n martin.langhoff@gmail.com\n - ask interesting questions  ~  http://linkedin.com/in/martinlanghoff\n - don't be distracted        ~  http://github.com/martin-langhoff\n   by shiny stuff\n"},{"id":"399379","messageId":"20200610000358.GR6569@camp.crustytoothpaste.net","threadId":"53642","inReplyTo":"CACPiFCK0h0LfdyE6Q=UJkuX+Qdb=rULcgDJwgxQ0w-1O0zpMew@mail.gmail.com","subject":"Re: osx autocrlf sanity?","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-06-10T00:03:58Z","receivedAt":"2020-06-10T00:04:36Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-06-09 at 23:31:23, Martin Langhoff wrote:\n> Hi Brian,\n> \n> good question! There is a .gitattributes file, all the files affected\n> have these attributes\n> \n> *.py     text diff=python\n\nBy default, Git will check out files with the text attribute with the\nnative line ending, and it will check them in with LF endings.  That can\nbe controlled by core.eol and core.autocrlf.\n\nIf the file in the repository (as shown by a \"git show HEAD:filename\")\nhas CRLF endings (usually less shows this as \"^M\"), then the user has\ndone something naughty by overriding the .gitattributes file with local\noverrides and checking data in nevertheless.  If so, you'll have\nproblems on a Unix system pretty much regardless, unless you set\ncore.eol to \"crlf\", in which case you'll get all CRLF files.\n\nIt may be instructive to run \"git diff --ws-error-highlight=all\" to see\nwhat the changes are in the working tree compared to what's checked in.\nI suspect it will probably be line endings only.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"399407","messageId":"CACPiFCKEGXK+TJtQiPub3dW6dYKJ7a=mXL+UCDP57N-3XtRYLg@mail.gmail.com","threadId":"53642","inReplyTo":"20200610000358.GR6569@camp.crustytoothpaste.net","subject":"Re: osx autocrlf sanity?","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2020-06-10T13:55:12Z","receivedAt":"2020-06-10T13:55:27Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On Tue, Jun 9, 2020 at 8:04 PM brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n> On 2020-06-09 at 23:31:23, Martin Langhoff wrote:\n> > good question! There is a .gitattributes file, all the files affected\n> > have these attributes\n> >\n> > *.py     text diff=python\n>\n> By default, Git will check out files with the text attribute with the\n> native line ending, and it will check them in with LF endings.  That can\n> be controlled by core.eol and core.autocrlf\n\nWhy is core.autocrlf false not working for me?\n\nI want to work on a repo that has a mix of newlines. I'd like git to\ncompletely ignore them. Treat all files as a bag'o'bytes.\n\nAssume I am running git rebase over commits that have .gitattributes,\nso I can't \"just remove it\".\n\nregards,\n\n\n\nm\n-- \n martin.langhoff@gmail.com\n - ask interesting questions  ~  http://linkedin.com/in/martinlanghoff\n - don't be distracted        ~  http://github.com/martin-langhoff\n   by shiny stuff\n"},{"id":"399408","messageId":"027001d63f2f$622f2d00$268d8700$@nexbridge.com","threadId":"53642","inReplyTo":"CACPiFCKEGXK+TJtQiPub3dW6dYKJ7a=mXL+UCDP57N-3XtRYLg@mail.gmail.com","subject":"RE: osx autocrlf sanity?","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2020-06-10T13:59:34Z","receivedAt":"2020-06-10T13:59:54Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On June 10, 2020 9:55 AM, Martin Langhoff wrote:\n> To: brian m. carlson <sandals@crustytoothpaste.net>; Martin Langhoff\n> <martin.langhoff@gmail.com>; Git Mailing List <git@vger.kernel.org>\n> Subject: Re: osx autocrlf sanity?\n> \n> On Tue, Jun 9, 2020 at 8:04 PM brian m. carlson\n> <sandals@crustytoothpaste.net> wrote:\n> > On 2020-06-09 at 23:31:23, Martin Langhoff wrote:\n> > > good question! There is a .gitattributes file, all the files\n> > > affected have these attributes\n> > >\n> > > *.py     text diff=python\n> >\n> > By default, Git will check out files with the text attribute with the\n> > native line ending, and it will check them in with LF endings.  That\n> > can be controlled by core.eol and core.autocrlf\n> \n> Why is core.autocrlf false not working for me?\n> \n> I want to work on a repo that has a mix of newlines. I'd like git to completely\n> ignore them. Treat all files as a bag'o'bytes.\n> \n> Assume I am running git rebase over commits that have .gitattributes, so I\n> can't \"just remove it\".\n\nWe use core.autocrlf=input on all our platforms for source files, including OSX.\n\nDoes that work for you?\n\nRegards,\nRandall\n\n-- Brief whoami:\n NonStop developer since approximately 211288444200000000\n UNIX developer since approximately 421664400\n-- In my real life, I talk too much.\n\n\n\n"},{"id":"399409","messageId":"CACPiFCLEgaCiE_LjdvQLhpFXU2XEZ1gpFEDrMkdwF+p=qPJ3Eg@mail.gmail.com","threadId":"53642","inReplyTo":"027001d63f2f$622f2d00$268d8700$@nexbridge.com","subject":"Re: osx autocrlf sanity?","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2020-06-10T14:19:11Z","receivedAt":"2020-06-10T14:19:26Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"From my original post -\n\nA few tests.\n - I set core.autocrlf=input globally --> a fresh clone doesn't have a\nclean status files look modified right after a clone)\n - set core.autocrlf=false globally --> a fresh clone doesn't have a\nclean status\n - set core.autocrlf=true globally --> a fresh clone doesn't have a clean status\n\n... I was an early contributor to git, so I am hopefully not too naive\nabout the basics. Of course, I sometimes make a boneheaded mistake.\n\ncheers,\n\n\nm\n\nOn Wed, Jun 10, 2020 at 9:59 AM Randall S. Becker\n<rsbecker@nexbridge.com> wrote:\n>\n> On June 10, 2020 9:55 AM, Martin Langhoff wrote:\n> > To: brian m. carlson <sandals@crustytoothpaste.net>; Martin Langhoff\n> > <martin.langhoff@gmail.com>; Git Mailing List <git@vger.kernel.org>\n> > Subject: Re: osx autocrlf sanity?\n> >\n> > On Tue, Jun 9, 2020 at 8:04 PM brian m. carlson\n> > <sandals@crustytoothpaste.net> wrote:\n> > > On 2020-06-09 at 23:31:23, Martin Langhoff wrote:\n> > > > good question! There is a .gitattributes file, all the files\n> > > > affected have these attributes\n> > > >\n> > > > *.py     text diff=python\n> > >\n> > > By default, Git will check out files with the text attribute with the\n> > > native line ending, and it will check them in with LF endings.  That\n> > > can be controlled by core.eol and core.autocrlf\n> >\n> > Why is core.autocrlf false not working for me?\n> >\n> > I want to work on a repo that has a mix of newlines. I'd like git to completely\n> > ignore them. Treat all files as a bag'o'bytes.\n> >\n> > Assume I am running git rebase over commits that have .gitattributes, so I\n> > can't \"just remove it\".\n>\n> We use core.autocrlf=input on all our platforms for source files, including OSX.\n>\n> Does that work for you?\n>\n> Regards,\n> Randall\n>\n> -- Brief whoami:\n>  NonStop developer since approximately 211288444200000000\n>  UNIX developer since approximately 421664400\n> -- In my real life, I talk too much.\n>\n>\n>\n\n\n-- \n martin.langhoff@gmail.com\n - ask interesting questions  ~  http://linkedin.com/in/martinlanghoff\n - don't be distracted        ~  http://github.com/martin-langhoff\n   by shiny stuff\n"},{"id":"399410","messageId":"20200610143404.5sgww2fmsouubloj@tb-raspi4","threadId":"53642","inReplyTo":"CACPiFCK0h0LfdyE6Q=UJkuX+Qdb=rULcgDJwgxQ0w-1O0zpMew@mail.gmail.com","subject":"Re: osx autocrlf sanity?","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2020-06-10T14:34:04Z","receivedAt":"2020-06-10T14:34:16Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On Tue, Jun 09, 2020 at 07:31:23PM -0400, Martin Langhoff wrote:\n> Hi Brian,\n>\n> good question! There is a .gitattributes file, all the files affected\n> have these attributes\n>\n> *.py     text diff=python\n\nThat is the important information, that we need.\nSince there is a .gitattributes file, (wich is good),\nyou can forget about core.autocrlf (at least for all python files).\n(That should be clear from the documentation of Git,\n but it could be, that we can make things more clear).\n\nThere is only one way out of this dilemma:\nrenormalize the line endings in the repo (and live a happier life ;-)\n\nhttps://git-scm.com/docs/git-add\n\nSorry to say it this short, this has nothing to do with OSX,\nit is the repo itself, which needs the renormalization.\n\n>\n> regards,\n>\n>\n> martin\n>\n> On Tue, Jun 9, 2020 at 7:14 PM brian m. carlson\n> <sandals@crustytoothpaste.net> wrote:\n> >\n> > On 2020-06-09 at 19:52:42, Martin Langhoff wrote:\n> > > Hi git list,\n> > >\n> > > long time no see! I am here to ask for a sanity check. I'm on OSX.\n> > > Checking out a repository that has an un-controlled mix of line\n> > > endings. Mostly linux-style, but some Windows CRLF endings.\n> > >\n> > > A few tests.\n> > >  - I set core.autocrlf=input globally --> a fresh clone doesn't have a\n> > > clean status files look modified right after a clone)\n> > >  - set core.autocrlf=false globally --> a fresh clone doesn't have a\n> > > clean status\n> > >  - set core.autocrlf=true globally --> a fresh clone doesn't have a clean status\n> > >\n> > > This is git v2.23.0 from Homebrew.\n> > >\n> > > Am I doing something wrong? Can git work sanely on a mixed endings\n> > > repo without having to fix the world first?\n> > >\n> > > ... I do strive to fix the world (and this small repository), as we\n> > > all do, but it should not be a preconditions before git behaves\n> > > sanely.\n> >\n> > Does this repository have a .gitattributes file and if so, is there any\n> > correlation between the patterns in that file and the modified files?\n> > --\n> > brian m. carlson: Houston, Texas, US\n> > OpenPGP: https://keybase.io/bk2204\n>\n>\n>\n> --\n>  martin.langhoff@gmail.com\n>  - ask interesting questions  ~  http://linkedin.com/in/martinlanghoff\n>  - don't be distracted        ~  http://github.com/martin-langhoff\n>    by shiny stuff\n"},{"id":"399411","messageId":"CACPiFCJe=LR7cUWyUjq4cCOrnGZ+9iPZspF_mtswN+Y2rOtO+A@mail.gmail.com","threadId":"53642","inReplyTo":"20200610143404.5sgww2fmsouubloj@tb-raspi4","subject":"Re: osx autocrlf sanity?","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2020-06-10T14:51:48Z","receivedAt":"2020-06-10T14:52:01Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On Wed, Jun 10, 2020 at 10:34 AM Torsten Bögershausen <tboegi@web.de> wrote:\n> There is only one way out of this dilemma:\n> renormalize the line endings in the repo (and live a happier life ;-)\n\nthat's not a useful answer for me.\n\ngit used to be extremely good treating all files as a bag of bytes,\nnot trying to interpret them. How can I get that?\n\nregards,\n\n\nm\n-- \n martin.langhoff@gmail.com\n - ask interesting questions  ~  http://linkedin.com/in/martinlanghoff\n - don't be distracted        ~  http://github.com/martin-langhoff\n   by shiny stuff\n"},{"id":"399419","messageId":"xmqqmu5ag89w.fsf@gitster.c.googlers.com","threadId":"53642","inReplyTo":"20200610143404.5sgww2fmsouubloj@tb-raspi4","subject":"Re: osx autocrlf sanity?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-06-10T17:06:35Z","receivedAt":"2020-06-10T17:06:40Z","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> On Tue, Jun 09, 2020 at 07:31:23PM -0400, Martin Langhoff wrote:\n>> Hi Brian,\n>>\n>> good question! There is a .gitattributes file, all the files affected\n>> have these attributes\n>>\n>> *.py     text diff=python\n>\n> That is the important information, that we need.\n> Since there is a .gitattributes file, (wich is good),\n> you can forget about core.autocrlf (at least for all python files).\n> (That should be clear from the documentation of Git,\n>  but it could be, that we can make things more clear).\n\nSo a \"text\" attribute trumps the settings of autocrlf?  That makes\nit sound like ...\n\n> There is only one way out of this dilemma:\n> renormalize the line endings in the repo (and live a happier life ;-)\n\n... there is another way out, which is to drop \"text\" attribute?\n"},{"id":"399479","messageId":"20200610235337.GW6569@camp.crustytoothpaste.net","threadId":"53642","inReplyTo":"CACPiFCKEGXK+TJtQiPub3dW6dYKJ7a=mXL+UCDP57N-3XtRYLg@mail.gmail.com","subject":"Re: osx autocrlf sanity?","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-06-10T23:53:37Z","receivedAt":"2020-06-10T23:54:15Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-06-10 at 13:55:12, Martin Langhoff wrote:\n> On Tue, Jun 9, 2020 at 8:04 PM brian m. carlson\n> <sandals@crustytoothpaste.net> wrote:\n> > On 2020-06-09 at 23:31:23, Martin Langhoff wrote:\n> > > good question! There is a .gitattributes file, all the files affected\n> > > have these attributes\n> > >\n> > > *.py     text diff=python\n> >\n> > By default, Git will check out files with the text attribute with the\n> > native line ending, and it will check them in with LF endings.  That can\n> > be controlled by core.eol and core.autocrlf\n> \n> Why is core.autocrlf false not working for me?\n\ncore.autocrlf to false means that it is disabled and has no effect.\ncore.eol defaults to \"lf\" on Unix systems and \"crlf\" on Windows, and is\nused even when core.autocrlf is disabled.\n\n> I want to work on a repo that has a mix of newlines. I'd like git to\n> completely ignore them. Treat all files as a bag'o'bytes.\n\nThen you need to use plumbing commands like git cat-file.  You could\nalso write a .git/info/attributes file that contains the following:\n\n    *.py !text\n\nor\n\n    * !text\n\nwhich will override the file in the repository.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"}]}