From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 7l+6COmxImpX6DUAWB0awg (envelope-from ) for ; Fri, 05 Jun 2026 07:24:25 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=sUfOc1n7; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=tTIT146N; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=sUfOc1n7; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=tTIT146N; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 13E511E0A6; Fri, 05 Jun 2026 07:24:25 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5261D1E062 for ; Fri, 05 Jun 2026 07:24:24 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 825714BAD17A for ; Fri, 5 Jun 2026 11:24:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 825714BAD17A Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=sUfOc1n7; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=tTIT146N; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=sUfOc1n7; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=tTIT146N Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id D15424BA543C for ; Fri, 5 Jun 2026 11:23:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D15424BA543C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D15424BA543C Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780658631; cv=none; b=mpc93Po2IodF/nGSeDZbVSxozPXYZC7D0QTycaMqrClzjpCtO4OanfrfrhpnRyZ0OaV2gt920VWJx/HYoA0KmoNNRI3IyROhqhuO0xTEnCkuuPzwC50Ihb6HFJz14SsQ+3Fzd1Mio9CfeQYa5n/BeUSc1zMYwM0uKdflOeSFTWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780658631; c=relaxed/simple; bh=2F/2C6Wb1nr3yasNUv740isx3ODwfh2G7fQIvbsSaeM=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:From:To; b=yA+ET+s5lUhLXA+qJnydZ2Wa8wG3wU8YsYzpvyMTOnYQmvvz9JWD/zEA5p3TljwNnd5qkdA50nBibDbehILBKlT3a0t6+6/1hcOeirKMVVNPvsf4wfSINKy8aYichGUY7g63uW6AhnbVRITTntx2FKcX+3X1tC1Zu6Ja/wiaqQU= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=sUfOc1n7; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=tTIT146N; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=sUfOc1n7; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=tTIT146N DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D15424BA543C Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id C6B7568662 for ; Fri, 5 Jun 2026 11:23:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1780658629; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3U5HxlU/xYIL1hrQEOnJ5HQcIOXhQ+i3OYKIDRKIKfM=; b=sUfOc1n7tCAtqlicgFhWc4tMcLKK6XtfTUoup4hp0QwacjxElAyG0Vo6CTgmHtjEW7UODL XPf9KWWAXVrWupRz4pvkPlewvQgEQSaWzWEthE7BoMYwYbOcXsCJ8QBDWuQpI558TNU9df iPDiVbS9Tni7OncSunGp3USdjqUag3Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1780658629; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3U5HxlU/xYIL1hrQEOnJ5HQcIOXhQ+i3OYKIDRKIKfM=; b=tTIT146Nx8I6IP4X4/eJJKwcuBUUyZOOP85acoEkYf/vw7EGXhf375bTnp54dI7KIP4Kub SocVtRnJbG0WwQAA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1780658629; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3U5HxlU/xYIL1hrQEOnJ5HQcIOXhQ+i3OYKIDRKIKfM=; b=sUfOc1n7tCAtqlicgFhWc4tMcLKK6XtfTUoup4hp0QwacjxElAyG0Vo6CTgmHtjEW7UODL XPf9KWWAXVrWupRz4pvkPlewvQgEQSaWzWEthE7BoMYwYbOcXsCJ8QBDWuQpI558TNU9df iPDiVbS9Tni7OncSunGp3USdjqUag3Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1780658629; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3U5HxlU/xYIL1hrQEOnJ5HQcIOXhQ+i3OYKIDRKIKfM=; b=tTIT146Nx8I6IP4X4/eJJKwcuBUUyZOOP85acoEkYf/vw7EGXhf375bTnp54dI7KIP4Kub SocVtRnJbG0WwQAA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id B6DD9779A8 for ; Fri, 5 Jun 2026 11:23:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id ZrluK8WxImpdGAAAD6G6ig (envelope-from ) for ; Fri, 05 Jun 2026 11:23:49 +0000 Message-ID: <10b08b72-5387-4cc5-bca2-cbdeaa03d1b6@suse.de> Date: Fri, 5 Jun 2026 13:23:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [pre-commit] Add file mode check From: Tom de Vries To: gdb-patches@sourceware.org References: <20260603121856.212613-1-tdevries@suse.de> Content-Language: en-US In-Reply-To: <20260603121856.212613-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid, gnu.org:url, imap1.dmz-prg2.suse.org:helo] X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 6/3/26 2:18 PM, Tom de Vries wrote: > Claude Code mentioned in a review that a source file was marked executable. > > I've submitted a patch to fix this [1]. > > Detect this problem using pre-commit to prevent it from re-occurring. > > The current unfixed state gives us (abbreviated output using "..."): > ... > $ pre-commit run check-file-mode --all-files > check-file-mode.........................................................Failed > - hook id: check-file-mode > - exit code: 1 > > 100755 ... gdb/testsuite/gdb.base/jump_multiple_objfiles.h > 100755 ... gdb/testsuite/gdb.fortran/nested-funcs.f90 > 100755 ... gdb/testsuite/gdb.fortran/oop_extend_type.f90 > 100755 ... gdb/amd64-tdep.c > 100755 ... gdb/testsuite/lib/compiler.cc > 100755 ... gdb/testsuite/gdb.fortran/nested-funcs.exp > 100755 ... gdb/testsuite/gdb.fortran/vla-type.f90 > 100755 ... gdb/testsuite/gdb.arch/amd64-lam.c > 100755 ... gdb/testsuite/gdb.base/jump_multiple_objfiles.exp > 100755 ... gdb/testsuite/gdb.testsuite/gdb_test_multiple-lbl.gdb > 100755 ... gdb/testsuite/gdb.btrace/exception.exp > 100755 ... gdb/testsuite/gdb.fortran/vla-type.exp > 100755 ... gdb/testsuite/gdb.base/jump_multiple_objfiles.c > 100755 ... gdb/testsuite/gdb.base/jump_multiple_objfiles-foo.c > 100755 ... gdb/testsuite/gdb.fortran/oop_extend_type.exp > 100755 ... gdb/testsuite/gdb.fortran/print_type.exp > ... > > Shell-checked new script gdb/contrib/check-file-mode.sh. > I realized that the new script does handle it if git fails, so I've submitted a v2 handling this ( https://sourceware.org/pipermail/gdb-patches/2026-June/227825.html ). Thanks, - Tom > [1] https://sourceware.org/pipermail/gdb-patches/2026-June/227780.html > --- > .pre-commit-config.yaml | 5 ++++ > gdb/contrib/check-file-mode.sh | 42 ++++++++++++++++++++++++++++++++++ > 2 files changed, 47 insertions(+) > create mode 100755 gdb/contrib/check-file-mode.sh > > diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml > index fe8466433ac..d75468d0b48 100644 > --- a/.pre-commit-config.yaml > +++ b/.pre-commit-config.yaml > @@ -112,6 +112,11 @@ repos: > additional_dependencies: ["pyyaml"] > always_run: true > require_serial: true > + - id: check-file-mode > + name: check-file-mode > + language: script > + entry: gdb/contrib/check-file-mode.sh > + files: '^(gdb|gdbserver|gdbsupport)/.*$' > - repo: https://github.com/nmoroze/tclint > rev: v0.8.0 > hooks: > diff --git a/gdb/contrib/check-file-mode.sh b/gdb/contrib/check-file-mode.sh > new file mode 100755 > index 00000000000..a558731c425 > --- /dev/null > +++ b/gdb/contrib/check-file-mode.sh > @@ -0,0 +1,42 @@ > +#!/bin/bash > + > +# Copyright (C) 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 . > + > +set -e > + > +no_exec_files=() > +for f in "$@"; do > + case $f in > + */*.py|*/*.sh|*/configure) > + continue > + ;; > + gdb/gstack-1.in|gdb/gcore-1.in|gdb/po/gdbtext|gdb/make-init-c|gdb/testsuite/lib/notty-wrap|gdb/testsuite/lib/pdtrace.in) > + continue > + ;; > + *) > + no_exec_files=("${no_exec_files[@]}" "$f") > + ;; > + esac > +done > + > +if [ ${#no_exec_files[@]} -eq 0 ]; then > + exit 0 > +fi > + > +# Flag files that are executable, but not meant to be executable. > + > +if git ls-files --stage -- "${no_exec_files[@]}" | grep '^100755 '; then > + exit 1 > +fi > > base-commit: 663cb9c0428068165fc98675599442163d302d41