[PATCH v2 0/2] scripts: support sparse checkouts in checkpatch tools

From: CaoRuichuang

Date: Sun Apr 05 2026 - 15:16:54 EST


checkpatch.pl and get_maintainer.pl currently reject sparse checkouts because their top_of_kernel_tree() checks require top-level directories that may not be present in a sparse working tree.

This series relaxes that check to match the files the scripts actually need and adds a regression test to keep that behavior from regressing.

Changes in v2:
- add a regression test for sparse checkout handling in checkpatch.pl and
get_maintainer.pl


CaoRuichuang (2):
scripts: allow checkpatch and get_maintainer in sparse checkouts
scripts: add sparse checkout regression test for checkpatch tools

scripts/checkpatch-sparse-checkout-test.sh | 48 ++++++++++++++++++++++
scripts/checkpatch.pl | 4 +-
scripts/get_maintainer.pl | 9 +---
3 files changed, 51 insertions(+), 10 deletions(-)
create mode 100755 scripts/checkpatch-sparse-checkout-test.sh

--
2.39.5 (Apple Git-154)