From e572e1cd080217bf75522c165fc0d2b81c3d0270 Mon Sep 17 00:00:00 2001 From: Ihor Solodrai Date: Thu, 1 Oct 2026 13:53:36 -0700 Subject: [PATCH] sync: avoid brace expansion in the tree filter git filter-branch evaluates the tree filter with /bin/sh. Where that's dash (Debian, Ubuntu), the brace expression in the git rm command is not expanded, so src/{Makefile,Build,test_libbpf.c,.gitignore} are never removed. The sync then fails comparing Linux and GitHub file lists, and synced patches could touch GitHub's own src/Makefile. List the files explicitly. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Ihor Solodrai --- scripts/sync-kernel.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/sync-kernel.sh b/scripts/sync-kernel.sh index a07e376..aafe408 100755 --- a/scripts/sync-kernel.sh +++ b/scripts/sync-kernel.sh @@ -86,7 +86,8 @@ for p in "${!PATH_MAP[@]}"; do LIBBPF_TREE_FILTER+="git mv -kf ${p} __libbpf/${PATH_MAP[${p}]} && "$'\\\n' done LIBBPF_TREE_FILTER+="find __libbpf/include/uapi/linux -type f -exec sed -i -e 's/_UAPI\(__\?LINUX\)/\1/g' -e 's@^#include @@' {} + && "$'\\\n' -LIBBPF_TREE_FILTER+="git rm --ignore-unmatch -f __libbpf/src/{Makefile,Build,test_libbpf.c,.gitignore} >/dev/null" +# git filter-branch evaluates the filter with /bin/sh, so no bashisms here +LIBBPF_TREE_FILTER+="git rm --ignore-unmatch -f __libbpf/src/Makefile __libbpf/src/Build __libbpf/src/test_libbpf.c __libbpf/src/.gitignore >/dev/null" cd_to() {