[PATCH] buildsys: Help git-diff adding .gitattributes config file

Philippe Mathieu-Daudé posted 1 patch 5 years, 1 month ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201014082209.3712625-1-philmd@redhat.com
.gitattributes | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 .gitattributes
[PATCH] buildsys: Help git-diff adding .gitattributes config file
Posted by Philippe Mathieu-Daudé 5 years, 1 month ago
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
-- 
2.26.2

Re: [PATCH] buildsys: Help git-diff adding .gitattributes config file
Posted by Philippe Mathieu-Daudé 4 years, 12 months ago
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
> 


Re: [PATCH] buildsys: Help git-diff adding .gitattributes config file
Posted by Marc-André Lureau 4 years, 12 months ago
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