git-diff cr/nl files on linux

5 messages, 3 authors, 2016-06-15 · open the first message on its own page

git-diff cr/nl files on linux

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:44:38

Hi,

Is there any way that can make git-diff show cr/nl ending files on
linux without ^M at the end?

Thanks
-- 
Duy

Re: git-diff cr/nl files on linux

From: Dirk Süsserott <hidden>
Date: 2016-06-15 22:44:38

Nguyen Thai Ngoc Duy schrieb:
Hi,

Is there any way that can make git-diff show cr/nl ending files on
linux without ^M at the end?

Thanks
  
What about 'git diff -w'? It drops any whitespace changes, including ^M's.
Not sure whether that is what you meant.

Re: git-diff cr/nl files on linux

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:44:38

On Sat, May 24, 2008 at 8:01 PM, Dirk Süsserott [off-list ref] wrote:
Nguyen Thai Ngoc Duy schrieb:
quoted
Hi,

Is there any way that can make git-diff show cr/nl ending files on
linux without ^M at the end?

Thanks
What about 'git diff -w'? It drops any whitespace changes, including ^M's.
Not sure whether that is what you meant.
That won't help. Here is a snippet of what I see:
diff --git a/abc.c b/abc.c
index 064a769..647b9ae 100644
--- a/abc.c
+++ b/abc.c
@@ -859,7 +859,10 @@ int def
     )
     {
     FAST int asdsa;
-    FAST int dsdsad;
+    FAST int dsadadd;          /* ERROR also means AASAS */^M
+#ifndef JHASHJJH^M
+    struct sdddd dasdada;^M
+#endif^M
     union sddd asdsdad;
     FAST STATUS dsadadad;
     unsigned int sdadadad = 0;
With color turning off, it does not show ^M so probably something to
do with the coloring. less is at version 394.
-- 
Duy

Re: git-diff cr/nl files on linux

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:44:38

Nguyen Thai Ngoc Duy schrieb:
quoted hunk
On Sat, May 24, 2008 at 8:01 PM, Dirk Süsserott [off-list ref] wrote:
quoted
Nguyen Thai Ngoc Duy schrieb:
quoted
Hi,

Is there any way that can make git-diff show cr/nl ending files on
linux without ^M at the end?

Thanks
What about 'git diff -w'? It drops any whitespace changes, including ^M's.
Not sure whether that is what you meant.
That won't help. Here is a snippet of what I see:
diff --git a/abc.c b/abc.c
index 064a769..647b9ae 100644
--- a/abc.c
+++ b/abc.c
@@ -859,7 +859,10 @@ int def
     )
     {
     FAST int asdsa;
-    FAST int dsdsad;
+    FAST int dsadadd;          /* ERROR also means AASAS */^M
+#ifndef JHASHJJH^M
+    struct sdddd dasdada;^M
+#endif^M
     union sddd asdsdad;
     FAST STATUS dsadadad;
     unsigned int sdadadad = 0;
With color turning off, it does not show ^M so probably something to
do with the coloring. less is at version 394.
less does not show \r if it comes right before \n. But with diff-coloring
turned on, the 'reset color' sequence is inserted between \r and \n; now
less shows ^M for the \r because it's not next to the \n anymore.

-- Hannes

Re: git-diff cr/nl files on linux

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:44:38

On Mon, May 26, 2008 at 1:34 PM, Johannes Sixt [off-list ref] wrote:
Nguyen Thai Ngoc Duy schrieb:
quoted
On Sat, May 24, 2008 at 8:01 PM, Dirk Süsserott [off-list ref] wrote:
quoted
Nguyen Thai Ngoc Duy schrieb:
quoted
Hi,

Is there any way that can make git-diff show cr/nl ending files on
linux without ^M at the end?

Thanks
What about 'git diff -w'? It drops any whitespace changes, including ^M's.
Not sure whether that is what you meant.
That won't help. Here is a snippet of what I see:
diff --git a/abc.c b/abc.c
index 064a769..647b9ae 100644
--- a/abc.c
+++ b/abc.c
@@ -859,7 +859,10 @@ int def
     )
     {
     FAST int asdsa;
-    FAST int dsdsad;
+    FAST int dsadadd;          /* ERROR also means AASAS */^M
+#ifndef JHASHJJH^M
+    struct sdddd dasdada;^M
+#endif^M
     union sddd asdsdad;
     FAST STATUS dsadadad;
     unsigned int sdadadad = 0;
With color turning off, it does not show ^M so probably something to
do with the coloring. less is at version 394.
less does not show \r if it comes right before \n. But with diff-coloring
turned on, the 'reset color' sequence is inserted between \r and \n; now
less shows ^M for the \r because it's not next to the \n anymore.
Right. And setting core.whitespace = cr-at-eol fixes it (although
difficult to find). Thank you all.
-- Hannes


-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help