{"thread":{"id":"48674","subject":"is there a canonical doc about how to deal with whitespace issues?","startedAt":"2018-06-08T13:20:56Z","lastAt":"2018-06-13T12:29:12Z","messageCount":4,"participants":["Robert P. J. Day","Derrick Stolee","Stefan Beller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"349693","messageId":"alpine.LFD.2.21.1806080914520.20892@localhost.localdomain","threadId":"48674","inReplyTo":null,"subject":"is there a canonical doc about how to deal with whitespace issues?","fromName":"Robert P. J. Day","fromEmail":"rpjday@crashcourse.ca","sentAt":"2018-06-08T13:18:20Z","receivedAt":"2018-06-08T13:20:56Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"\n  for one of my courses, i wanted to write a section about the various\ntechniques for dealing with whitespace issues in git, so i started\nmaking a list, things like:\n\n  - running \"git diff --check\"\n  - \"git commit --cleanup=\" possibilities\n  - config options like core.{eol,safecrlf,autocrlf}\n  - i'm sure there are client-side hooks that can be mentioned\n\netc, etc.\n\n  has anyone ever written a doc that collects these things in one\nplace? if not, i guess i have to write one.\n\nrday\n\n-- \n\n========================================================================\nRobert P. J. Day                                 Ottawa, Ontario, CANADA\n                  http://crashcourse.ca/dokuwiki\n\nTwitter:                                       http://twitter.com/rpjday\nLinkedIn:                               http://ca.linkedin.com/in/rpjday\n========================================================================\n"},{"id":"349724","messageId":"b8801d73-71c4-15c8-4b29-8e4edb3faec9@gmail.com","threadId":"48674","inReplyTo":"alpine.LFD.2.21.1806080914520.20892@localhost.localdomain","subject":"Re: is there a canonical doc about how to deal with whitespace issues?","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2018-06-08T17:15:15Z","receivedAt":"2018-06-08T17:15:21Z","isPatch":false,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 6/8/2018 9:18 AM, Robert P. J. Day wrote:\n>    for one of my courses, i wanted to write a section about the various\n> techniques for dealing with whitespace issues in git, so i started\n> making a list, things like:\n>\n>    - running \"git diff --check\"\n>    - \"git commit --cleanup=\" possibilities\n>    - config options like core.{eol,safecrlf,autocrlf}\n>    - i'm sure there are client-side hooks that can be mentioned\n>\n> etc, etc.\n>\n>    has anyone ever written a doc that collects these things in one\n> place? if not, i guess i have to write one.\n>\n> rday\n>\n\nI don't know of a doc for whitespace issues, but the contributing guide \non GitForWindows [1] recommends `git rebase --whitespace=fix`.\n\nThanks,\n-Stolee\n\n[1] \nhttps://github.com/git-for-windows/git/blob/master/CONTRIBUTING.md#polish-your-commits\n"},{"id":"349947","messageId":"CAGZ79kazegY-udjKfbkfw=ox82cfxhO5E3AEjLKkSt3LMY-DFw@mail.gmail.com","threadId":"48674","inReplyTo":"b8801d73-71c4-15c8-4b29-8e4edb3faec9@gmail.com","subject":"Re: is there a canonical doc about how to deal with whitespace issues?","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-06-11T21:45:59Z","receivedAt":"2018-06-11T21:46:14Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Fri, Jun 8, 2018 at 10:15 AM Derrick Stolee <stolee@gmail.com> wrote:\n>\n> On 6/8/2018 9:18 AM, Robert P. J. Day wrote:\n> >    for one of my courses, i wanted to write a section about the various\n> > techniques for dealing with whitespace issues in git, so i started\n\nWhat do you mean by white space issues?\nThat in itself is a complex topic:\n* There are 3 different modes to ignore white space changes:\n  - trailing whitespaces,\n  - conversion of tab to space and back\n    These two are caught by the default in 'git diff --check'\n  - any white space change\n    This is interesting to ignore in git-blame[1], but sometimes\n    it is actually interesting.\n\n[1] See also\nhttps://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/git-hyper-blame.html\n\n\n\n> > making a list, things like:\n> >\n> >    - running \"git diff --check\"\n> >    - \"git commit --cleanup=\" possibilities\n> >    - config options like core.{eol,safecrlf,autocrlf}\n\nThis sounds more like line ending or cross platform issues\nthan whitespaces (except .eol)\n\n> >    - i'm sure there are client-side hooks that can be mentioned\n\nPersonally I use the defaults when contributing to git.git\nand have an editor setting that removes trailing white spaces.\n\nThat has served me well so far; the only time I was bitten by\nwhite spaces is when sending patches using an email client\nother than git-send-email as the white spaces might get mangled\nthere.\n\nIs sending patches by email part of your course?\n"},{"id":"350052","messageId":"alpine.LFD.2.21.1806130824110.12332@localhost.localdomain","threadId":"48674","inReplyTo":"CAGZ79kazegY-udjKfbkfw=ox82cfxhO5E3AEjLKkSt3LMY-DFw@mail.gmail.com","subject":"Re: is there a canonical doc about how to deal with whitespace issues?","fromName":"Robert P. J. Day","fromEmail":"rpjday@crashcourse.ca","sentAt":"2018-06-13T12:26:34Z","receivedAt":"2018-06-13T12:29:12Z","isPatch":false,"sender":{"key":"rpjday@crashcourse.ca","avatar":"https://avatars.githubusercontent.com/u/226084077?v=4"},"body":"On Mon, 11 Jun 2018, Stefan Beller wrote:\n\n> On Fri, Jun 8, 2018 at 10:15 AM Derrick Stolee <stolee@gmail.com> wrote:\n> >\n> > On 6/8/2018 9:18 AM, Robert P. J. Day wrote:\n> > >    for one of my courses, i wanted to write a section about the\n> > > various techniques for dealing with whitespace issues in git, so\n> > > i started\n>\n> What do you mean by white space issues?\n> That in itself is a complex topic:\n\n  i know ... it's not even clear that just dealing with EOL\nstandardization shouldn't be a topic all by itself.\n\n> * There are 3 different modes to ignore white space changes:\n>   - trailing whitespaces,\n>   - conversion of tab to space and back\n>     These two are caught by the default in 'git diff --check'\n>   - any white space change\n>     This is interesting to ignore in git-blame[1], but sometimes\n>     it is actually interesting.\n>\n> [1] See also\n> https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/git-hyper-blame.html\n>\n>\n>\n> > > making a list, things like:\n> > >\n> > >    - running \"git diff --check\"\n> > >    - \"git commit --cleanup=\" possibilities\n> > >    - config options like core.{eol,safecrlf,autocrlf}\n>\n> This sounds more like line ending or cross platform issues\n> than whitespaces (except .eol)\n\n  i just started a quick-and-dirty wiki page as a reference to things\nthat relate to whitespace:\n\n  http://crashcourse.ca/dokuwiki/doku.php?id=git_whitespace\n\nit's not even *remotely* close to comprehensive, i just wanted to\nstart making a list. feel free to make other suggestions as i keep\nadding to that page.\n\nrday\n\n-- \n\n========================================================================\nRobert P. J. Day                                 Ottawa, Ontario, CANADA\n                  http://crashcourse.ca/dokuwiki\n\nTwitter:                                       http://twitter.com/rpjday\nLinkedIn:                               http://ca.linkedin.com/in/rpjday\n========================================================================\n"}]}