{"thread":{"id":"16762","subject":"white spaces in a patch","startedAt":"2008-12-17T07:31:06Z","lastAt":"2008-12-17T20:02:51Z","messageCount":12,"participants":["Mark Ryden","Junio C Hamano","Johannes Schindelin","Thomas Jarosch","Sverre Rabbelier","Jeff King","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"98099","messageId":"dac45060812162331k19272488r4e95e0555e7a6db9@mail.gmail.com","threadId":"16762","inReplyTo":null,"subject":"white spaces in a patch","fromName":"Mark Ryden","fromEmail":"markryde@gmail.com","sentAt":"2008-12-17T07:31:06Z","receivedAt":"2008-12-17T07:31:06Z","isPatch":false,"sender":{"key":"markryde@gmail.com","avatar":null},"body":"Hello,\n\nIt occurred to me that I prepared some patch for a git tree, and\nthen when testing git-apply on it (on the original tree) I saw\nsome \"white spaces\" errors.\nI know that I can run:\n\"git --whitespace=fix apply\" on my patch and than create the patch\nagain ; in this way it will be created without white spaces.\n\nSuppose I create a patch file (let's say : patch.txt)\n1) Is there a way to check whether there are white spaces in this\nfile without running git-apply?\n2) Is there a way to get some messages about that there are white spaces\nwhen creating a git patch?\n\nRegards,\nMark\n"},{"id":"98101","messageId":"7vej07p84i.fsf@gitster.siamese.dyndns.org","threadId":"16762","inReplyTo":"dac45060812162331k19272488r4e95e0555e7a6db9@mail.gmail.com","subject":"Re: white spaces in a patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-12-17T07:34:53Z","receivedAt":"2008-12-17T07:34:53Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Mark Ryden\" <markryde@gmail.com> writes:\n\n> 1) Is there a way to check whether there are white spaces in this\n> file without running git-apply?\n\n\"sed -n -e '/^+.*[ \t]$/p' patch.txt\" perhaps?\n\n> 2) Is there a way to get some messages about that there are white spaces\n> when creating a git patch?\n\nDoesn't \"git diff\" highlight whitespace errors?  That way, you can catch\nerrors  before you make a commit that has them.\n"},{"id":"98124","messageId":"dac45060812170344u368ffd7fx4e86253b4a13ffc7@mail.gmail.com","threadId":"16762","inReplyTo":"7vej07p84i.fsf@gitster.siamese.dyndns.org","subject":"Re: white spaces in a patch","fromName":"Mark Ryden","fromEmail":"markryde@gmail.com","sentAt":"2008-12-17T11:44:01Z","receivedAt":"2008-12-17T11:44:01Z","isPatch":false,"sender":{"key":"markryde@gmail.com","avatar":null},"body":"Hello,\n\nI tried:\ngit apply patch1.txt\npatch1.txt:34: trailing whitespace.\n\t\t\t\t\npatch1.txt:53: trailing whitespace.\n\nAnd\n\"git diff\"  show differences but **does not**\nhighlight anything.\nI tried in tchs and in Bash.\n\nAny ideas ? does \"git diff\" does  highlight for anyone ?\n\nRgs,\nMark\n\n\nOn Wed, Dec 17, 2008 at 9:34 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Mark Ryden\" <markryde@gmail.com> writes:\n>\n>> 1) Is there a way to check whether there are white spaces in this\n>> file without running git-apply?\n>\n> \"sed -n -e '/^+.*[      ]$/p' patch.txt\" perhaps?\n>\n>> 2) Is there a way to get some messages about that there are white spaces\n>> when creating a git patch?\n>\n> Doesn't \"git diff\" highlight whitespace errors?  That way, you can catch\n> errors  before you make a commit that has them.\n>\n"},{"id":"98128","messageId":"alpine.DEB.1.00.0812171307460.28560@intel-tinevez-2-302","threadId":"16762","inReplyTo":"7vej07p84i.fsf@gitster.siamese.dyndns.org","subject":"Re: white spaces in a patch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-12-17T12:08:17Z","receivedAt":"2008-12-17T12:08:17Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 16 Dec 2008, Junio C Hamano wrote:\n\n> \"Mark Ryden\" <markryde@gmail.com> writes:\n> \n> > 2) Is there a way to get some messages about that there are white \n> >    spaces when creating a git patch?\n> \n> Doesn't \"git diff\" highlight whitespace errors?  That way, you can catch \n> errors before you make a commit that has them.\n\nNot to mention \"git diff --check\", which should catch them, too.\n\nCiao,\nDscho\n"},{"id":"98129","messageId":"dac45060812170410h20e710b0ted10d46b9b96ac9d@mail.gmail.com","threadId":"16762","inReplyTo":"alpine.DEB.1.00.0812171307460.28560@intel-tinevez-2-302","subject":"Re: white spaces in a patch","fromName":"Mark Ryden","fromEmail":"markryde@gmail.com","sentAt":"2008-12-17T12:10:54Z","receivedAt":"2008-12-17T12:10:54Z","isPatch":false,"sender":{"key":"markryde@gmail.com","avatar":null},"body":"Hello,\nThanks!\n\n\"git diff --check\" indeed tells about trailing whitespace\nMark\n\nOn Wed, Dec 17, 2008 at 2:08 PM, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n>\n> On Tue, 16 Dec 2008, Junio C Hamano wrote:\n>\n>> \"Mark Ryden\" <markryde@gmail.com> writes:\n>>\n>> > 2) Is there a way to get some messages about that there are white\n>> >    spaces when creating a git patch?\n>>\n>> Doesn't \"git diff\" highlight whitespace errors?  That way, you can catch\n>> errors before you make a commit that has them.\n>\n> Not to mention \"git diff --check\", which should catch them, too.\n>\n> Ciao,\n> Dscho\n>\n>\n"},{"id":"98134","messageId":"bd6139dc0812170413j5ed2d9eak89df8517bc91c5fd@mail.gmail.com","threadId":"16762","inReplyTo":"dac45060812170344u368ffd7fx4e86253b4a13ffc7@mail.gmail.com","subject":"Re: white spaces in a patch","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2008-12-17T12:13:01Z","receivedAt":"2008-12-17T12:13:01Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"On Wed, Dec 17, 2008 at 12:44, Mark Ryden <markryde@gmail.com> wrote:\n> Any ideas ? does \"git diff\" does  highlight for anyone ?\n\nDo you have color on?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"98131","messageId":"dac45060812170413w7c8cffaifa1a0f3b649474e4@mail.gmail.com","threadId":"16762","inReplyTo":"bd6139dc0812170413j5ed2d9eak89df8517bc91c5fd@mail.gmail.com","subject":"Re: white spaces in a patch","fromName":"Mark Ryden","fromEmail":"markryde@gmail.com","sentAt":"2008-12-17T12:13:34Z","receivedAt":"2008-12-17T12:13:34Z","isPatch":false,"sender":{"key":"markryde@gmail.com","avatar":null},"body":"What do you mean ?\nwhere ? how ?\nMark\n\nOn Wed, Dec 17, 2008 at 2:13 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n> On Wed, Dec 17, 2008 at 12:44, Mark Ryden <markryde@gmail.com> wrote:\n>> Any ideas ? does \"git diff\" does  highlight for anyone ?\n>\n> Do you have color on?\n>\n> --\n> Cheers,\n>\n> Sverre Rabbelier\n>\n"},{"id":"98132","messageId":"200812171316.21531.thomas.jarosch@intra2net.com","threadId":"16762","inReplyTo":"dac45060812170413w7c8cffaifa1a0f3b649474e4@mail.gmail.com","subject":"Re: white spaces in a patch","fromName":"Thomas Jarosch","fromEmail":"thomas.jarosch@intra2net.com","sentAt":"2008-12-17T12:15:56Z","receivedAt":"2008-12-17T12:15:56Z","isPatch":false,"sender":{"key":"thomas.jarosch@intra2net.com","avatar":"https://avatars.githubusercontent.com/u/1146758?v=4"},"body":"On Wednesday, 17. December 2008 13:13:34 Mark Ryden wrote:\n[colors in diff]\n> What do you mean ?\n> where ? how ?\n\nThis should do the trick:\n\ngit config --global color.diff auto\ngit config --global color.status auto\ngit config --global color.branch auto\n\nThomas\n"},{"id":"98133","messageId":"bd6139dc0812170416w5e2cc537v6143b6071f9b8225@mail.gmail.com","threadId":"16762","inReplyTo":"dac45060812170413w7c8cffaifa1a0f3b649474e4@mail.gmail.com","subject":"Re: white spaces in a patch","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2008-12-17T12:16:43Z","receivedAt":"2008-12-17T12:16:43Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"On Wed, Dec 17, 2008 at 13:13, Mark Ryden <markryde@gmail.com> wrote:\n> On Wed, Dec 17, 2008 at 2:13 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n>> Do you have color on?\n\n$ git config color.diff true\n\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"98138","messageId":"dac45060812170422yc259d39vd1b198c1530a40a5@mail.gmail.com","threadId":"16762","inReplyTo":"200812171316.21531.thomas.jarosch@intra2net.com","subject":"Re: white spaces in a patch","fromName":"Mark Ryden","fromEmail":"markryde@gmail.com","sentAt":"2008-12-17T12:22:30Z","receivedAt":"2008-12-17T12:22:30Z","isPatch":false,"sender":{"key":"markryde@gmail.com","avatar":null},"body":"Thnks!\nIn fact, the first line was enough!\ngit config --global color.diff auto\nMark\n\n\n\nOn Wed, Dec 17, 2008 at 2:15 PM, Thomas Jarosch\n<thomas.jarosch@intra2net.com> wrote:\n> On Wednesday, 17. December 2008 13:13:34 Mark Ryden wrote:\n> [colors in diff]\n>> What do you mean ?\n>> where ? how ?\n>\n> This should do the trick:\n>\n> git config --global color.diff auto\n> git config --global color.status auto\n> git config --global color.branch auto\n>\n> Thomas\n>\n>\n"},{"id":"98136","messageId":"20081217122240.GA14342@coredump.intra.peff.net","threadId":"16762","inReplyTo":"200812171316.21531.thomas.jarosch@intra2net.com","subject":"Re: white spaces in a patch","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-12-17T12:22:41Z","receivedAt":"2008-12-17T12:22:41Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Dec 17, 2008 at 01:15:56PM +0100, Thomas Jarosch wrote:\n\n> This should do the trick:\n> \n> git config --global color.diff auto\n> git config --global color.status auto\n> git config --global color.branch auto\n\nThese days we have\n\n  git config --global color.ui auto\n\n-Peff\n"},{"id":"98172","messageId":"vpqljuelgd0.fsf@bauges.imag.fr","threadId":"16762","inReplyTo":"dac45060812170422yc259d39vd1b198c1530a40a5@mail.gmail.com","subject":"Re: white spaces in a patch","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-12-17T20:02:51Z","receivedAt":"2008-12-17T20:02:51Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"\"Mark Ryden\" <markryde@gmail.com> writes:\n\n> Thnks!\n> In fact, the first line was enough!\n> git config --global color.diff auto\n\nYes, but you may appreciate color in other commands (log,\nstatus, ...).  Then, \"color.ui = auto\" is your friend.\n\n-- \nMatthieu\n"}]}