binutils-gdb/git: Handle *.ac and *.m4 files in .gitattributes

Message ID 20251203085111.3655102-1-tdevries@suse.de
State New
Headers
Series binutils-gdb/git: Handle *.ac and *.m4 files in .gitattributes |

Commit Message

Tom de Vries Dec. 3, 2025, 8:51 a.m. UTC
  Since commit 52ca3d3fe61 ("toplevel: unify the GCC and GDB/binutils .editorconfig
files"), .editorconfig has settings for .ac and .m4 files:
...
[*.{ac,m4}]
indent_style = tab
indent_size = 2
trim_trailing_whitespace = true
...

There are no setting for those files in .gitattributes, so the whitespace
attribute defaults to trailing-space (shorthand for blank-at-eol,
blank-at-eof) and space-before-tab.

Since according to .editorconfig the indentation style is tab, add
indent-with-non-tab as well.

Since aclocal.m4 is generated, unset the whitespace attribute.  Likewise for
configure.
---
 .gitattributes | 10 ++++++++++
 1 file changed, 10 insertions(+)


base-commit: d03293898d81e4273ac7f9163a8186dba46db0e5
  

Comments

Tom Tromey Dec. 4, 2025, 4:32 p.m. UTC | #1
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> Since commit 52ca3d3fe61 ("toplevel: unify the GCC and GDB/binutils .editorconfig
Tom> files"), .editorconfig has settings for .ac and .m4 files:
Tom> ...
Tom> [*.{ac,m4}]
Tom> indent_style = tab
Tom> indent_size = 2
Tom> trim_trailing_whitespace = true
Tom> ...

Tom> There are no setting for those files in .gitattributes, so the whitespace
Tom> attribute defaults to trailing-space (shorthand for blank-at-eol,
Tom> blank-at-eof) and space-before-tab.

Tom> Since according to .editorconfig the indentation style is tab, add
Tom> indent-with-non-tab as well.

Tom> Since aclocal.m4 is generated, unset the whitespace attribute.  Likewise for
Tom> configure.

FWIW this seems fine to me.

Tom
  
Tom de Vries Dec. 17, 2025, 9:25 p.m. UTC | #2
On 12/3/25 9:51 AM, Tom de Vries wrote:
> Since commit 52ca3d3fe61 ("toplevel: unify the GCC and GDB/binutils .editorconfig
> files"), .editorconfig has settings for .ac and .m4 files:
> ...
> [*.{ac,m4}]
> indent_style = tab
> indent_size = 2
> trim_trailing_whitespace = true
> ...
> 
> There are no setting for those files in .gitattributes, so the whitespace
> attribute defaults to trailing-space (shorthand for blank-at-eol,
> blank-at-eof) and space-before-tab.
> 
> Since according to .editorconfig the indentation style is tab, add
> indent-with-non-tab as well.
> 
> Since aclocal.m4 is generated, unset the whitespace attribute.  Likewise for
> configure.

Ping.

Thanks,
- Tom

> ---
>   .gitattributes | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/.gitattributes b/.gitattributes
> index 6f7c6d8ba52..3639ebcfe55 100644
> --- a/.gitattributes
> +++ b/.gitattributes
> @@ -33,3 +33,13 @@ ChangeLog       merge=merge-changelog
>   *.[cChH] whitespace=space-before-tab,indent-with-non-tab,trailing-space
>   *.exp whitespace=space-before-tab,indent-with-non-tab,trailing-space
>   *.tcl whitespace=space-before-tab,indent-with-non-tab,trailing-space
> +
> +# Autoconf.
> +
> +*.ac	whitespace=space-before-tab,indent-with-non-tab,trailing-space
> +*.m4	whitespace=space-before-tab,indent-with-non-tab,trailing-space
> +
> +# Generated files.
> +
> +configure   -whitespace
> +aclocal.m4  -whitespace
> 
> base-commit: d03293898d81e4273ac7f9163a8186dba46db0e5
  
Alan Modra Dec. 18, 2025, 12:18 a.m. UTC | #3
On Wed, Dec 17, 2025 at 10:25:24PM +0100, Tom de Vries wrote:
> On 12/3/25 9:51 AM, Tom de Vries wrote:
> > Since commit 52ca3d3fe61 ("toplevel: unify the GCC and GDB/binutils .editorconfig
> > files"), .editorconfig has settings for .ac and .m4 files:
> > ...
> > [*.{ac,m4}]
> > indent_style = tab
> > indent_size = 2
> > trim_trailing_whitespace = true
> > ...
> > 
> > There are no setting for those files in .gitattributes, so the whitespace
> > attribute defaults to trailing-space (shorthand for blank-at-eol,
> > blank-at-eof) and space-before-tab.
> > 
> > Since according to .editorconfig the indentation style is tab, add
> > indent-with-non-tab as well.
> > 
> > Since aclocal.m4 is generated, unset the whitespace attribute.  Likewise for
> > configure.
> 
> Ping.

I'll rubber-stamp this for the binutils side, but IMO there is no need
for a global gdb maintainer to wait for approval from binutils
maintainers for this shared file.
  
Maciej W. Rozycki Dec. 30, 2025, 10:54 p.m. UTC | #4
[+cc GCC]

On Thu, 18 Dec 2025, Alan Modra wrote:

> I'll rubber-stamp this for the binutils side, but IMO there is no need
> for a global gdb maintainer to wait for approval from binutils
> maintainers for this shared file.

 Should this be documented in top-level MAINTAINERS?  Should this file be 
kept in sync with GCC?

  Maciej
  

Patch

diff --git a/.gitattributes b/.gitattributes
index 6f7c6d8ba52..3639ebcfe55 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -33,3 +33,13 @@  ChangeLog       merge=merge-changelog
 *.[cChH] whitespace=space-before-tab,indent-with-non-tab,trailing-space
 *.exp whitespace=space-before-tab,indent-with-non-tab,trailing-space
 *.tcl whitespace=space-before-tab,indent-with-non-tab,trailing-space
+
+# Autoconf.
+
+*.ac	whitespace=space-before-tab,indent-with-non-tab,trailing-space
+*.m4	whitespace=space-before-tab,indent-with-non-tab,trailing-space
+
+# Generated files.
+
+configure   -whitespace
+aclocal.m4  -whitespace