diff mbox series

buildsys: Help git-diff adding .gitattributes config file

Message ID 20201014082209.3712625-1-philmd@redhat.com
State Accepted
Commit 29cf16db23e605769f6d89c47a1d45ef3373b88e
Headers show
Series buildsys: Help git-diff adding .gitattributes config file | expand

Commit Message

Philippe Mathieu-Daudé Oct. 14, 2020, 8:22 a.m. UTC
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

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 .gitattributes | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 .gitattributes

Comments

Philippe Mathieu-Daudé Nov. 17, 2020, 3:32 p.m. UTC | #1
ping?

On 10/14/20 10:22 AM, Philippe Mathieu-Daudé wrote:
> 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

> 

> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---

>  .gitattributes | 2 ++

>  1 file changed, 2 insertions(+)

>  create mode 100644 .gitattributes

> 

> diff --git a/.gitattributes b/.gitattributes

> new file mode 100644

> index 00000000000..3d2fe2ecda8

> --- /dev/null

> +++ b/.gitattributes

> @@ -0,0 +1,2 @@

> +*.c.inc         diff=c

> +*.h.inc         diff=c

>
Marc-André Lureau Nov. 17, 2020, 3:38 p.m. UTC | #2
On Wed, Oct 14, 2020 at 12:25 PM Philippe Mathieu-Daudé <philmd@redhat.com>
wrote:

> 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

>

> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

>


Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>



> ---

>  .gitattributes | 2 ++

>  1 file changed, 2 insertions(+)

>  create mode 100644 .gitattributes

>

> diff --git a/.gitattributes b/.gitattributes

> new file mode 100644

> index 00000000000..3d2fe2ecda8

> --- /dev/null

> +++ b/.gitattributes

> @@ -0,0 +1,2 @@

> +*.c.inc         diff=c

> +*.h.inc         diff=c

> --

> 2.26.2

>

>

>


-- 
Marc-André Lureau
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 14, 2020 at 12:25 PM Philippe Mathieu-Daudé &lt;<a href="mailto:philmd@redhat.com">philmd@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Since commits 0979ed017f0 (&quot;meson: rename .inc.h files to .h.inc&quot;)<br>
and 139c1837db7 (&quot;meson: rename included C source files to .c.inc&quot;)<br>
&#39;git-diff --function-context&#39; stopped displaying C function context<br>
correctly.<br>
We can help git-diff by providing attributes to the .[ch].inc path<br>
names. See:<br>
<a href="https://git-scm.com/docs/gitattributes#_generating_diff_text" rel="noreferrer" target="_blank">https://git-scm.com/docs/gitattributes#_generating_diff_text</a><br>
<br>
Signed-off-by: Philippe Mathieu-Daudé &lt;<a href="mailto:philmd@redhat.com" target="_blank">philmd@redhat.com</a>&gt;<br></blockquote><div><br></div><div>Reviewed-by: Marc-André Lureau &lt;<a href="mailto:marcandre.lureau@redhat.com">marcandre.lureau@redhat.com</a>&gt; </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

---<br>
 .gitattributes | 2 ++<br>
 1 file changed, 2 insertions(+)<br>
 create mode 100644 .gitattributes<br>
<br>
diff --git a/.gitattributes b/.gitattributes<br>
new file mode 100644<br>
index 00000000000..3d2fe2ecda8<br>
--- /dev/null<br>
+++ b/.gitattributes<br>
@@ -0,0 +1,2 @@<br>
+*.c.inc         diff=c<br>
+*.h.inc         diff=c<br>
-- <br>
2.26.2<br>
<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Marc-André Lureau<br></div></div>
diff mbox series

Patch

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000000..3d2fe2ecda8
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@ 
+*.c.inc         diff=c
+*.h.inc         diff=c