Skip to contentSkip to conversation

buildsys: Help git-diff adding .gitattributes config file

PATCH In review Philippe Mathieu-Daudé 2 participants 3 messages Oct 14, 2020 – Nov 17, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 buildsys: Help git-diff adding .gitattributes config file

Since commits 0979ed017f0 ("meson: rename .inc.h files to .h.inc") and 139c1837db7 ("meson: rename included C source files to .c.inc") 'git-diff --function-context' stopped displaying C function context correctly.
We can help git-diff by providing attributes to the .[ch].inc path names. See:
https://git-scm.com/docs/gitattributes#_generating_diff_text

---
 .gitattributes | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 .gitattributes
.gitattributes new file +2 -0
new file mode 100644
index 00000000000..3d2fe2ecda8
@@ -0,0 +1,2 @@
+*.c.inc         diff=c
+*.h.inc         diff=c
Signature · 1 line
2.26.2
#1 lore raw

ping?

Quoted 23 lines · Philippe Mathieu-Daudé

Since commits 0979ed017f0 ("meson: rename .inc.h files to .h.inc") and 139c1837db7 ("meson: rename included C source files to .c.inc") 'git-diff --function-context' stopped displaying C function context correctly.
We can help git-diff by providing attributes to the .[ch].inc path names. See:
https://git-scm.com/docs/gitattributes#_generating_diff_text

---
 .gitattributes | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 .gitattributes
.gitattributes new file +2 -0
new file mode 100644
index 00000000000..3d2fe2ecda8
@@ -0,0 +1,2 @@
+*.c.inc         diff=c
+*.h.inc         diff=c
Reviewed-by on v1 1/1
#2 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 10 lines · Philippe Mathieu-Daudé

Since commits 0979ed017f0 ("meson: rename .inc.h files to .h.inc") and 139c1837db7 ("meson: rename included C source files to .c.inc") 'git-diff --function-context' stopped displaying C function context correctly.
We can help git-diff by providing attributes to the .[ch].inc path names. See:
https://git-scm.com/docs/gitattributes#_generating_diff_text

Quoted 18 lines
---
 .gitattributes | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 .gitattributes
.gitattributes new file +2 -1
new file mode 100644
index 00000000000..3d2fe2ecda8
@@ -0,0 +1,2 @@
+*.c.inc         diff=c
+*.h.inc         diff=c
--

2.26.2

Signature · 1 line
Marc-André Lureau