]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[pre-commit] Set default_stages to pre-commit
authorTom de Vries <tdevries@suse.de>
Tue, 30 Sep 2025 16:45:44 +0000 (18:45 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 30 Sep 2025 16:45:44 +0000 (18:45 +0200)
commitcb1133022a7b65a291eeb6e06f944ee12df04bb5
treeab649a8ea10613b7d593cda02da721823b0ebabb
parent7d43a7afc1a8193a93f534c1b6875630d3b83612
[pre-commit] Set default_stages to pre-commit

I realized I was seeing the newly added tclint check twice:
...
$ touch gdb/testsuite/gdb.base/foo.exp
$ git add gdb/testsuite/gdb.base/foo.exp
$ git commit -a -m foo 2>&1 | grep tclint
tclint..................................................................Passed
tclint..............................................(no files to check)Skipped
$
...

The hook is run once for stage pre-commit, and once for stage commit-msg.

Since the hook doesn't specify a stage at which it's supposed to be run, it
takes its default from default_stages, which defaults to all stages.

Fix this by setting default_stages to pre-commit:
...
$ git commit -a -m foo 2>&1 | grep tclint
tclint..................................................................Passed
$
...

The only hook sofar that needs a different stage than pre-commit is
codespell-log, and it's not affected by this change because it has an explicit
"stages: [commit-msg]" setting.

Approved-By: Tom Tromey <tom@tromey.com>
.pre-commit-config.yaml