]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb] Fix whitespace in NEWS
authorTom de Vries <tdevries@suse.de>
Tue, 9 Dec 2025 23:25:20 +0000 (00:25 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 9 Dec 2025 23:25:20 +0000 (00:25 +0100)
Fix this:
...
$ empty=$(git hash-object -t tree /dev/null)
$ git diff-index --check $empty gdb/NEWS
gdb/NEWS:1874: space before tab in indent.
+                            [--basename | --dirname]
...
and add the file to the clean list in
gdb/contrib/check-whitespace-pre-commit.py.

[ I'm not sure if NEWS has an official style.

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

We could require either spaces only (tab-in-indent) in gdb/.gitattributes:
...
NEWS whitespace=space-before-tab,tab-in-indent,trailing-space
...
or tab style (indent-with-non-tab):
...
NEWS whitespace=space-before-tab,indent-with-non-tab,trailing-space
...

For tab-in-indent, we get:
...
$ git diff-index --check $empty gdb/NEWS  | wc -l
228
...
and for indent-with-non-tab instead:
...
$ git diff-index --check $empty gdb/NEWS  | wc -l
40
...
so the more common style seems to be tab style.

But I'm leaving this as is for now. ]

gdb/NEWS
gdb/contrib/check-whitespace-pre-commit.py

index 381536cc5f97eb8478ee632633e1abbc35c67b77..3b0a7f7c3d3413e6d6e68d407d35c696bad2e850 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -1881,7 +1881,7 @@ GNU/Linux/OpenRISC                or1k*-*-linux*
     the '-force' flag of the CLI's "cond" command.
 
  ** '-file-list-exec-source-files [--group-by-objfile]
-                                 [--basename | --dirname]
+                                 [--basename | --dirname]
                                   [--] [REGEXP]'
 
     The existing -file-list-exec-source-files command now takes an
index d7fa45d1529a8fb204cd11e364e75e2d4343e9e4..9d82f7749a08ab95897a86e55ed4dbe46069b86e 100755 (executable)
@@ -19,7 +19,7 @@ import subprocess
 import sys
 
 re_clean = re.compile(
-    "(^(gdb/testsuite/|gdbsupport/|gdbserver/)|[.](m4|ac|def|[chly])$)"
+    "(^(gdb/testsuite/|gdbsupport/|gdbserver/)|[.](m4|ac|def|[chly])$|NEWS)"
 )
 re_clean_exclude = re.compile("^(gdb/symfile.c|gdb/cli/cli-cmds.c)$")