Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [RFC 2/2] [pre-commit] Require codespell-clean commit messages
Date: Sat, 25 Jul 2026 11:02:26 +0200	[thread overview]
Message-ID: <20260725090226.839799-3-tdevries@suse.de> (raw)
In-Reply-To: <20260725090226.839799-1-tdevries@suse.de>

Now that we have an easy method to ignore intentional typos in commit
messages:
...
Fix typo skippig [sic].
...
require commit messages to be codespell-clean.

Still, this may mean that large blocks of verbatim text (for instance
backtraces) might have to be ignored using
codespell:ignore-begin/codespell:ignore-end.

To restart editing after check failure, this command can be used:
...
$ git commit --amend
  <codespell-log check failure>
$ git commit --amend -F .git/COMMIT_EDITMSG -e
...

Having your commit abort is somewhat annoying, and I thought of two ways to
make this less annoying:
- add an interactive loop that allows the user to re-edit or ignore the
  codespell failure
- in case of codespell failure, add codespell:ignore-begin codespell:ignore-end
  around the entire message, and pass
---
 .pre-commit-config.yaml      |  2 --
 gdb/contrib/codespell-log.sh | 20 --------------------
 2 files changed, 22 deletions(-)
 delete mode 100755 gdb/contrib/codespell-log.sh

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 60164e446fc..76991b7d18a 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -87,9 +87,7 @@ repos:
       files: &gdb_files '^(gdb|gdbserver|gdbsupport)/'
     - id: codespell
       name: codespell-log
-      entry: gdb/contrib/codespell-log.sh
       args: *codespell_args
-      verbose: true
       stages: [commit-msg]
 
   # Tclint hooks.
diff --git a/gdb/contrib/codespell-log.sh b/gdb/contrib/codespell-log.sh
deleted file mode 100755
index 3e1fc26159a..00000000000
--- a/gdb/contrib/codespell-log.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2025-2026 Free Software Foundation, Inc.
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Script to be used as commit-msg hook to spell-check the commit log using
-# codespell.
-
-codespell "$@" || true
-- 
2.51.0


      parent reply	other threads:[~2026-07-25  9:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-25  9:02 [RFC 0/2] " Tom de Vries
2026-07-25  9:02 ` [RFC 1/2] [gdb] Ignore codespell errors followed by sic marker Tom de Vries
2026-07-25  9:02 ` Tom de Vries [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260725090226.839799-3-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox