{"thread":{"id":"13651","subject":"git-diff cr/nl files on linux","startedAt":"2008-05-24T12:54:09Z","lastAt":"2008-05-26T08:04:45Z","messageCount":6,"participants":["Nguyen Thai Ngoc Duy","Dirk Süsserott","Junio C Hamano","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"77654","messageId":"fcaeb9bf0805240554j71693d5eo2a425ee0efe2f364@mail.gmail.com","threadId":"13651","inReplyTo":null,"subject":"git-diff cr/nl files on linux","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2008-05-24T12:54:09Z","receivedAt":"2008-05-24T12:54:09Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Hi,\n\nIs there any way that can make git-diff show cr/nl ending files on\nlinux without ^M at the end?\n\nThanks\n-- \nDuy\n"},{"id":"77655","messageId":"483811BF.3090302@dirk.my1.cc","threadId":"13651","inReplyTo":"fcaeb9bf0805240554j71693d5eo2a425ee0efe2f364@mail.gmail.com","subject":"Re: git-diff cr/nl files on linux","fromName":"Dirk Süsserott","fromEmail":"newsletter@dirk.my1.cc","sentAt":"2008-05-24T13:01:51Z","receivedAt":"2008-05-24T13:01:51Z","isPatch":false,"sender":{"key":"newsletter@dirk.my1.cc","avatar":null},"body":"Nguyen Thai Ngoc Duy schrieb:\n> Hi,\n>\n> Is there any way that can make git-diff show cr/nl ending files on\n> linux without ^M at the end?\n>\n> Thanks\n>   \nWhat about 'git diff -w'? It drops any whitespace changes, including ^M's.\nNot sure whether that is what you meant.\n"},{"id":"77737","messageId":"fcaeb9bf0805252115q60f784aax6b1f267c476960b4@mail.gmail.com","threadId":"13651","inReplyTo":"483811BF.3090302@dirk.my1.cc","subject":"Re: git-diff cr/nl files on linux","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2008-05-26T04:15:10Z","receivedAt":"2008-05-26T04:15:10Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, May 24, 2008 at 8:01 PM, Dirk Süsserott <newsletter@dirk.my1.cc> wrote:\n> Nguyen Thai Ngoc Duy schrieb:\n>>\n>> Hi,\n>>\n>> Is there any way that can make git-diff show cr/nl ending files on\n>> linux without ^M at the end?\n>>\n>> Thanks\n>>\n>\n> What about 'git diff -w'? It drops any whitespace changes, including ^M's.\n> Not sure whether that is what you meant.\n\nThat won't help. Here is a snippet of what I see:\n\ndiff --git a/abc.c b/abc.c\nindex 064a769..647b9ae 100644\n--- a/abc.c\n+++ b/abc.c\n@@ -859,7 +859,10 @@ int def\n     )\n     {\n     FAST int asdsa;\n-    FAST int dsdsad;\n+    FAST int dsadadd;          /* ERROR also means AASAS */^M\n+#ifndef JHASHJJH^M\n+    struct sdddd dasdada;^M\n+#endif^M\n     union sddd asdsdad;\n     FAST STATUS dsadadad;\n     unsigned int sdadadad = 0;\n\nWith color turning off, it does not show ^M so probably something to\ndo with the coloring. less is at version 394.\n-- \nDuy\n"},{"id":"77739","messageId":"7vskw5el55.fsf@gitster.siamese.dyndns.org","threadId":"13651","inReplyTo":"fcaeb9bf0805252115q60f784aax6b1f267c476960b4@mail.gmail.com","subject":"Re: git-diff cr/nl files on linux","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-26T04:37:10Z","receivedAt":"2008-05-26T04:37:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Nguyen Thai Ngoc Duy\" <pclouds@gmail.com> writes:\n\n> On Sat, May 24, 2008 at 8:01 PM, Dirk Süsserott <newsletter@dirk.my1.cc> wrote:\n> ...\n>> What about 'git diff -w'? It drops any whitespace changes, including ^M's.\n>> Not sure whether that is what you meant.\n>\n> That won't help.\n\nJust like GNU diff, the only thing -w (and -b) does is to omit hunks whose\nchanges consist of _only whitespace changes_ and nothing else.\n\nIn your quoted example, you have changes other than whitespace changes, so\nit is unsurprising that you will see the whole change, together with your\nwhitespace changes.\n"},{"id":"77746","messageId":"483A59FD.6020906@viscovery.net","threadId":"13651","inReplyTo":"fcaeb9bf0805252115q60f784aax6b1f267c476960b4@mail.gmail.com","subject":"Re: git-diff cr/nl files on linux","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-05-26T06:34:37Z","receivedAt":"2008-05-26T06:34:37Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Nguyen Thai Ngoc Duy schrieb:\n> On Sat, May 24, 2008 at 8:01 PM, Dirk Süsserott <newsletter@dirk.my1.cc> wrote:\n>> Nguyen Thai Ngoc Duy schrieb:\n>>> Hi,\n>>>\n>>> Is there any way that can make git-diff show cr/nl ending files on\n>>> linux without ^M at the end?\n>>>\n>>> Thanks\n>>>\n>> What about 'git diff -w'? It drops any whitespace changes, including ^M's.\n>> Not sure whether that is what you meant.\n> \n> That won't help. Here is a snippet of what I see:\n> \n> diff --git a/abc.c b/abc.c\n> index 064a769..647b9ae 100644\n> --- a/abc.c\n> +++ b/abc.c\n> @@ -859,7 +859,10 @@ int def\n>      )\n>      {\n>      FAST int asdsa;\n> -    FAST int dsdsad;\n> +    FAST int dsadadd;          /* ERROR also means AASAS */^M\n> +#ifndef JHASHJJH^M\n> +    struct sdddd dasdada;^M\n> +#endif^M\n>      union sddd asdsdad;\n>      FAST STATUS dsadadad;\n>      unsigned int sdadadad = 0;\n> \n> With color turning off, it does not show ^M so probably something to\n> do with the coloring. less is at version 394.\n\nless does not show \\r if it comes right before \\n. But with diff-coloring\nturned on, the 'reset color' sequence is inserted between \\r and \\n; now\nless shows ^M for the \\r because it's not next to the \\n anymore.\n\n-- Hannes\n"},{"id":"77748","messageId":"fcaeb9bf0805260104p72828318p202d3bceaa676daa@mail.gmail.com","threadId":"13651","inReplyTo":"483A59FD.6020906@viscovery.net","subject":"Re: git-diff cr/nl files on linux","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2008-05-26T08:04:45Z","receivedAt":"2008-05-26T08:04:45Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, May 26, 2008 at 1:34 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> Nguyen Thai Ngoc Duy schrieb:\n>> On Sat, May 24, 2008 at 8:01 PM, Dirk Süsserott <newsletter@dirk.my1.cc> wrote:\n>>> Nguyen Thai Ngoc Duy schrieb:\n>>>> Hi,\n>>>>\n>>>> Is there any way that can make git-diff show cr/nl ending files on\n>>>> linux without ^M at the end?\n>>>>\n>>>> Thanks\n>>>>\n>>> What about 'git diff -w'? It drops any whitespace changes, including ^M's.\n>>> Not sure whether that is what you meant.\n>>\n>> That won't help. Here is a snippet of what I see:\n>>\n>> diff --git a/abc.c b/abc.c\n>> index 064a769..647b9ae 100644\n>> --- a/abc.c\n>> +++ b/abc.c\n>> @@ -859,7 +859,10 @@ int def\n>>      )\n>>      {\n>>      FAST int asdsa;\n>> -    FAST int dsdsad;\n>> +    FAST int dsadadd;          /* ERROR also means AASAS */^M\n>> +#ifndef JHASHJJH^M\n>> +    struct sdddd dasdada;^M\n>> +#endif^M\n>>      union sddd asdsdad;\n>>      FAST STATUS dsadadad;\n>>      unsigned int sdadadad = 0;\n>>\n>> With color turning off, it does not show ^M so probably something to\n>> do with the coloring. less is at version 394.\n>\n> less does not show \\r if it comes right before \\n. But with diff-coloring\n> turned on, the 'reset color' sequence is inserted between \\r and \\n; now\n> less shows ^M for the \\r because it's not next to the \\n anymore.\n>\n\nRight. And setting core.whitespace = cr-at-eol fixes it (although\ndifficult to find). Thank you all.\n\n> -- Hannes\n>\n\n\n\n-- \nDuy\n"}]}