summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTing-Han Hou <ue081723@gmail.com>2026-10-07 03:44:13 -0500
committerNathan Chancellor <nathan@kernel.org>2026-10-07 14:22:39 +0200
commit72a61a7fef954152abd9df9def4f94816eb344ca (patch)
tree670285eea7817bf88f1006494fa2c00c2012fd1e /scripts
parentc8dd1aa0274d8ad3df82ec1b064065f410ce99ed (diff)
checkkconfigsymbols.py: Parse Git status output line by line
tree_is_dirty() iterates over the string returned by execute() one character at a time. Its status check therefore examines filenames as well as the two status columns. An otherwise clean tree containing an untracked README is reported as dirty because its name contains letters matched by [URMADC]. This prevents --commit and --diff from running, whereas an untracked notes.txt does not trigger the check. Split the output into lines before examining the two status columns so that filenames do not affect the dirty-tree check. Fixes: b1a3f243485f ("checkkconfigsymbols.py: make it Git aware") Assisted-by: LLM Signed-off-by: Ting-Han Hou <ue081723@gmail.com> Link: https://patch.msgid.link/CA+NtrhQqXgjT+4eg6W4P94Hc=DqdV3gQXz3EKKCxWvdWzfND6A@mail.gmail.com Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkkconfigsymbols.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkkconfigsymbols.py b/scripts/checkkconfigsymbols.py
index 36c920e71313..9f7aed98d91c 100755
--- a/scripts/checkkconfigsymbols.py
+++ b/scripts/checkkconfigsymbols.py
@@ -245,7 +245,7 @@ def tree_is_dirty():
"""Return true if the current working tree is dirty (i.e., if any file has
been added, deleted, modified, renamed or copied but not committed)."""
stdout = execute(["git", "status", "--porcelain"])
- for line in stdout:
+ for line in stdout.splitlines():
if re.findall(r"[URMADC]{1}", line[:2]):
return True
return False